wok annotate 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
rev   line source
pascal@236 1 # SliTaz package receipt.
pascal@236 2
pascal@236 3 PACKAGE="squashfs"
pascal@236 4 WANTED="linux"
pascal@236 5 VERSION="3.3"
pascal@236 6 CATEGORY="base-system"
pascal@236 7 SHORT_DESC="Linux squashfs module and userland tools."
pascal@236 8 MAINTAINER="pascal.bellard@slitaz.org"
pascal@236 9 WEB_SITE="http://$PACKAGE.sourceforge.net/"
pascal@236 10 TARBALL="squashfs$VERSION.tgz"
pascal@236 11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
pascal@236 12 DEPENDS="zlib"
pascal@236 13 BUILD_DEPENDS="zlib-dev perl"
pascal@236 14
pascal@236 15 # Rules to configure and make the package.
pascal@236 16 compile_rules()
pascal@236 17 {
pascal@236 18 local kver
pascal@236 19 local patch_dir
pascal@236 20
pascal@236 21 # get kernel version
pascal@236 22 kver=$(grep "kernel version" ../linux/linux-*/.config)
pascal@236 23 kver=${kver##* }
pascal@236 24
pascal@236 25 # Select patch according to kernel version
pascal@236 26 patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-${kver%.*}
pascal@236 27 if [ -f ${PACKAGE}${VERSION}/kernel-patches/linux-$kver ]; then
pascal@236 28 patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-$kver
pascal@236 29 fi
pascal@236 30 [ -d $patch_dir ] || return 1
pascal@236 31 [ -d _kernel ] && rm -rf _kernel
pascal@236 32 mkdir _kernel
pascal@236 33 cd _kernel
pascal@236 34 ln -s ../../linux/linux-$kver* src
pascal@236 35
pascal@236 36 # Copy files to be patched in local aera
pascal@236 37 # Do not alter kernel sources !!
pascal@236 38 for i in $(grep ^--- ../$patch_dir/${PACKAGE}${VERSION}-patch | \
pascal@236 39 awk '{ if ($3 != "1970-01-01") print $2 } '); do
pascal@236 40 ( cd src ; tar cf - ${i#*/}) | tar xf -
pascal@236 41 done
pascal@236 42
pascal@236 43 # Apply squashfs patches in local aera
pascal@236 44 patch -Np1 < ../$patch_dir/${PACKAGE}${VERSION}-patch
pascal@236 45
pascal@236 46 # Move every files in fs/squashfs directory
pascal@236 47 find include -type f -exec cp {} fs/squashfs \;
pascal@236 48
pascal@236 49 # Hardcoded options
pascal@236 50 perl -pi -e 's/CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE/3/g' fs/squashfs/*
pascal@236 51
pascal@236 52 # Build kernel module
pascal@236 53 make -C src/. SUBDIRS=$(pwd)/fs/squashfs/ modules
pascal@236 54 cd ..
pascal@236 55 [ -d _pkg ] && rm -rf _pkg
pascal@236 56 mkdir -p _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs _pkg/usr/sbin
pascal@236 57 cp _kernel/fs/squashfs/squashfs.ko \
pascal@236 58 _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko
pascal@236 59 gzip -9 _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko
pascal@236 60
pascal@236 61 # Build user land tools
pascal@236 62 cd ${PACKAGE}${VERSION}/squashfs-tools
pascal@236 63 make
pascal@236 64 cp mksquashfs unsquashfs ../../_pkg/usr/sbin
pascal@236 65 }
pascal@236 66
pascal@236 67 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@236 68 genpkg_rules()
pascal@236 69 {
pascal@236 70 cp -a _pkg/* $fs
pascal@236 71 strip -s $fs/usr/sbin/*
pascal@236 72 }
pascal@236 73
pascal@236 74 # Pre and post install commands for Tazpkg.
pascal@236 75 post_install()
pascal@236 76 {
pascal@236 77 depmod -a
pascal@236 78 }