wok-6.x view busybox/receipt @ rev 12590
gnome-menus: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Apr 28 22:08:07 2012 +0200 (2012-04-28) |
parents | 2a66c0430085 |
children | b18de8ea7bd6 |
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.20.0"
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 su-nochdir.u
32 diff.u
33 EOT
34 cp $stuff/$PACKAGE-${VERSION%.*}.config .config
35 }
37 # Rules to compile & install the temporary toolchain.
38 cook_tmp_toolchain()
39 {
40 { stuff=${stuff:-../stuff}
41 apply_bb_patchs &&
42 make oldconfig &&
43 make &&
44 make CONFIG_PREFIX=/tools install
45 } || return 1
46 echo "Chmod 4755 on busybox binary..."
47 chmod 4755 /tools/bin/busybox
48 }
50 # Rules to configure and make the package.
51 compile_rules()
52 {
53 { apply_bb_patchs &&
54 make oldconfig &&
55 make &&
56 make install
57 } || return 1
59 # prepare busybox-pam package
60 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
61 make oldconfig && make || return 1
62 mv busybox busybox-pam
64 # prepare busybox-static package
65 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
66 make oldconfig && make || return 1
67 mv busybox busybox-static
69 # prepare ssfs-busybox package
70 rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs
71 mkdir -p $rootfs/etc
72 cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config
73 make oldconfig && make busybox &&
74 make CONFIG_PREFIX=$rootfs install || return 1
75 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf
76 chown -R 0.0 $rootfs/etc
77 chmod 0600 $rootfs/etc/busybox.conf
78 chmod 4755 $rootfs/bin/busybox
79 }
81 # Rules to gen a SliTaz package suitable for Tazpkg.
82 genpkg_rules()
83 {
84 cp -a $src/_install/* $fs
85 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
86 mkdir -p $fs/etc/init.d $fs/var
88 # Busybox config files.
89 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf zcip.script
90 do
91 cp $stuff/$f $fs/etc
92 done
93 chown -R 0.0 $fs/etc
94 chmod 600 $fs/etc/busybox.conf
95 touch $fs/etc/resolv.conf
97 # Daemon scripts.
98 cp $stuff/daemon $fs/etc/init.d
99 DAEMON="crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd udhcpd zcip"
100 for i in $DAEMON; do
101 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config &&
102 ln -s daemon $fs/etc/init.d/$i
103 done
104 rm $fs/linuxrc
105 mkdir -p $fs/etc/modprobe.d
107 # Udhcpc stuff.
108 mkdir -p $fs/usr/share/udhcpc
109 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
110 chmod +x $fs/usr/share/udhcpc/default.script
112 # Httpd stuff.
113 cp -a $stuff/www $fs/var
114 }
116 # Force glibc-2.7 reinstall if 2.3.6 still in use.
117 pre_install()
118 {
119 local i
120 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
121 if grep -q 'VERSION="2.3.6"' /var/lib/tazpkg/installed/glibc-base/receipt; then
122 tazpkg get-install glibc-base --forced
123 fi
124 answer=""
125 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
126 [ -f $1$i ] || continue
127 case "$i" in
128 /bin/busybox) continue ;;
129 *bin/*) ;;
130 *) continue ;;
131 esac
132 if [ -z "$answer" ]; then
133 echo -n "Keep installed GNU utilities ? "
134 read -t 30 answer # by default: keep
135 case "$answer" in
136 n*|N*) break;;
137 *) answer="Y";;
138 esac
139 fi
140 cp -a $1$i $1$i-busybox-install
141 done
142 }
144 post_install()
145 {
146 local i
147 [ -f /etc/resolv.conf-busybox-install ] &&
148 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
149 while read i ; do
150 [ -f $1$i-busybox-install ] || continue
151 mv $1$i-busybox-install $1$i
152 done < $1$INSTALLED/$PACKAGE/files.list
153 chmod 4755 $1/bin/busybox
155 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
156 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
157 echo '# Domain name server options.' >> $root/etc/daemons.conf
158 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
159 echo '' >> $root/etc/daemons.conf
160 fi
161 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
162 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
163 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
164 echo '' >> $root/etc/daemons.conf
165 fi
166 if ! grep -q ^HTTPD_OPTIONS $root/etc/daemons.conf; then
167 echo '# Busybox HTTP web server options.' >> $root/etc/daemons.conf
168 echo 'HTTPD_OPTIONS="-u www"' >> $root/etc/daemons.conf
169 echo '' >> $root/etc/daemons.conf
170 fi
171 }
173 pre_remove()
174 {
175 # We can not remove this package !
176 exit 1
177 }