wok view busybox/receipt @ rev 23756

gst-plugins-base-1.0: added build dependency automake
author Hans-G?nter Theisgen
date Sat May 02 16:58:52 2020 +0100 (2020-05-02)
parents 2cb2b3d8fb16
children 7a039a870626
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.31.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 gettext-tools"
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 current_version()
28 {
29 wget -O - $WEB_SITE 2>/dev/null | \
30 sed "/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|;q"
31 }
33 # Busybox patches
34 apply_bb_patchs()
35 {
36 sed -i 's|march=|&i486 -mtune=|' arch/i386/Makefile
37 while read file; do
38 [ -f done.$file ] && continue
39 echo "Apply $file..."
40 patch -p1 < $stuff/$PACKAGE-${VERSION%.*}-$file || return 1
41 touch done.$file
42 done <<EOT
43 tar.u
44 stat.u
45 ris.u
46 zmodules.u
47 cmdline.u
48 diff.u
49 diet.u
50 losetup.u
51 fbvnc.u
52 cpio.u
53 shutdown.u
54 scriptreplay.u
55 mkfs_vfat.u
56 ash.u
57 EOT
58 cp $stuff/$PACKAGE-${VERSION%.*}.config .config
59 }
61 # Rules to configure and make the package.
62 compile_rules()
63 {
64 case "$ARCH" in
65 arm*)
66 echo "cook: CROSS_COMPILE=$CROSS_COMPILE"
67 apply_bb_patchs &&
68 cp $stuff/arm/$PACKAGE.config .config
69 make oldconfig | sed 's|ERROR|error|' &&
70 make && make install || return 1
71 chmod 4755 $src/_install/bin/busybox ;;
72 x86_64) echo "TODO" ;;
73 i?86)
74 echo "=== Build busybox ==="
75 sed -i 's|uname -m|echo i486|' Makefile
76 apply_bb_patchs &&
77 make oldconfig | sed 's|ERROR|error|' &&
78 make && make install || return 1
79 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \
80 $src/_install/bin/busybox
81 mv busybox_unstripped.map busybox-glibc.map
82 mv docs/busybox.1 docs/busybox.base.1
84 # prepare busybox-pam package
85 echo "=== Build busybox-pam ==="
86 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
87 make oldconfig | sed 's|ERROR|error|' && make || return 1
88 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox
89 mv busybox busybox-pam
90 mv busybox_unstripped.map busybox-pam.map
91 mv docs/busybox.1 docs/busybox.pam.1
93 # prepare busybox-static package
94 if [ -x /usr/bin/uclibc-i486-gcc ]; then
95 echo "=== Build busybox-uclibc ==="
96 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
97 sed -i 's/# CONFIG_ASH_INTERNAL_GLOB is not set/CONFIG_ASH_INTERNAL_GLOB=y/' .config
98 make oldconfig | sed 's|ERROR|error|' &&
99 LDFLAGS="" make || return 1
100 cp busybox busybox-static
101 mv busybox busybox-uclibc
102 mv busybox_unstripped.map busybox-uclibc.map
103 mv -f docs/busybox.1 docs/busybox.static.1
104 fi
106 if [ -x /usr/bin/musl-gcc ]; then
107 echo "=== Build busybox-musl ==="
108 # prepare busybox-musl package
109 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
110 sed -i 's|uclibc-i486-||' .config
111 make oldconfig | sed 's|ERROR|error|' &&
112 if make CC=musl-gcc 2> musl-err.log ; then
113 mv busybox busybox-musl
114 mv busybox_unstripped.map busybox-musl.map
115 mv -f docs/busybox.1 docs/busybox.static.1
116 fi
117 fi
119 if [ -x /usr/lib/diet/bin/diet ]; then
120 echo "=== Build busybox-diet ==="
121 # prepare busybox-diet package
122 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
123 sed -i 's|uclibc-i486-||;s|CFLAGS="|&-D_BSD_SOURCE |;s|LDFLAGS="|&-Wl,--allow-multiple-definition |;s|LDLIBS="|&compat rpc |' .config
124 make oldconfig | sed 's|ERROR|error|' &&
125 if make CC="/usr/lib/diet/bin/diet gcc" 2> diet-err.log ; then
126 mv busybox busybox-diet
127 mv busybox_unstripped.map busybox-diet.map
128 mv -f docs/busybox.1 docs/busybox.static.1
129 fi
130 fi
132 # prepare ssfs-busybox package
133 echo "=== Build busybox-ssfs ==="
134 rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs
135 mkdir -p $rootfs/etc
136 cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config
137 make oldconfig | sed 's|ERROR|error|' && make busybox &&
138 make CONFIG_PREFIX=$rootfs install || return 1
139 mv busybox_unstripped.map busybox-ssfs.map
140 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf
141 chown -R 0.0 $rootfs/etc
142 chmod 0600 $rootfs/etc/busybox.conf
143 chmod 4755 $rootfs/bin/busybox
145 # Compile translations
146 echo "=== Build translations ==="
147 make -C $stuff/po install
148 cp docs/busybox.base.1 docs/busybox.1
150 ;;
152 esac
153 }
155 # Cross compilation check.
156 testsuite()
157 {
158 readelf -h $src/_install/bin/busybox
159 }
161 # Keep e2fsprogs kmod & util-linux-mount files
162 REMOVED_SYMLINKS="/bin/mount /bin/mountpoint /bin/umount /sbin/depmod \
163 /sbin/insmod /sbin/modinfo /sbin/modprobe /sbin/rmmod /bin/lsattr /bin/chattr \
164 /sbin/tune2fs"
166 # Rules to gen a SliTaz package suitable for Tazpkg.
167 genpkg_rules()
168 {
169 mkdir -p $install/usr/share/man/man1 $install/usr/share/doc/busybox
170 cp -a $src/_install/* $fs
171 cp -a $src/docs/busybox.base.1 $install/usr/share/man/man1/busybox.1
172 cp -a $src/docs/*.txt $install/usr/share/doc/busybox
173 cp -a $src/docs/*.htm* $install/usr/share/doc/busybox
174 cp -a $src/docs/cgi $install/usr/share/doc/busybox
175 [ -e $fs/sbin/ip ] && ln -s busybox $fs/bin/ip
176 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
177 mkdir -p $fs/etc/init.d $fs/var/spool/cron/crontabs $fs/var/spool/lpd \
178 $fs/var/lib/misc
179 cp $stuff/command_not_found $fs/bin
181 # Busybox config files.
182 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf \
183 syslog.conf zcip.script
184 do
185 cp $stuff/$f $fs/etc
186 done
187 chown -R 0.0 $fs/etc
188 chmod 600 $fs/etc/busybox.conf
189 touch $fs/etc/resolv.conf
191 # Daemon scripts.
192 cp $stuff/daemon $fs/etc/init.d
193 DAEMON="crond dnsd ftpd httpd inetd lpd klogd ntpd syslogd telnetd tftpd udhcpd zcip"
194 for i in $DAEMON; do
195 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config &&
196 ln -s daemon $fs/etc/init.d/$i
197 done
198 mkdir -p $fs/etc/modprobe.d
200 # Udhcpc stuff.
201 mkdir -p $fs/usr/share/udhcpc
202 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
203 chmod +x $fs/usr/share/udhcpc/default.script
205 # Httpd stuff.
206 ln -s /usr/lib/slitaz/httphelper.sh $fs/usr/bin/httpd_helper.sh
207 cp -a $stuff/www $fs/var
209 # Update copyright year
210 grep -rl 'copy; 2' $fs/var/www | xargs \
211 sed -i "s/copy; [0-9]*/copy; $(date +%Y)/"
213 # Remove kmod & util-linux-mount links
214 for link in $REMOVED_SYMLINKS; do
215 rm -f $fs$link
216 done
217 }
219 # GNU utils stuff.
220 pre_install()
221 {
222 local i
223 [ -s $1/etc/resolv.conf ] &&
224 cp -a $1/etc/resolv.conf $1/etc/resolv.conf-busybox-install
225 answer=""
226 for i in $(cat "$1$INSTALLED/$PACKAGE/files.list"); do
227 [ -f "$1$i" ] || continue
228 case "$i" in
229 /bin/busybox) continue ;;
230 *bin/*) ;;
231 *) continue ;;
232 esac
233 if [ -z "$answer" ]; then
234 echo
235 echo -n "Keep installed GNU utilities ? "
236 read -t 30 answer # by default: keep
237 case "$answer" in
238 n*|N*) break;;
239 *) answer="Y";;
240 esac
241 fi
242 cp -a "$1$i" "$1$i-busybox-install"
243 done
244 }
246 post_install()
247 {
248 local i
249 [ -f $1/etc/resolv.conf-busybox-install ] &&
250 mv -f $1/etc/resolv.conf-busybox-install $1/etc/resolv.conf
251 while read i ; do
252 [ -f "$1$i-busybox-install" ] || continue
253 mv "$1$i-busybox-install" "$1$i"
254 done < "$1$INSTALLED/$PACKAGE/files.list"
255 chmod 4755 "$1/bin/busybox"
257 touch $1/etc/daemons.conf
258 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
259 if ! grep -q ^DNSD_OPTIONS $1/etc/daemons.conf; then
260 echo '# Domain name server options.' >> $1/etc/daemons.conf
261 echo 'DNSD_OPTIONS="-d"' >> $1/etc/daemons.conf
262 echo '' >> $1/etc/daemons.conf
263 fi
264 if ! grep -q ^TFTPD_OPTIONS $1/etc/daemons.conf; then
265 echo '# Tftp daemon options.' >> $1/etc/daemons.conf
266 echo 'TFTPD_OPTIONS="-r /boot"' >> $1/etc/daemons.conf
267 echo '' >> $1/etc/daemons.conf
268 fi
269 sed -i "s/copy; 20../copy; $(date +%Y)/" $1/var/www/httpd/404.html
270 for link in $REMOVED_SYMLINKS; do
271 [ -e $1$link ] || ln -s /bin/busybox $1$link
272 done
273 }
275 pre_remove()
276 {
277 # We can not remove this package !
278 exit 1
279 }