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