wok annotate squashfs/receipt @ rev 1531

Add zsh (from Sandeep Srinivasa)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Oct 09 15:00:42 2008 +0000 (2008-10-09)
parents c343c644ab92
children 610028bf46e9
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@909 6 SHORT_DESC="Linux squashfs 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@909 11 DEPENDS="zlib squashfs-module"
pascal@315 12 BUILD_DEPENDS="zlib-dev patch"
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@909 20 ln -s . $src
pascal@236 21 # get kernel version
pascal@1452 22 if [ ! -d $WOK/linux/taz ]; then
pascal@242 23 tazwok cook linux
pascal@242 24 fi
pascal@1452 25 kver=$(grep "kernel version" $WOK/linux/linux-*/.config)
pascal@236 26 kver=${kver##* }
pascal@236 27
pascal@236 28 # Select patch according to kernel version
pascal@236 29 patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-${kver%.*}
pascal@909 30 i=${patch_dir##*.}
pascal@909 31 while [ ! -d ${patch_dir%.*}.$i ]; do
pascal@909 32 [ "$i" = "0" ] && break
pascal@909 33 i=$(($i - 1))
pascal@909 34 done
pascal@909 35 patch_dir=${patch_dir%.*}.$i
pascal@909 36 if [ -d ${PACKAGE}${VERSION}/kernel-patches/linux-$kver ]; then
pascal@240 37 patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-$kver
pascal@236 38 fi
pascal@240 39 if [ ! -d $patch_dir ]; then
pascal@240 40 echo "No squashfs patchset for kernel $ker. Abort."
pascal@240 41 return 1
pascal@240 42 fi
pascal@236 43 [ -d _kernel ] && rm -rf _kernel
pascal@236 44 mkdir _kernel
pascal@236 45 cd _kernel
pascal@909 46 ln -fs ../../linux/linux-$kver* src
pascal@236 47
pascal@236 48 # Copy files to be patched in local aera
pascal@236 49 # Do not alter kernel sources !!
pascal@236 50 for i in $(grep ^--- ../$patch_dir/${PACKAGE}${VERSION}-patch | \
pascal@236 51 awk '{ if ($3 != "1970-01-01") print $2 } '); do
pascal@236 52 ( cd src ; tar cf - ${i#*/}) | tar xf -
pascal@236 53 done
pascal@236 54
pascal@236 55 # Apply squashfs patches in local aera
pascal@909 56 #patch -p1 < ../$patch_dir/${PACKAGE}${VERSION}-patch
pascal@909 57 echo "Apply $patch_dir..."
pascal@909 58 awk 'BEGIN { keep=1} /^---/ { keep=(index($0,"/fs/squashfs/") || index($0,"/include/linux/"))} { if (keep) print }' < \
pascal@909 59 ../$patch_dir/${PACKAGE}${VERSION}-patch | patch -p1
pascal@909 60
pascal@909 61 extra_patch=stuff/squashfs-patch-${kver%.*}
pascal@909 62 if [ -e ../$extra_patch ]; then
pascal@909 63 echo "Apply $extra_patch..."
pascal@909 64 patch -p1 < ../$extra_patch || return 1
pascal@909 65 fi
pascal@236 66
pascal@236 67 # Move every files in fs/squashfs directory
pascal@240 68 mv include/linux/* fs/squashfs
pascal@240 69 ln -s . fs/squashfs/linux
pascal@240 70 for i in fs/squashfs/*.c fs/squashfs/*.h ; do
pascal@240 71 sed -e 's/#include <\(linux\/squashfs.*\)>.*/#include "\1"/g' > $i.$$ < $i
pascal@240 72 sed -e 's/CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE/3/g' > $i < $i.$$
pascal@240 73 done
pascal@236 74
pascal@909 75 # Apply lzma patches
pascal@909 76 # echo "Apply stuff/lzma.u.."
pascal@1452 77 # patch -p0 < ../stuff/lzma.u || return 1
pascal@909 78
pascal@236 79 # Build kernel module
pascal@1452 80 make -C src/. SUBDIRS=$(pwd)/fs/squashfs/ CONFIG_SQUASHFS=m modules || return 1
pascal@236 81 cd ..
pascal@236 82 [ -d _pkg ] && rm -rf _pkg
pascal@247 83 mkdir -p _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs
pascal@247 84 mkdir -p _pkg/usr/sbin _pkg/sbin
pascal@236 85 cp _kernel/fs/squashfs/squashfs.ko \
pascal@236 86 _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko
pascal@236 87 gzip -9 _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko
pascal@236 88
pascal@236 89 # Build user land tools
pascal@236 90 cd ${PACKAGE}${VERSION}/squashfs-tools
pascal@1452 91 make || return 1
pascal@247 92 cp mksquashfs ../../_pkg/usr/sbin
pascal@247 93 cp unsquashfs ../../_pkg/sbin
pascal@236 94 }
pascal@236 95
pascal@236 96 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@236 97 genpkg_rules()
pascal@236 98 {
pascal@909 99 cp -a _pkg/usr _pkg/sbin $fs
pascal@236 100 }