wok-4.x view busybox/receipt @ rev 12466

New toolchain GCC 4.9.2, Glibc 2.19, Binutils 2.23.1
author Stanislas Leduc <shann@slitaz.org>
date Wed Nov 09 15:12:00 2022 +0000 (18 months ago)
parents fa31026b97ce
children 6898646adcef
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.23.2"
5 CATEGORY="base-system"
6 SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities."
7 MAINTAINER="shann@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"
13 DEPENDS="slitaz-base-files glibc-base ncurses-common ncurses-extra"
14 BUILD_DEPENDS="bzip2 libtirpc-dev"
16 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf \
17 /etc/resolv.conf /etc/httpd.conf"
19 # Busybox patches
20 apply_bb_patchs()
21 {
22 while read file; do
23 [ -f done.$file ] && continue
24 echo "Apply $file..."
25 patch -p1 < $stuff/patches/$PACKAGE-${VERSION%.*}-$file || return 1
26 touch done.$file
27 done <<EOT
28 tar.u
29 stat.u
30 ris.u
31 zmodules.u
32 printable.u
33 cmdline.u
34 diff.u
35 diet.u
36 losetup.u
37 fbvnc.u
38 cpio.u
39 ftpd.u
40 dpkgxz.u
41 shutdown.u
42 EOT
43 cp $stuff/$PACKAGE-${VERSION%.*}.config .config
44 }
46 # Rules to configure and make the package.
47 compile_rules()
48 {
49 apply_bb_patchs &&
50 #patch -p1 < $stuff/patches/$PACKAGE-${VERSION%.*}-glibc.patch &&
51 cp $stuff/$PACKAGE-${VERSION%.*}.config .config &&
52 make oldconfig &&
53 make && make install || return 1
54 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr $src/_install/bin/busybox
55 }
57 # Cross compilation check.
58 testsuite()
59 {
60 readelf -h $src/_install/bin/busybox
61 }
63 # Rules to gen a SliTaz package suitable for Tazpkg.
64 genpkg_rules()
65 {
66 cp -a $src/_install/* $fs
67 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
68 mkdir -p $fs/etc/init.d $fs/var/spool/cron/crontabs $fs/var/spool/lpd
70 # Busybox config files.
71 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf \
72 syslog.conf zcip.script
73 do
74 cp $stuff/$f $fs/etc
75 done
76 chown -R 0.0 $fs/etc
77 chmod 600 $fs/etc/busybox.conf
78 touch $fs/etc/resolv.conf
80 # Daemon scripts.
81 cp $stuff/daemon $fs/etc/init.d
82 DAEMON="crond dnsd ftpd httpd inetd lpd klogd ntpd syslogd telnetd tftpd udhcpd zcip"
83 for i in $DAEMON; do
84 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config &&
85 ln -s daemon $fs/etc/init.d/$i
86 done
87 rm $fs/linuxrc
88 mkdir -p $fs/etc/modprobe.d
90 # Udhcpc stuff.
91 mkdir -p $fs/usr/share/udhcpc
92 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
93 chmod +x $fs/usr/share/udhcpc/default.script
95 # Httpd stuff.
96 ln -s /usr/lib/slitaz/httphelper.sh $fs/usr/bin/httpd_helper.sh
97 cp -a $stuff/www $fs/var
98 }
100 # GNU utils stuff.
101 pre_install()
102 {
103 local i
104 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
105 answer=""
106 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
107 [ -f $1$i ] || continue
108 case "$i" in
109 /bin/busybox) continue ;;
110 *bin/*) ;;
111 *) continue ;;
112 esac
113 if [ -z "$answer" ]; then
114 echo -n "Keep installed GNU utilities ? "
115 read -t 30 answer # by default: keep
116 case "$answer" in
117 n*|N*) break;;
118 *) answer="Y";;
119 esac
120 fi
121 cp -a $1$i $1$i-busybox-install
122 done
123 }
125 post_install()
126 {
127 local i
128 [ -f /etc/resolv.conf-busybox-install ] &&
129 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
130 while read i ; do
131 [ -f $1$i-busybox-install ] || continue
132 mv $1$i-busybox-install $1$i
133 done < $1$INSTALLED/$PACKAGE/files.list
134 chmod 4755 $1/bin/busybox
136 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
137 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
138 echo '# Domain name server options.' >> $root/etc/daemons.conf
139 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
140 echo '' >> $root/etc/daemons.conf
141 fi
142 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
143 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
144 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
145 echo '' >> $root/etc/daemons.conf
146 fi
147 sed -i "s/copy; 20../copy; $(date +%Y)/" $root/var/www/httpd/404.html
148 }
150 pre_remove()
151 {
152 # We can not remove this package !
153 exit 1
154 }