wok-stable view busybox/receipt @ rev 9657

busybox: ensure $stuff is set. tazwok bug ?
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Apr 30 16:37:24 2011 +0200 (2011-04-30)
parents 57877ce4dbf3
children 5fbf13b1df6d
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.18.4"
5 CATEGORY="base-system"
6 SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 DEPENDS="slitaz-base-files glibc-base ncurses-common"
9 BUILD_DEPENDS="bzip2 pam pam-dev uclibc-cross-compiler-i486"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.busybox.net/"
12 WGET_URL="http://www.busybox.net/downloads/$TARBALL"
13 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf"
15 apply_bb_patchs()
16 {
17 cd $src
18 stuff=${stuff:-stuff}
19 while read file; do
20 [ -f done.$file ] && continue
21 echo "Apply $file..."
22 patch -p1 < $stuff/$PACKAGE-${VERSION%.*}-$file || return 1
23 touch done.$file
24 done <<EOT
25 tar.u
26 stat.u
27 ris.u
28 zmodules.u
29 printable.u
30 cmdline.u
31 conspy.u
32 EOT
33 cp $stuff/$PACKAGE-${VERSION%.*}.config .config
34 }
36 # Rules to compile & install the temporary toolchain.
37 cook_tmp_toolchain()
38 {
39 { apply_bb_patchs &&
40 make oldconfig &&
41 make &&
42 make CONFIG_PREFIX=/tools install
43 } || return 1
44 echo "Chmod 4755 on busybox binary..."
45 chmod 4755 /tools/bin/busybox
46 }
48 # Rules to configure and make the package.
49 compile_rules()
50 {
51 { apply_bb_patchs &&
52 make oldconfig &&
53 make &&
54 make install
55 } || return 1
56 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
57 make oldconfig && make || return 1
58 mv busybox busybox-pam
59 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
60 make oldconfig && make || return 1
61 mv busybox busybox-static
62 }
64 # Rules to gen a SliTaz package suitable for Tazpkg.
65 genpkg_rules()
66 {
67 cp -a $src/_install/* $fs
68 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
69 mkdir -p $fs/etc/init.d
70 # Busybox config files.
71 cp $stuff/busybox.conf $fs/etc
72 chmod 600 $fs/etc/busybox.conf
73 cp $stuff/dnsd.conf $fs/etc
74 cp $stuff/udhcpd.conf $fs/etc
75 touch $fs/etc/resolv.conf
76 cp $stuff/inetd.conf $fs/etc
77 cp $stuff/daemon $fs/etc/init.d
78 DAEMON="crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd udhcpd zcip"
79 for i in $DAEMON; do
80 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config &&
81 ln -s daemon $fs/etc/init.d/$i
82 done
83 cp $stuff/init $fs
84 rm $fs/linuxrc
85 mkdir -p $fs/etc/modprobe.d
86 # Udhcpc stuff.
87 mkdir -p $fs/usr/share/udhcpc
88 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
89 chmod +x $fs/usr/share/udhcpc/default.script
90 # ZeroConf stuff.
91 cp $stuff/zcip.script $fs/etc
92 # Httpd stuff.
93 cp $stuff/httpd_helper.sh $fs/usr/bin
94 chmod +x $fs/usr/bin/httpd_helper.sh
95 }
97 # Force glibc-2.7 reinstall if 2.3.6 still in use.
98 pre_install()
99 {
100 local i
101 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
102 if grep -q 'VERSION="2.3.6"' /var/lib/tazpkg/installed/glibc-base/receipt; then
103 tazpkg get-install glibc-base --forced
104 fi
105 answer=""
106 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
107 [ -f $1$i ] || continue
108 case "$i" in
109 /bin/busybox) continue ;;
110 *bin/*) ;;
111 *) continue ;;
112 esac
113 if [ -z "$answer" ]; then
114 echo -n "Keep installed GNU utilities ? "
115 read -t 30 answer # by default: keep
116 case "$answer" in
117 n*|N*) break;;
118 *) answer="Y";;
119 esac
120 fi
121 cp -a $1$i $1$i-busybox-install
122 done
123 }
125 post_install()
126 {
127 local i
128 [ -f /etc/resolv.conf-busybox-install ] &&
129 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
130 while read i ; do
131 [ -f $1$i-busybox-install ] || continue
132 mv $1$i-busybox-install $1$i
133 done < $1$INSTALLED/$PACKAGE/files.list
134 chmod 4755 $1/bin/busybox
135 }
137 pre_remove()
138 {
139 # We can not remove this package !
140 exit 1
141 }