wok-next view busybox/receipt @ rev 19627

busybox: uclibc-cross-compiler-i486 is not compatible with aufs+tmpfs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Feb 08 18:20:24 2017 +0100 (2017-02-08)
parents c8f1af81c244
children 0b2945245647
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.26.2"
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 WEB_SITE="https://busybox.net/"
10 HOST_ARCH="i486 arm"
11 AUFS_NOT_RAMFS="uclibc-cross-compiler-i486 is not compatible with aufs+tmpfs 8("
13 TARBALL="$PACKAGE-$VERSION.tar.bz2"
14 WGET_URL="${WEB_SITE}downloads/$TARBALL"
16 DEPENDS="slitaz-base-files glibc-base ncurses"
17 BUILD_DEPENDS="bzip2 gettext perl pam pam-dev uclibc-cross-compiler-i486 \
18 musl-libc-dev dietlibc"
20 SPLIT="busybox-boot busybox-pam busybox-static ssfs-busybox busybox-slish"
22 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf \
23 /etc/resolv.conf /etc/httpd.conf"
25 # Handle cross compilation
26 case "$ARCH" in
27 arm*) BUILD_DEPENDS="bzip2" ;;
28 esac
30 # Busybox patches
31 apply_bb_patches()
32 {
33 while read file; do
34 [ -f done.$file ] && continue
35 echo "Apply $file..."
36 patch -p1 < $stuff/${VERSION%.*}/$file || return 1
37 touch done.$file
38 done <<EOT
39 tar.u
40 stat.u
41 ris.u
42 zmodules.u
43 cmdline.u
44 diff.u
45 diet.u
46 losetup.u
47 fbvnc.u
48 cpio.u
49 ftpd.u
50 shutdown.u
51 scriptreplay.u
52 bug9471.u
53 EOT
54 cp $stuff/${VERSION%.*}/.config .
55 }
57 # Rules to configure and make the package.
58 compile_rules()
59 {
60 case "$ARCH" in
61 arm*)
62 echo "cook: CROSS_COMPILE=$CROSS_COMPILE"
63 apply_bb_patches &&
64 cp $stuff/arm/$PACKAGE.config .config
65 make oldconfig &&
66 make && make install || return 1
67 chmod 4755 $src/_install/bin/busybox
68 ;;
69 x86_64)
70 echo "TODO"
71 ;;
72 i?86)
73 echo 'Making busybox'
74 apply_bb_patches &&
75 make oldconfig &&
76 make && make install || return 1
77 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \
78 $src/_install/bin/busybox
79 mv docs/busybox.1 docs/busybox.base.1
81 # prepare busybox-pam package
82 echo "Making busybox-pam"
83 sed -i 's|# CONFIG_PAM is not set|CONFIG_PAM=y|' .config
84 make oldconfig && make || return 1
85 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox
86 mv busybox busybox-pam
87 mv docs/busybox.1 docs/busybox.pam.1
89 # prepare busybox-static package
90 if [ -x /usr/bin/uclibc-i486-gcc ]; then
91 echo "Making busybox-uclibc"
92 cp $stuff/${VERSION%.*}/.config-static .config
93 sed -i 's|# CONFIG_ASH_INTERNAL_GLOB is not set|CONFIG_ASH_INTERNAL_GLOB=y|' .config
94 make oldconfig && make || return 1
95 cp busybox busybox-static
96 mv busybox busybox-uclibc
97 mv -f docs/busybox.1 docs/busybox.static.1
98 fi
100 if [ -x /usr/bin/musl-gcc ]; then
101 echo "Making busybox-musl"
102 # prepare busybox-musl package
103 cp $stuff/${VERSION%.*}/.config-static .config
104 sed -i 's|uclibc-i486-||' .config
105 make oldconfig && make CC=musl-gcc || return 1
106 mv busybox busybox-musl
107 mv -f docs/busybox.1 docs/busybox.static.1
108 fi
110 if [ -x /usr/lib/diet/bin/diet ]; then
111 echo "Making busybox-diet"
112 # prepare busybox-diet package
113 cp $stuff/${VERSION%.*}/.config-static .config
114 sed -i 's|uclibc-i486-||;s|CFLAGS="|&-D_BSD_SOURCE |;s|LDFLAGS="|&-Wl,--allow-multiple-definition |;s|LDLIBS="|&compat rpc |' .config
115 make oldconfig && make CC="/usr/lib/diet/bin/diet gcc" || return 1
116 mv busybox busybox-diet
117 mv -f docs/busybox.1 docs/busybox.static.1
118 fi
120 # prepare ssfs-busybox package
121 echo "Making busybox-ssfs"
122 rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs
123 mkdir -p $rootfs/etc
124 cp $stuff/${VERSION%.*}/.config-ssfs .config
125 make oldconfig && make busybox &&
126 make CONFIG_PREFIX=$rootfs install || return 1
127 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf
128 chown -R 0.0 $rootfs/etc
129 chmod 0600 $rootfs/etc/busybox.conf
130 chmod 4755 $rootfs/bin/busybox
132 echo 'Making translations'
133 make -C $stuff/po install
134 cp docs/busybox.base.1 docs/busybox.1
135 ;;
137 esac
139 cook_pick_manpages $src/docs/busybox.1
141 mkdir -p $install/usr/share/doc/busybox
142 cp -a $src/docs/*.txt $install/usr/share/doc/busybox
143 cp -a $src/docs/*.htm* $install/usr/share/doc/busybox
144 cp -a $src/docs/cgi $install/usr/share/doc/busybox
145 }
147 # Cross compilation check.
148 testsuite()
149 {
150 readelf -h $src/_install/bin/busybox
151 }
153 # Rules to gen a SliTaz package suitable for Tazpkg.
154 genpkg_rules()
155 {
156 cp -a $src/_install/* $fs
157 [ -e $fs/sbin/ip ] && ln -s busybox $fs/bin/ip
158 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
159 mkdir -p $fs/etc/init.d $fs/var/spool/cron/crontabs $fs/var/spool/lpd \
160 $fs/var/lib/misc
162 # Busybox config files.
163 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf \
164 syslog.conf zcip.script
165 do
166 cp $stuff/$f $fs/etc
167 done
168 chown -R 0.0 $fs/etc
169 chmod 600 $fs/etc/busybox.conf
170 touch $fs/etc/resolv.conf
172 # Daemon scripts.
173 cp $stuff/daemon $fs/etc/init.d
174 for i in crond dnsd ftpd httpd inetd lpd klogd ntpd syslogd telnetd tftpd \
175 udhcpd zcip; do
176 grep -qi config_$i=y $stuff/${VERSION%.*}/.config &&
177 ln -s daemon $fs/etc/init.d/$i
178 done
179 rm $fs/linuxrc
180 mkdir -p $fs/etc/modprobe.d
182 # Udhcpc stuff.
183 mkdir -p $fs/usr/share/udhcpc
184 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
185 chmod +x $fs/usr/share/udhcpc/default.script
187 # Httpd stuff.
188 ln -s /usr/lib/slitaz/httphelper.sh $fs/usr/bin/httpd_helper.sh
189 cp -a $stuff/www $fs/var
191 # Update copyright year
192 grep -rl 'YEAR' $fs/var/www | xargs sed -i "s|YEAR|$(date +%Y)|"
193 :
194 }
196 # GNU utils stuff.
197 pre_install()
198 {
199 local i
200 [ -s $1/etc/resolv.conf ] &&
201 cp -a $1/etc/resolv.conf $1/etc/resolv.conf-busybox-install
202 answer=""
203 for i in $(sed '/busybox$/d; /bin\//!d' "$1$INSTALLED/$PACKAGE/files.list"); do
204 [ -f "$1$i" ] || continue
205 if [ -z "$answer" ]; then
206 echo
207 confirm 'Keep installed GNU utilities?' y || break
208 answer='Y'
209 fi
210 cp -a "$1$i" "$1$i-busybox-install"
211 done
212 }
214 post_install()
215 {
216 local i
217 [ -f $1/etc/resolv.conf-busybox-install ] &&
218 mv -f $1/etc/resolv.conf-busybox-install $1/etc/resolv.conf
219 for i in $($1/bin/busybox --list-full); do
220 [ -f "$1/$i-busybox-install" ] || continue
221 mv "$1/$i-busybox-install" "$1/$i"
222 done
223 chmod 4755 "$1/bin/busybox"
225 touch "$1/etc/daemons.conf"
226 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
227 if ! grep -q ^DNSD_OPTIONS "$1/etc/daemons.conf"; then
228 cat >> "$1/etc/daemons.conf" <<EOF
229 # Domain name server options.
230 DNSD_OPTIONS="-d"
232 EOF
233 fi
234 if ! grep -q ^TFTPD_OPTIONS $1/etc/daemons.conf; then
235 cat >> "$1/etc/daemons.conf" <<EOF
236 # Tftp daemon options.
237 TFTPD_OPTIONS="-r /boot"
239 EOF
240 fi
241 sed -i "s/copy; 20../copy; $(date +%Y)/" $1/var/www/httpd/404.html
242 }
244 pre_remove()
245 {
246 # We can not remove this package!
247 exit 1
248 }