wok view squashfs/receipt @ rev 244

Syslinux-extra: move data files into /usr/share/syslinux
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 19 09:49:09 2008 +0100 (2008-02-19)
parents 88157e3ce9ac
children f1a4f0123071
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 if [ ! -d ../linux/taz ]; then
22 tazwok cook linux
23 fi
24 kver=$(grep "kernel version" ../linux/linux-*/.config)
25 kver=${kver##* }
27 # Select patch according to kernel version
28 patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-${kver%.*}
29 if [ -f ${PACKAGE}${VERSION}/kernel-patches/linux-$kver ]; then
30 patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-$kver
31 fi
32 if [ ! -d $patch_dir ]; then
33 echo "No squashfs patchset for kernel $ker. Abort."
34 return 1
35 fi
36 [ -d _kernel ] && rm -rf _kernel
37 mkdir _kernel
38 cd _kernel
39 ln -s ../../linux/linux-$kver* src
41 # Copy files to be patched in local aera
42 # Do not alter kernel sources !!
43 for i in $(grep ^--- ../$patch_dir/${PACKAGE}${VERSION}-patch | \
44 awk '{ if ($3 != "1970-01-01") print $2 } '); do
45 ( cd src ; tar cf - ${i#*/}) | tar xf -
46 done
48 # Apply squashfs patches in local aera
49 patch -Np1 < ../$patch_dir/${PACKAGE}${VERSION}-patch
51 # Move every files in fs/squashfs directory
52 mv include/linux/* fs/squashfs
53 ln -s . fs/squashfs/linux
54 for i in fs/squashfs/*.c fs/squashfs/*.h ; do
55 sed -e 's/#include <\(linux\/squashfs.*\)>.*/#include "\1"/g' > $i.$$ < $i
56 sed -e 's/CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE/3/g' > $i < $i.$$
57 done
59 # Build kernel module
60 make -C src/. SUBDIRS=$(pwd)/fs/squashfs/ CONFIG_SQUASHFS=m modules
61 cd ..
62 [ -d _pkg ] && rm -rf _pkg
63 mkdir -p _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs _pkg/usr/sbin
64 cp _kernel/fs/squashfs/squashfs.ko \
65 _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko
66 gzip -9 _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/squashfs.ko
68 # Build user land tools
69 cd ${PACKAGE}${VERSION}/squashfs-tools
70 make
71 cp mksquashfs unsquashfs ../../_pkg/usr/sbin
72 }
74 # Rules to gen a SliTaz package suitable for Tazpkg.
75 genpkg_rules()
76 {
77 cp -a _pkg/* $fs
78 strip -s $fs/usr/sbin/*
79 }
81 # Post install/remove commands for Tazpkg.
82 post_install()
83 {
84 depmod -a
85 }
87 post_remove()
88 {
89 depmod -a
90 }