wok-undigest view busybox/receipt @ rev 438

Qt4-qca-ossl: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Sep 06 18:23:51 2011 +0200 (2011-09-06)
parents 26980c47185c
children dc605c381b91
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.19.2"
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 /etc/httpd.conf"
15 apply_bb_patchs()
16 {
17 cd $src
18 while read file; do
19 [ -f done.$file ] && continue
20 echo "Apply $file..."
21 patch -p1 < $stuff/$PACKAGE-${VERSION%.*}-$file || return 1
22 touch done.$file
23 done <<EOT
24 tar.u
25 stat.u
26 ris.u
27 zmodules.u
28 printable.u
29 cmdline.u
30 tac.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 { stuff=${stuff:-../stuff}
40 apply_bb_patchs &&
41 make oldconfig &&
42 make &&
43 make CONFIG_PREFIX=/tools install
44 } || return 1
45 echo "Chmod 4755 on busybox binary..."
46 chmod 4755 /tools/bin/busybox
47 }
49 # Rules to configure and make the package.
50 compile_rules()
51 {
52 { apply_bb_patchs &&
53 make oldconfig &&
54 make &&
55 make install
56 } || return 1
57 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
58 make oldconfig && make || return 1
59 mv busybox busybox-pam
60 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
61 make oldconfig && make || return 1
62 mv busybox busybox-static
63 }
65 # Rules to gen a SliTaz package suitable for Tazpkg.
66 genpkg_rules()
67 {
68 cp -a $src/_install/* $fs
69 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
70 mkdir -p $fs/etc/init.d $fs/var
72 # Busybox config files.
73 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf zcip.script
74 do
75 cp $stuff/$f $fs/etc
76 done
77 chown -R 0.0 $fs/etc
78 chmod 600 $fs/etc/busybox.conf
79 touch $fs/etc/resolv.conf
81 # Daemon scripts and init.
82 cp $stuff/daemon $fs/etc/init.d
83 DAEMON="crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd udhcpd zcip"
84 for i in $DAEMON; do
85 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config &&
86 ln -s daemon $fs/etc/init.d/$i
87 done
88 cp $stuff/init $fs
89 rm $fs/linuxrc
90 mkdir -p $fs/etc/modprobe.d
92 # Udhcpc stuff.
93 mkdir -p $fs/usr/share/udhcpc
94 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
95 chmod +x $fs/usr/share/udhcpc/default.script
97 # Httpd stuff.
98 cp $stuff/httpd_helper.sh $fs/usr/bin
99 chmod +x $fs/usr/bin/httpd_helper.sh
100 cp -a $stuff/www $fs/var
101 }
103 # Force glibc-2.7 reinstall if 2.3.6 still in use.
104 pre_install()
105 {
106 local i
107 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
108 if grep -q 'VERSION="2.3.6"' /var/lib/tazpkg/installed/glibc-base/receipt; then
109 tazpkg get-install glibc-base --forced
110 fi
111 answer=""
112 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
113 [ -f $1$i ] || continue
114 case "$i" in
115 /bin/busybox) continue ;;
116 *bin/*) ;;
117 *) continue ;;
118 esac
119 if [ -z "$answer" ]; then
120 echo -n "Keep installed GNU utilities ? "
121 read -t 30 answer # by default: keep
122 case "$answer" in
123 n*|N*) break;;
124 *) answer="Y";;
125 esac
126 fi
127 cp -a $1$i $1$i-busybox-install
128 done
129 }
131 post_install()
132 {
133 local i
134 [ -f /etc/resolv.conf-busybox-install ] &&
135 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
136 while read i ; do
137 [ -f $1$i-busybox-install ] || continue
138 mv $1$i-busybox-install $1$i
139 done < $1$INSTALLED/$PACKAGE/files.list
140 chmod 4755 $1/bin/busybox
142 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
143 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
144 echo '# Domain name server options.' >> $root/etc/daemons.conf
145 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
146 echo '' >> $root/etc/daemons.conf
147 fi
148 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
149 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
150 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
151 echo '' >> $root/etc/daemons.conf
152 fi
153 if ! grep -q ^HTTPD_OPTIONS $root/etc/daemons.conf; then
154 echo '# Busybox HTTP web server options.' >> $root/etc/daemons.conf
155 echo 'HTTPD_OPTIONS="-u www"' >> $root/etc/daemons.conf
156 echo '' >> $root/etc/daemons.conf
157 fi
158 }
160 pre_remove()
161 {
162 # We can not remove this package !
163 exit 1
164 }