wok annotate squashfs/receipt @ rev 242

Shfs & squashfs : check linux cooked
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Feb 18 14:40:48 2008 +0100 (2008-02-18)
parents 88157e3ce9ac
children f1a4f0123071
rev   line source
pascal@236 1 # SliTaz package receipt.
pascal@236 2
pascal@236 3 PACKAGE="squashfs"
pascal@236 4 VERSION="3.3"
pascal@236 5 CATEGORY="base-system"
pascal@236 6 SHORT_DESC="Linux squashfs module and userland tools."
pascal@236 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@236 8 WEB_SITE="http://$PACKAGE.sourceforge.net/"
pascal@236 9 TARBALL="squashfs$VERSION.tgz"
pascal@236 10 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
pascal@236 11 DEPENDS="zlib"
pascal@240 12 BUILD_DEPENDS="zlib-dev"
pascal@236 13
pascal@236 14 # Rules to configure and make the package.
pascal@236 15 compile_rules()
pascal@236 16 {
pascal@236 17 local kver
pascal@236 18 local patch_dir
pascal@236 19
pascal@236 20 # get kernel version
pascal@242 21 if [ ! -d ../linux/taz ]; then
pascal@242 22 tazwok cook linux
pascal@242 23 fi
pascal@236 24 kver=$(grep "kernel version" ../linux/linux-*/.config)
pascal@236 25 kver=${kver##* }
pascal@236 26
pascal@236 27 # Select patch according to kernel version
pascal@236 28 patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-${kver%.*}
pascal@236 29 if [ -f ${PACKAGE}${VERSION}/kernel-patches/linux-$kver ]; then
pascal@240 30 patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-$kver
pascal@236 31 fi
pascal@240 32 if [ ! -d $patch_dir ]; then
pascal@240 33 echo "No squashfs patchset for kernel $ker. Abort."
pascal@240 34 return 1
pascal@240 35 fi
pascal@236 36 [ -d _kernel ] && rm -rf _kernel
pascal@236 37 mkdir _kernel
pascal@236 38 cd _kernel
pascal@236 39 ln -s ../../linux/linux-$kver* src
pascal@236 40
pascal@236 41 # Copy files to be patched in local aera
pascal@236 42 # Do not alter kernel sources !!
pascal@236 43 for i in $(grep ^--- ../$patch_dir/${PACKAGE}${VERSION}-patch | \
pascal@236 44 awk '{ if ($3 != "1970-01-01") print $2 } '); do
pascal@236 45 ( cd src ; tar cf - ${i#*/}) | tar xf -
pascal@236 46 done
pascal@236 47
pascal@236 48 # Apply squashfs patches in local aera
pascal@236 49 patch -Np1 < ../$patch_dir/${PACKAGE}${VERSION}-patch
pascal@236 50
pascal@236 51 # Move every files in fs/squashfs directory
pascal@240 52 mv include/linux/* fs/squashfs
pascal@240 53 ln -s . fs/squashfs/linux
pascal@240 54 for i in fs/squashfs/*.c fs/squashfs/*.h ; do
pascal@240 55 sed -e 's/#include <\(linux\/squashfs.*\)>.*/#include "\1"/g' > $i.$$ < $i
pascal@240 56 sed -e 's/CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE/3/g' > $i < $i.$$
pascal@240 57 done
pascal@236 58
pascal@236 59 # Build kernel module
pascal@240 60 make -C src/. SUBDIRS=$(pwd)/fs/squashfs/ CONFIG_SQUASHFS=m modules
pascal@236 61 cd ..
pascal@236 62 [ -d _pkg ] && rm -rf _pkg
pascal@236 63 mkdir -p _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs _pkg/usr/sbin
pascal@236 64 cp _kernel/fs/squashfs/squashfs.ko \
pascal@236 65 _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko
pascal@236 66 gzip -9 _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko
pascal@236 67
pascal@236 68 # Build user land tools
pascal@236 69 cd ${PACKAGE}${VERSION}/squashfs-tools
pascal@236 70 make
pascal@236 71 cp mksquashfs unsquashfs ../../_pkg/usr/sbin
pascal@236 72 }
pascal@236 73
pascal@236 74 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@236 75 genpkg_rules()
pascal@236 76 {
pascal@236 77 cp -a _pkg/* $fs
pascal@236 78 strip -s $fs/usr/sbin/*
pascal@236 79 }
pascal@236 80
pascal@242 81 # Post install/remove commands for Tazpkg.
pascal@236 82 post_install()
pascal@236 83 {
pascal@236 84 depmod -a
pascal@236 85 }
pascal@242 86
pascal@242 87 post_remove()
pascal@242 88 {
pascal@242 89 depmod -a
pascal@242 90 }