wok diff squashfs/receipt @ rev 236

Add: squashfs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 17 15:30:24 2008 +0100 (2008-02-17)
parents
children 88157e3ce9ac
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/squashfs/receipt	Sun Feb 17 15:30:24 2008 +0100
     1.3 @@ -0,0 +1,78 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="squashfs"
     1.7 +WANTED="linux"
     1.8 +VERSION="3.3"
     1.9 +CATEGORY="base-system"
    1.10 +SHORT_DESC="Linux squashfs module and userland tools."
    1.11 +MAINTAINER="pascal.bellard@slitaz.org"
    1.12 +WEB_SITE="http://$PACKAGE.sourceforge.net/"
    1.13 +TARBALL="squashfs$VERSION.tgz"
    1.14 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.15 +DEPENDS="zlib"
    1.16 +BUILD_DEPENDS="zlib-dev perl"
    1.17 +
    1.18 +# Rules to configure and make the package.
    1.19 +compile_rules()
    1.20 +{
    1.21 +	local kver
    1.22 +	local patch_dir
    1.23 +
    1.24 +	# get kernel version
    1.25 +	kver=$(grep "kernel version" ../linux/linux-*/.config)
    1.26 +	kver=${kver##* }
    1.27 +
    1.28 +	# Select patch according to kernel version
    1.29 +	patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-${kver%.*}
    1.30 +	if [ -f ${PACKAGE}${VERSION}/kernel-patches/linux-$kver ]; then
    1.31 +	    patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-$kver
    1.32 +	fi
    1.33 +        [ -d $patch_dir ] || return 1
    1.34 +	[ -d _kernel ] && rm -rf _kernel
    1.35 +	mkdir _kernel
    1.36 +	cd _kernel
    1.37 +	ln -s ../../linux/linux-$kver* src
    1.38 +
    1.39 +	# Copy files to be patched in local aera
    1.40 +	# Do not alter kernel sources !!
    1.41 +	for i in $(grep ^--- ../$patch_dir/${PACKAGE}${VERSION}-patch | \
    1.42 +    		awk '{ if ($3 != "1970-01-01") print $2 } '); do
    1.43 +		( cd src ; tar cf - ${i#*/}) | tar xf -
    1.44 +	done
    1.45 +
    1.46 +	# Apply squashfs patches in local aera
    1.47 +	patch -Np1 < ../$patch_dir/${PACKAGE}${VERSION}-patch
    1.48 +
    1.49 +	# Move every files in fs/squashfs directory
    1.50 +	find include -type f -exec cp {} fs/squashfs \;
    1.51 +
    1.52 +	# Hardcoded options
    1.53 +	perl -pi -e 's/CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE/3/g' fs/squashfs/*
    1.54 +	
    1.55 +	# Build kernel module
    1.56 +	make -C src/. SUBDIRS=$(pwd)/fs/squashfs/ modules
    1.57 +	cd ..
    1.58 +	[ -d _pkg ] && rm -rf _pkg
    1.59 +	mkdir -p _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs _pkg/usr/sbin
    1.60 +	cp _kernel/fs/squashfs/squashfs.ko \
    1.61 +        	_pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko
    1.62 +	gzip -9 _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko
    1.63 +
    1.64 +	# Build user land tools
    1.65 +	cd ${PACKAGE}${VERSION}/squashfs-tools
    1.66 +	make
    1.67 +	cp mksquashfs unsquashfs ../../_pkg/usr/sbin
    1.68 +}
    1.69 +
    1.70 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.71 +genpkg_rules()
    1.72 +{
    1.73 +	cp -a _pkg/* $fs
    1.74 +	strip  -s $fs/usr/sbin/*
    1.75 +}
    1.76 +
    1.77 +# Pre and post install commands for Tazpkg.
    1.78 +post_install()
    1.79 +{
    1.80 +	depmod -a
    1.81 +}