wok annotate squashfs/receipt @ rev 240
Shfs & squashfs : no WANTED with WGET_URL
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Feb 18 00:24:44 2008 +0100 (2008-02-18) |
parents | 6f0f8c0fbedc |
children | d1ecaea3e7cf |
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@236 | 21 kver=$(grep "kernel version" ../linux/linux-*/.config) |
pascal@236 | 22 kver=${kver##* } |
pascal@236 | 23 |
pascal@236 | 24 # Select patch according to kernel version |
pascal@236 | 25 patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-${kver%.*} |
pascal@236 | 26 if [ -f ${PACKAGE}${VERSION}/kernel-patches/linux-$kver ]; then |
pascal@240 | 27 patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-$kver |
pascal@236 | 28 fi |
pascal@240 | 29 if [ ! -d $patch_dir ]; then |
pascal@240 | 30 echo "No squashfs patchset for kernel $ker. Abort." |
pascal@240 | 31 return 1 |
pascal@240 | 32 fi |
pascal@236 | 33 [ -d _kernel ] && rm -rf _kernel |
pascal@236 | 34 mkdir _kernel |
pascal@236 | 35 cd _kernel |
pascal@236 | 36 ln -s ../../linux/linux-$kver* src |
pascal@236 | 37 |
pascal@236 | 38 # Copy files to be patched in local aera |
pascal@236 | 39 # Do not alter kernel sources !! |
pascal@236 | 40 for i in $(grep ^--- ../$patch_dir/${PACKAGE}${VERSION}-patch | \ |
pascal@236 | 41 awk '{ if ($3 != "1970-01-01") print $2 } '); do |
pascal@236 | 42 ( cd src ; tar cf - ${i#*/}) | tar xf - |
pascal@236 | 43 done |
pascal@236 | 44 |
pascal@236 | 45 # Apply squashfs patches in local aera |
pascal@236 | 46 patch -Np1 < ../$patch_dir/${PACKAGE}${VERSION}-patch |
pascal@236 | 47 |
pascal@236 | 48 # Move every files in fs/squashfs directory |
pascal@240 | 49 mv include/linux/* fs/squashfs |
pascal@240 | 50 ln -s . fs/squashfs/linux |
pascal@240 | 51 for i in fs/squashfs/*.c fs/squashfs/*.h ; do |
pascal@240 | 52 sed -e 's/#include <\(linux\/squashfs.*\)>.*/#include "\1"/g' > $i.$$ < $i |
pascal@240 | 53 sed -e 's/CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE/3/g' > $i < $i.$$ |
pascal@240 | 54 done |
pascal@236 | 55 |
pascal@236 | 56 # Build kernel module |
pascal@240 | 57 make -C src/. SUBDIRS=$(pwd)/fs/squashfs/ CONFIG_SQUASHFS=m modules |
pascal@236 | 58 cd .. |
pascal@236 | 59 [ -d _pkg ] && rm -rf _pkg |
pascal@236 | 60 mkdir -p _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs _pkg/usr/sbin |
pascal@236 | 61 cp _kernel/fs/squashfs/squashfs.ko \ |
pascal@236 | 62 _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko |
pascal@236 | 63 gzip -9 _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko |
pascal@236 | 64 |
pascal@236 | 65 # Build user land tools |
pascal@236 | 66 cd ${PACKAGE}${VERSION}/squashfs-tools |
pascal@236 | 67 make |
pascal@236 | 68 cp mksquashfs unsquashfs ../../_pkg/usr/sbin |
pascal@236 | 69 } |
pascal@236 | 70 |
pascal@236 | 71 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@236 | 72 genpkg_rules() |
pascal@236 | 73 { |
pascal@236 | 74 cp -a _pkg/* $fs |
pascal@236 | 75 strip -s $fs/usr/sbin/* |
pascal@236 | 76 } |
pascal@236 | 77 |
pascal@236 | 78 # Pre and post install commands for Tazpkg. |
pascal@236 | 79 post_install() |
pascal@236 | 80 { |
pascal@236 | 81 depmod -a |
pascal@236 | 82 } |