wok-6.x view linux/receipt @ rev 1525

Up goffice-dev (0.6.5)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Oct 08 17:13:46 2008 +0000 (2008-10-08)
parents d442045183a5
children 0f29c565427b
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.25.5"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux kernel and modules."
7 BUILD_DEPENDS="slitaz-toolchain perl"
8 MAINTAINER="pascal.bellard@slitaz.org"
9 TARBALL="$PACKAGE-$VERSION.tar.bz2"
10 WEB_SITE="http://www.kernel.org/"
11 WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v2.6/$TARBALL"
13 # Rules to configure and make the package.
14 compile_rules()
15 {
16 cd $src
17 mkdir slitaz
18 echo "$WGET_URL" > slitaz/url
19 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
20 # lzma and misc patches from pascal
21 while read patch_file; do
22 if [ -f done.$patch_file ]; then
23 echo "Skipping $patch_file"
24 continue
25 fi
26 echo "Apply $patch_file"
27 patch -p1 < ../stuff/$patch_file || return 1
28 echo "$patch_file" >> slitaz/patches
29 cp ../stuff/$patch_file slitaz/$patch_file
30 touch done.$patch_file
31 done <<EOT
32 $PACKAGE-lzma-$VERSION.u
33 $PACKAGE-utf8-$VERSION.u
34 $PACKAGE-diff-$VERSION.u
35 $PACKAGE-rootdev.u
36 EOT
37 make mrproper
38 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
39 make oldconfig
40 ln .config slitaz/config
41 make bzImage
42 make modules
43 make INSTALL_MOD_PATH=$PWD/_pkg modules_install
44 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install
45 }
47 # Rules to gen a SliTaz package suitable for Tazpkg.
48 genpkg_rules()
49 {
50 local path
51 mkdir $fs/boot
52 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
53 # Compress all modules.
54 # Package module-init-tools is compiled with zlib support.
55 #
56 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
57 path=$fs/lib/modules/$VERSION-slitaz/kernel
58 mkdir -p $path
59 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
60 cp ./stuff/list_modules.sh $src
61 export src
62 export _pkg
63 $src/list_modules.sh $(cat stuff/modules-$VERSION.list) > $src/modules.list
64 while read module; do
65 dir=$(dirname $module)
66 [ -d $path/$dir ] || mkdir -p $path/$dir
67 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
68 done < $src/modules.list
69 # Remove unresolved links
70 rm -f $fs/lib/modules/$VERSION-slitaz/build
71 rm -f $fs/lib/modules/$VERSION-slitaz/source
72 # Package all linux pkgs
73 for i in $(cd $WOK; ls -d linux-*)
74 do
75 tazwok genpkg $i
76 done
77 # Cook all packages with a kernel module
78 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
79 do
80 echo tazwok cook ${i%/receipt}
81 done
82 }
84 # Pre and post install commands for Tazpkg.
85 # GRUB stuf.
86 post_install()
87 {
88 echo "Processing post-install commands..."
89 depmod -a -b "$1/" $VERSION-slitaz
90 if [ -f "$1/boot/grub/menu.lst" ]; then
91 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/'`
92 grub_dev=`cat $1/boot/grub/menu.lst | grep "root ("`
93 # Add new kernel entry in case of upgrade for installed system.
94 cat >> $1/boot/grub/menu.lst << EOT
96 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
97 $grub_dev
98 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
99 EOT
100 # Display information message.
101 cat <<EOT
102 ----
103 GRUB is installed, these tree lines has been added to the menu.lst:
105 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
106 $grub_dev
107 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
108 ----
109 EOT
110 fi
111 }