wok view busybox/receipt @ rev 15855

New kernel config and huge receipt clean up
author Christophe Lincoln <pankso@slitaz.org>
date Wed Jan 29 09:56:07 2014 +0100 (2014-01-29)
parents bf783a1bf96f
children 906854cfa70d
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.22.1"
5 CATEGORY="base-system"
6 SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.bz2"
10 WEB_SITE="http://www.busybox.net/"
11 WGET_URL="http://www.busybox.net/downloads/$TARBALL"
12 HOST_ARCH="i486 arm"
14 DEPENDS="slitaz-base-files glibc-base ncurses-common"
15 BUILD_DEPENDS="bzip2 pam pam-dev uclibc-cross-compiler-i486 \
16 musl-libc-dev dietlibc"
18 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf \
19 /etc/resolv.conf /etc/httpd.conf"
20 AUFS_NOT_RAMFS="uclibc-cross-compiler-i486 is not compatible with aufs+tmpfs 8("
22 # Handle cross compilation
23 case "$ARCH" in
24 arm) BUILD_DEPENDS="bzip2" ;;
25 esac
27 # Busybox patches
28 apply_bb_patchs()
29 {
30 cd $src
31 while read file; do
32 [ -f done.$file ] && continue
33 echo "Apply $file..."
34 patch -p1 < $stuff/$PACKAGE-${VERSION%.*}-$file || return 1
35 touch done.$file
36 done <<EOT
37 tar.u
38 stat.u
39 ris.u
40 zmodules.u
41 printable.u
42 cmdline.u
43 diff.u
44 diet.u
45 losetup.u
46 EOT
47 cp $stuff/$PACKAGE-${VERSION%.*}.config .config
48 }
50 # Rules to configure and make the package.
51 compile_rules()
52 {
53 case "$ARCH" in
54 arm)
55 echo "cook: CROSS_COMPILE=$CROSS_COMPILE"
56 apply_bb_patchs &&
57 cp $stuff/arm/$PACKAGE.config .config
58 make oldconfig &&
59 make && make install || return 1
60 chmod 4755 $src/_install/bin/busybox ;;
61 x86_64) echo "TODO" ;;
62 i?86)
63 apply_bb_patchs &&
64 make oldconfig &&
65 make && make install || return 1
66 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \
67 $src/_install/bin/busybox
69 # prepare busybox-pam package
70 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
71 make oldconfig && make || return 1
72 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox
73 mv busybox busybox-pam
75 # prepare busybox-static package
76 if [ -x /usr/bin/uclibc-i486-gcc ]; then
77 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
78 make oldconfig && make || return 1
79 cp busybox busybox-static
80 mv busybox busybox-uclibc
81 fi
83 if [ -x /usr/bin/musl-gcc ]; then
84 # prepare busybox-musl package
85 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
86 sed -i 's|uclibc-i486-||' .config
87 make oldconfig && make CC=musl-gcc || return 1
88 mv busybox busybox-musl
89 fi
91 if [ -x /usr/lib/diet/bin/diet ]; then
92 # prepare busybox-diet package
93 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
94 sed -i 's|uclibc-i486-||;s|CFLAGS="|&-D_BSD_SOURCE |;s|LDFLAGS="|&-Wl,--allow-multiple-definition |;s|LDLIBS="|&compat rpc |' .config
95 make oldconfig && make CC="/usr/lib/diet/bin/diet gcc" || return 1
96 mv busybox busybox-diet
97 fi
99 # prepare ssfs-busybox package
100 rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs
101 mkdir -p $rootfs/etc
102 cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config
103 make oldconfig && make busybox &&
104 make CONFIG_PREFIX=$rootfs install || return 1
105 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf
106 chown -R 0.0 $rootfs/etc
107 chmod 0600 $rootfs/etc/busybox.conf
108 chmod 4755 $rootfs/bin/busybox ;;
109 esac
110 }
112 # Cross compilation check.
113 testsuite()
114 {
115 readelf -h $src/_install/bin/busybox
116 }
118 # Rules to gen a SliTaz package suitable for Tazpkg.
119 genpkg_rules()
120 {
121 cp -a $src/_install/* $fs
122 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
123 mkdir -p $fs/etc/init.d $fs/var/spool/cron/crontabs $fs/var/spool/lpd
125 # Busybox config files.
126 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf \
127 syslog.conf zcip.script
128 do
129 cp $stuff/$f $fs/etc
130 done
131 chown -R 0.0 $fs/etc
132 chmod 600 $fs/etc/busybox.conf
133 touch $fs/etc/resolv.conf
135 # Daemon scripts.
136 cp $stuff/daemon $fs/etc/init.d
137 DAEMON="crond dnsd ftpd httpd inetd lpd klogd ntpd syslogd telnetd tftpd udhcpd zcip"
138 for i in $DAEMON; do
139 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config &&
140 ln -s daemon $fs/etc/init.d/$i
141 done
142 rm $fs/linuxrc
143 mkdir -p $fs/etc/modprobe.d
145 # Udhcpc stuff.
146 mkdir -p $fs/usr/share/udhcpc
147 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
148 chmod +x $fs/usr/share/udhcpc/default.script
150 # Httpd stuff.
151 ln -s /usr/lib/slitaz/httphelper.sh $fs/usr/bin/httpd_helper.sh
152 cp -a $stuff/www $fs/var
153 }
155 # GNU utils stuff.
156 pre_install()
157 {
158 local i
159 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
160 answer=""
161 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
162 [ -f $1$i ] || continue
163 case "$i" in
164 /bin/busybox) continue ;;
165 *bin/*) ;;
166 *) continue ;;
167 esac
168 if [ -z "$answer" ]; then
169 echo -n "Keep installed GNU utilities ? "
170 read -t 30 answer # by default: keep
171 case "$answer" in
172 n*|N*) break;;
173 *) answer="Y";;
174 esac
175 fi
176 cp -a $1$i $1$i-busybox-install
177 done
178 }
180 post_install()
181 {
182 local i
183 [ -f /etc/resolv.conf-busybox-install ] &&
184 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
185 while read i ; do
186 [ -f $1$i-busybox-install ] || continue
187 mv $1$i-busybox-install $1$i
188 done < $1$INSTALLED/$PACKAGE/files.list
189 chmod 4755 $1/bin/busybox
191 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
192 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
193 echo '# Domain name server options.' >> $root/etc/daemons.conf
194 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
195 echo '' >> $root/etc/daemons.conf
196 fi
197 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
198 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
199 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
200 echo '' >> $root/etc/daemons.conf
201 fi
202 }
204 pre_remove()
205 {
206 # We can not remove this package !
207 exit 1
208 }