wok view busybox/receipt @ rev 13714

Up sqlite (3.7.15.0)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Dec 19 15:07:35 2012 +0100 (2012-12-19)
parents 82bb00aaaec5
children 77850ece4ff6
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 EOT
45 cp $stuff/$PACKAGE-${VERSION%.*}.config .config
46 }
48 # Rules to configure and make the package.
49 compile_rules()
50 {
51 case "$ARCH" in
52 arm)
53 echo "cook: CROSS_COMPILE=$CROSS_COMPILE"
54 apply_bb_patchs &&
55 cp $stuff/arm/$PACKAGE.config .config
56 make oldconfig &&
57 make && make install || return 1
58 chmod 4755 $src/_install/bin/busybox ;;
59 x86_64) echo "TODO" ;;
60 i?86)
61 apply_bb_patchs &&
62 make oldconfig &&
63 make && make install || return 1
64 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \
65 $src/_install/bin/busybox
67 # prepare busybox-pam package
68 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
69 make oldconfig && make || return 1
70 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox
71 mv busybox busybox-pam
73 # prepare busybox-static package
74 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
75 make oldconfig && make || return 1
76 mv busybox busybox-static
78 # prepare ssfs-busybox package
79 rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs
80 mkdir -p $rootfs/etc
81 cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config
82 make oldconfig && make busybox &&
83 make CONFIG_PREFIX=$rootfs install || return 1
84 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf
85 chown -R 0.0 $rootfs/etc
86 chmod 0600 $rootfs/etc/busybox.conf
87 chmod 4755 $rootfs/bin/busybox ;;
88 esac
89 }
91 # Cross compilation check.
92 testsuite()
93 {
94 readelf -h $src/_install/bin/busybox
95 }
97 # Rules to gen a SliTaz package suitable for Tazpkg.
98 genpkg_rules()
99 {
100 cp -a $src/_install/* $fs
101 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
102 mkdir -p $fs/etc/init.d $fs/var
104 # Busybox config files.
105 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf \
106 syslog.conf zcip.script
107 do
108 cp $stuff/$f $fs/etc
109 done
110 chown -R 0.0 $fs/etc
111 chmod 600 $fs/etc/busybox.conf
112 touch $fs/etc/resolv.conf
114 # Daemon scripts.
115 cp $stuff/daemon $fs/etc/init.d
116 DAEMON="crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd udhcpd zcip"
117 for i in $DAEMON; do
118 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config &&
119 ln -s daemon $fs/etc/init.d/$i
120 done
121 rm $fs/linuxrc
122 mkdir -p $fs/etc/modprobe.d
124 # Udhcpc stuff.
125 mkdir -p $fs/usr/share/udhcpc
126 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
127 chmod +x $fs/usr/share/udhcpc/default.script
129 # Httpd stuff.
130 ln -s /usr/lib/slitaz/httphelper.sh $fs/usr/bin/httpd_helper.sh
131 cp -a $stuff/www $fs/var
132 }
134 # GNU utils stuff.
135 pre_install()
136 {
137 local i
138 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
139 answer=""
140 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
141 [ -f $1$i ] || continue
142 case "$i" in
143 /bin/busybox) continue ;;
144 *bin/*) ;;
145 *) continue ;;
146 esac
147 if [ -z "$answer" ]; then
148 echo -n "Keep installed GNU utilities ? "
149 read -t 30 answer # by default: keep
150 case "$answer" in
151 n*|N*) break;;
152 *) answer="Y";;
153 esac
154 fi
155 cp -a $1$i $1$i-busybox-install
156 done
157 }
159 post_install()
160 {
161 local i
162 [ -f /etc/resolv.conf-busybox-install ] &&
163 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
164 while read i ; do
165 [ -f $1$i-busybox-install ] || continue
166 mv $1$i-busybox-install $1$i
167 done < $1$INSTALLED/$PACKAGE/files.list
168 chmod 4755 $1/bin/busybox
170 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
171 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
172 echo '# Domain name server options.' >> $root/etc/daemons.conf
173 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
174 echo '' >> $root/etc/daemons.conf
175 fi
176 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
177 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
178 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
179 echo '' >> $root/etc/daemons.conf
180 fi
181 if ! grep -q ^HTTPD_OPTIONS $root/etc/daemons.conf; then
182 echo '# Busybox HTTP web server options.' >> $root/etc/daemons.conf
183 echo 'HTTPD_OPTIONS="-u www"' >> $root/etc/daemons.conf
184 echo '' >> $root/etc/daemons.conf
185 fi
186 }
188 pre_remove()
189 {
190 # We can not remove this package !
191 exit 1
192 }