wok-current view linux/receipt @ rev 4495

Up: wireshark 1.2.4
author deadwait <allan316@gmail.com>
date Fri Nov 20 15:16:37 2009 +0000 (2009-11-20)
parents e8d2c0b1111b
children aa65a927a2f3
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.30.6"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux kernel and modules."
7 DEPENDS="depmod"
8 BUILD_DEPENDS="slitaz-toolchain perl git"
9 MAINTAINER="devel@slitaz.org"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.kernel.org/"
12 WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
13 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 # Aufs2 from git repository
19 if [ ! -d aufs2 ]; then
20 git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git aufs2
21 cd aufs2 && git checkout origin/aufs2-30
22 cp -a Documentation fs include $src
23 cp -a *.patch ../stuff
24 [ -L /usr/bin/patch ] && tazpkg get-install patch --forced
25 fi
26 cd $src
27 # SliTaz db
28 rm -rf slitaz 2> /dev/null
29 mkdir slitaz
30 echo "$WGET_URL" > slitaz/url
31 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
32 # Misc patches from pascal
33 while read patch_file; do
34 echo "$patch_file" >> slitaz/patches
35 #cp ../stuff/$patch_file slitaz/$patch_file
36 cp ../stuff/$patch_file slitaz
37 if [ -f done.$patch_file ]; then
38 echo "Skipping $patch_file"
39 continue
40 fi
41 echo "Apply $patch_file"
42 patch -p1 < slitaz/$patch_file || exit 1
43 touch done.$patch_file
44 done <<EOT
45 $PACKAGE-utf8-$VERSION.u
46 $PACKAGE-diff-$VERSION.u
47 $PACKAGE-freeinitrd-$VERSION.u
48 $PACKAGE-unlzma-$VERSION.u
49 aufs2-base.patch
50 aufs2-kbuild.patch
51 aufs2-standalone.patch
52 EOT
53 make mrproper
54 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
55 make oldconfig
56 ln .config slitaz/config
57 make bzImage &&
58 make modules &&
59 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
60 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
61 [ -s arch/x86/boot/bzImage ]
62 }
64 # Rules to gen a SliTaz package suitable for Tazpkg.
65 genpkg_rules()
66 {
67 local path
68 mkdir $fs/boot
69 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
70 # Compress all modules.
71 # Package module-init-tools is compiled with zlib support.
72 #
73 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
74 path=$fs/lib/modules/$VERSION-slitaz/kernel
75 mkdir -p $path
76 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
77 export src
78 export _pkg
79 $src/slitaz/list_modules.sh \
80 $(cat stuff/modules-$VERSION.list) > $src/modules.list
81 while read module; do
82 dir=$(dirname $module)
83 [ -d $path/$dir ] || mkdir -p $path/$dir
84 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
85 done < $src/modules.list
86 # Remove unresolved links
87 rm -f $fs/lib/modules/$VERSION-slitaz/build
88 rm -f $fs/lib/modules/$VERSION-slitaz/source
89 # Package all linux pkgs
90 for i in $(cd $WOK; ls -d linux-*)
91 do
92 tazwok genpkg $i
93 done
94 # Cook all packages with a kernel module
95 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
96 do
97 echo tazwok cook ${i%/receipt}
98 done
99 # check and echo any module in kernel .config that's not added to one of linux-* pkgs
100 ./stuff/check_modules.sh
101 }
103 # Pre and post install commands for Tazpkg.
104 # GRUB stuf.
105 post_install()
106 {
107 echo "Processing post-install commands..."
108 chroot "$1/" depmod -a $VERSION-slitaz
109 if [ -f "$1/boot/grub/menu.lst" ]; then
110 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
111 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
112 # Add new kernel entry in case of upgrade for installed system.
113 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
114 cat >> $1/boot/grub/menu.lst << EOT
116 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
117 $grub_dev
118 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
119 EOT
120 fi
121 # Display information message.
122 cat <<EOT
123 ----
124 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
126 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
127 $grub_dev
128 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
129 ----
130 EOT
131 fi
132 }
134 clean_wok()
135 {
136 rm -rf aufs2
137 }