wok view linux/receipt @ rev 4358
Add: libtasn1 (ASN.1 library)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon Oct 05 00:52:38 2009 +0200 (2009-10-05) |
parents | 7589496c772c |
children | e8d2c0b1111b |
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 fi
24 cd $src
25 # SliTaz db
26 rm -rf slitaz 2> /dev/null
27 mkdir slitaz
28 echo "$WGET_URL" > slitaz/url
29 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
30 # Misc patches from pascal
31 while read patch_file; do
32 echo "$patch_file" >> slitaz/patches
33 cp ../stuff/$patch_file slitaz/$patch_file
34 if [ -f done.$patch_file ]; then
35 echo "Skipping $patch_file"
36 continue
37 fi
38 echo "Apply $patch_file"
39 patch -p1 < $patch_file || exit 1
40 touch done.$patch_file
41 done <<EOT
42 ../stuff/$PACKAGE-utf8-$VERSION.u
43 ../stuff/$PACKAGE-diff-$VERSION.u
44 ../stuff/$PACKAGE-freeinitrd-$VERSION.u
45 ../stuff/$PACKAGE-unlzma-$VERSION.u
46 ../aufs2/aufs2-base.patch
47 ../aufs2/aufs2-kbuild.patch
48 ../aufs2/aufs2-standalone.patch
49 EOT
50 make mrproper
51 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
52 make oldconfig
53 ln .config slitaz/config
54 make bzImage &&
55 make modules &&
56 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
57 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
58 [ -s arch/x86/boot/bzImage ]
59 }
61 # Rules to gen a SliTaz package suitable for Tazpkg.
62 genpkg_rules()
63 {
64 local path
65 mkdir $fs/boot
66 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
67 # Compress all modules.
68 # Package module-init-tools is compiled with zlib support.
69 #
70 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
71 path=$fs/lib/modules/$VERSION-slitaz/kernel
72 mkdir -p $path
73 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
74 export src
75 export _pkg
76 $src/slitaz/list_modules.sh \
77 $(cat stuff/modules-$VERSION.list) > $src/modules.list
78 while read module; do
79 dir=$(dirname $module)
80 [ -d $path/$dir ] || mkdir -p $path/$dir
81 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
82 done < $src/modules.list
83 # Remove unresolved links
84 rm -f $fs/lib/modules/$VERSION-slitaz/build
85 rm -f $fs/lib/modules/$VERSION-slitaz/source
86 # Package all linux pkgs
87 for i in $(cd $WOK; ls -d linux-*)
88 do
89 tazwok genpkg $i
90 done
91 # Cook all packages with a kernel module
92 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
93 do
94 echo tazwok cook ${i%/receipt}
95 done
96 }
98 # Pre and post install commands for Tazpkg.
99 # GRUB stuf.
100 post_install()
101 {
102 echo "Processing post-install commands..."
103 chroot "$1/" depmod -a $VERSION-slitaz
104 if [ -f "$1/boot/grub/menu.lst" ]; then
105 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
106 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
107 # Add new kernel entry in case of upgrade for installed system.
108 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
109 cat >> $1/boot/grub/menu.lst << EOT
111 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
112 $grub_dev
113 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
114 EOT
115 fi
116 # Display information message.
117 cat <<EOT
118 ----
119 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
121 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
122 $grub_dev
123 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
124 ----
125 EOT
126 fi
127 }
129 clean_wok()
130 {
131 rm -rf aufs2
132 }