# HG changeset patch # User Pascal Bellard # Date 1230984735 0 # Node ID 1f5b672d24542a2ae2c268b3fbdf85c2132fd6df # Parent 8da74c3a8369b63748a5a887f34c8242079db248 Add compcache diff -r 8da74c3a8369 -r 1f5b672d2454 compcache/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compcache/receipt Sat Jan 03 12:12:15 2009 +0000 @@ -0,0 +1,57 @@ +# SliTaz package receipt. + +PACKAGE="compcache" +VERSION="0.4" +CATEGORY="system-tools" +SHORT_DESC="Compressed caching" +MAINTAINER="fabrice.thiroux@free.fr" +TARBALL="$PACKAGE-$VERSION.tar.gz" +WEB_SITE="http://code.google.com/p/compcache/" +WGET_URL="http://compcache.googlecode.com/files/$TARBALL" +BUILD_DEPENDS="lzma" + +# Rules to configure and make the package. +compile_rules() +{ + + KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g` + if [ ! -d $WOK/linux/linux-$KERNEL_VERSION ]; then + tazwok cook linux + fi + cd $src + find -name Makefile | xargs sed -i \ + "s|/lib/modules/\$(shell uname -r)/build|$WOK/linux/linux-$KERNEL_VERSION|" + make KBUILD=$WOK/linux/linux-$KERNEL_VERSION KVER=$KERNEL_VERSION +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g` + EXTRAVERSION=_$KERNEL_VERSION + + mkdir -p $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc $fs/etc/init.d + + install -o root -m 755 $src/compcache.ko $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc + install -o root -m 755 $src/sub-projects/allocators/tlsf-kmod/tlsf.ko $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc + install -o root -m 755 $src/sub-projects/compression/lzo-kmod/lzo1x_compress.ko $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc + install -o root -m 755 $src/sub-projects/compression/lzo-kmod/lzo1x_decompress.ko $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc + + for i in $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc/*.ko ; do + lzma e $i $i.gz && rm -f $i + done + install -o root -m 755 ./stuff/compcache $fs/etc/init.d/ + install -o root -m 755 ./stuff/compcache.conf $fs/etc/ +} + +post_install() +{ + echo "Processing post-install commands..." + depmod -a -b "$1/" ${EXTRAVERSION#_}-slitaz +} + +post_remove() +{ + echo "Processing post-remove commands..." + depmod -a +} diff -r 8da74c3a8369 -r 1f5b672d2454 compcache/stuff/compcache --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compcache/stuff/compcache Sat Jan 03 12:12:15 2009 +0000 @@ -0,0 +1,45 @@ +#!/bin/sh +# /etc/init.d/compcache: Start, stop and restart COMPCACHE daemon on SliTaz, +# at boot time or with the command line. Daemons options are configured +# with /etc/daemons.conf +# +. /etc/init.d/rc.functions +. /etc/compcache.conf + +NAME=COMPCACHE +EXIST=`cat /proc/swaps | grep ramzswap0` + +case "$1" in + start) + if [ ! "$EXIST" = "" ] ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Loading module" + modprobe compcache # compcache_size_kbytes=$SIZE_KB + status + echo -n "Starting $NAME..." + swapon /dev/ramzswap0 -p 100 + status + ;; + stop) + if [ "$EXIST" = "" ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $NAME... " + swapoff /dev/ramzswap0 + status + echo -n "Unloding modules" + rmmod compcache lzo1x_compress lzo1x_decompress tlsf + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop]" + echo "" + exit 1 + ;; +esac + +exit 0 diff -r 8da74c3a8369 -r 1f5b672d2454 compcache/stuff/compcache.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compcache/stuff/compcache.conf Sat Jan 03 12:12:15 2009 +0000 @@ -0,0 +1,1 @@ +SIZE_KB=0