wok-next view linux/receipt @ rev 4157

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