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