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