wok-current view busybox/receipt @ rev 13812
fox: typo
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jan 06 10:57:03 2013 +0100 (2013-01-06) |
parents | bd8f09202680 |
children | 579492e43b93 |
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.20.2"
5 CATEGORY="base-system"
6 SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
9 WEB_SITE="http://www.busybox.net/"
10 WGET_URL="http://www.busybox.net/downloads/$TARBALL"
11 HOST_ARCH="i486 arm"
13 DEPENDS="slitaz-base-files glibc-base ncurses-common"
14 BUILD_DEPENDS="bzip2 pam pam-dev uclibc-cross-compiler-i486"
16 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf \
17 /etc/resolv.conf /etc/httpd.conf"
18 AUFS_NOT_SUPPORTED="uclibc-cross-compiler-i486 is not compatible with aufs 8("
20 # Handle cross compilation
21 case "$ARCH" in
22 arm) BUILD_DEPENDS="bzip2" ;;
23 esac
25 # Busybox patches
26 apply_bb_patchs()
27 {
28 cd $src
29 while read file; do
30 [ -f done.$file ] && continue
31 echo "Apply $file..."
32 patch -p1 < $stuff/$PACKAGE-${VERSION%.*}-$file || return 1
33 touch done.$file
34 done <<EOT
35 tar.u
36 stat.u
37 ris.u
38 zmodules.u
39 printable.u
40 cmdline.u
41 su-nochdir.u
42 diff.u
43 blkid-swap.u
44 nfs-segfault.u
45 EOT
46 cp $stuff/$PACKAGE-${VERSION%.*}.config .config
47 }
49 # Rules to configure and make the package.
50 compile_rules()
51 {
52 case "$ARCH" in
53 arm)
54 echo "cook: CROSS_COMPILE=$CROSS_COMPILE"
55 apply_bb_patchs &&
56 cp $stuff/arm/$PACKAGE.config .config
57 make oldconfig &&
58 make && make install || return 1
59 chmod 4755 $src/_install/bin/busybox ;;
60 x86_64) echo "TODO" ;;
61 i?86)
62 apply_bb_patchs &&
63 make oldconfig &&
64 make && make install || return 1
65 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \
66 $src/_install/bin/busybox
68 # prepare busybox-pam package
69 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
70 make oldconfig && make || return 1
71 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox
72 mv busybox busybox-pam
74 # prepare busybox-static package
75 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
76 make oldconfig && make || return 1
77 mv busybox busybox-static
79 # prepare ssfs-busybox package
80 rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs
81 mkdir -p $rootfs/etc
82 cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config
83 make oldconfig && make busybox &&
84 make CONFIG_PREFIX=$rootfs install || return 1
85 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf
86 chown -R 0.0 $rootfs/etc
87 chmod 0600 $rootfs/etc/busybox.conf
88 chmod 4755 $rootfs/bin/busybox ;;
89 esac
90 }
92 # Cross compilation check.
93 testsuite()
94 {
95 readelf -h $src/_install/bin/busybox
96 }
98 # Rules to gen a SliTaz package suitable for Tazpkg.
99 genpkg_rules()
100 {
101 cp -a $src/_install/* $fs
102 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
103 mkdir -p $fs/etc/init.d $fs/var
105 # Busybox config files.
106 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf \
107 syslog.conf zcip.script
108 do
109 cp $stuff/$f $fs/etc
110 done
111 chown -R 0.0 $fs/etc
112 chmod 600 $fs/etc/busybox.conf
113 touch $fs/etc/resolv.conf
115 # Daemon scripts.
116 cp $stuff/daemon $fs/etc/init.d
117 DAEMON="crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd udhcpd zcip"
118 for i in $DAEMON; do
119 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config &&
120 ln -s daemon $fs/etc/init.d/$i
121 done
122 rm $fs/linuxrc
123 mkdir -p $fs/etc/modprobe.d
125 # Udhcpc stuff.
126 mkdir -p $fs/usr/share/udhcpc
127 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
128 chmod +x $fs/usr/share/udhcpc/default.script
130 # Httpd stuff.
131 ln -s /usr/lib/slitaz/httphelper.sh $fs/usr/bin/httpd_helper.sh
132 cp -a $stuff/www $fs/var
133 }
135 # GNU utils stuff.
136 pre_install()
137 {
138 local i
139 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
140 answer=""
141 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
142 [ -f $1$i ] || continue
143 case "$i" in
144 /bin/busybox) continue ;;
145 *bin/*) ;;
146 *) continue ;;
147 esac
148 if [ -z "$answer" ]; then
149 echo -n "Keep installed GNU utilities ? "
150 read -t 30 answer # by default: keep
151 case "$answer" in
152 n*|N*) break;;
153 *) answer="Y";;
154 esac
155 fi
156 cp -a $1$i $1$i-busybox-install
157 done
158 }
160 post_install()
161 {
162 local i
163 [ -f /etc/resolv.conf-busybox-install ] &&
164 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
165 while read i ; do
166 [ -f $1$i-busybox-install ] || continue
167 mv $1$i-busybox-install $1$i
168 done < $1$INSTALLED/$PACKAGE/files.list
169 chmod 4755 $1/bin/busybox
171 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
172 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
173 echo '# Domain name server options.' >> $root/etc/daemons.conf
174 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
175 echo '' >> $root/etc/daemons.conf
176 fi
177 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
178 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
179 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
180 echo '' >> $root/etc/daemons.conf
181 fi
182 if ! grep -q ^HTTPD_OPTIONS $root/etc/daemons.conf; then
183 echo '# Busybox HTTP web server options.' >> $root/etc/daemons.conf
184 echo 'HTTPD_OPTIONS="-u www"' >> $root/etc/daemons.conf
185 echo '' >> $root/etc/daemons.conf
186 fi
187 }
189 pre_remove()
190 {
191 # We can not remove this package !
192 exit 1
193 }