wok-current view busybox/receipt @ rev 12421

Up: openssl to 1.0.1a.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Apr 21 09:22:43 2012 +0000 (2012-04-21)
parents 30e1308b918c
children 2a66c0430085
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 AUFS_NOT_SUPPORTED="uclibc-cross-compiler-i486 is not compatible with aufs 8("
11 TARBALL="$PACKAGE-$VERSION.tar.bz2"
12 WEB_SITE="http://www.busybox.net/"
13 WGET_URL="http://www.busybox.net/downloads/$TARBALL"
14 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf /etc/httpd.conf"
16 apply_bb_patchs()
17 {
18 cd $src
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 httpd.u
33 su-nochdir.u
34 tftp-chroot.u
35 diff.u
36 EOT
37 cp $stuff/$PACKAGE-${VERSION%.*}.config .config
38 }
40 # Rules to compile & install the temporary toolchain.
41 cook_tmp_toolchain()
42 {
43 { stuff=${stuff:-../stuff}
44 apply_bb_patchs &&
45 make oldconfig &&
46 make &&
47 make CONFIG_PREFIX=/tools install
48 } || return 1
49 echo "Chmod 4755 on busybox binary..."
50 chmod 4755 /tools/bin/busybox
51 }
53 # Rules to configure and make the package.
54 compile_rules()
55 {
56 { apply_bb_patchs &&
57 make oldconfig &&
58 make &&
59 make install
60 } || return 1
62 # prepare busybox-pam package
63 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
64 make oldconfig && make || return 1
65 mv busybox busybox-pam
67 # prepare busybox-static package
68 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
69 make oldconfig && make || return 1
70 mv busybox busybox-static
72 # prepare ssfs-busybox package
73 rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs
74 mkdir -p $rootfs/etc
75 cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config
76 make oldconfig && make busybox &&
77 make CONFIG_PREFIX=$rootfs install || return 1
78 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf
79 chown -R 0.0 $rootfs/etc
80 chmod 0600 $rootfs/etc/busybox.conf
81 chmod 4755 $rootfs/bin/busybox
82 }
84 # Rules to gen a SliTaz package suitable for Tazpkg.
85 genpkg_rules()
86 {
87 cp -a $src/_install/* $fs
88 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
89 mkdir -p $fs/etc/init.d $fs/var
91 # Busybox config files.
92 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf zcip.script
93 do
94 cp $stuff/$f $fs/etc
95 done
96 chown -R 0.0 $fs/etc
97 chmod 600 $fs/etc/busybox.conf
98 touch $fs/etc/resolv.conf
100 # Daemon scripts and init.
101 cp $stuff/daemon $fs/etc/init.d
102 DAEMON="crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd udhcpd zcip"
103 for i in $DAEMON; do
104 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config &&
105 ln -s daemon $fs/etc/init.d/$i
106 done
107 rm $fs/linuxrc
108 mkdir -p $fs/etc/modprobe.d
110 # Udhcpc stuff.
111 mkdir -p $fs/usr/share/udhcpc
112 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
113 chmod +x $fs/usr/share/udhcpc/default.script
115 # Httpd stuff.
116 cp $stuff/httpd_helper.sh $fs/usr/bin
117 chmod +x $fs/usr/bin/httpd_helper.sh
118 cp -a $stuff/www $fs/var
119 }
121 # Force glibc-2.7 reinstall if 2.3.6 still in use.
122 pre_install()
123 {
124 local i
125 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
126 if grep -q 'VERSION="2.3.6"' /var/lib/tazpkg/installed/glibc-base/receipt; then
127 tazpkg get-install glibc-base --forced
128 fi
129 answer=""
130 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
131 [ -f $1$i ] || continue
132 case "$i" in
133 /bin/busybox) continue ;;
134 *bin/*) ;;
135 *) continue ;;
136 esac
137 if [ -z "$answer" ]; then
138 echo -n "Keep installed GNU utilities ? "
139 read -t 30 answer # by default: keep
140 case "$answer" in
141 n*|N*) break;;
142 *) answer="Y";;
143 esac
144 fi
145 cp -a $1$i $1$i-busybox-install
146 done
147 }
149 post_install()
150 {
151 local i
152 [ -f /etc/resolv.conf-busybox-install ] &&
153 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
154 while read i ; do
155 [ -f $1$i-busybox-install ] || continue
156 mv $1$i-busybox-install $1$i
157 done < $1$INSTALLED/$PACKAGE/files.list
158 chmod 4755 $1/bin/busybox
160 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
161 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
162 echo '# Domain name server options.' >> $root/etc/daemons.conf
163 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
164 echo '' >> $root/etc/daemons.conf
165 fi
166 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
167 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
168 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
169 echo '' >> $root/etc/daemons.conf
170 fi
171 if ! grep -q ^HTTPD_OPTIONS $root/etc/daemons.conf; then
172 echo '# Busybox HTTP web server options.' >> $root/etc/daemons.conf
173 echo 'HTTPD_OPTIONS="-u www"' >> $root/etc/daemons.conf
174 echo '' >> $root/etc/daemons.conf
175 fi
176 }
178 pre_remove()
179 {
180 # We can not remove this package !
181 exit 1
182 }