wok-stable view busybox/receipt @ rev 6523

Up: mercurial to 1.6.4.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Oct 02 17:27:57 2010 +0000 (2010-10-02)
parents 029092db0791
children a841d189e474
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.17.1"
5 CATEGORY="base-system"
6 SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 DEPENDS="slitaz-base-files glibc-base"
9 BUILD_DEPENDS="bzip2"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.busybox.net/"
12 WGET_URL="http://www.busybox.net/downloads/$TARBALL"
13 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 cd $src
19 while read file; do
20 [ -f done.$file ] && continue
21 echo "Apply $file..."
22 patch -p1 < ../stuff/$PACKAGE-$VERSION-$file || return 1
23 touch done.$file
24 done <<EOT
25 cpio-mkdir.u
26 tar.u
27 stat.u
28 ris.u
29 depmod.u
30 zmodules.u
31 usage.u
32 EOT
33 cp ../stuff/$PACKAGE-$VERSION.config .config
34 make oldconfig
35 if [ "$(gcc --version | awk '{ print $3; exit }')" == "4.5.0" ]; then
36 # "CFLAGS=-O0" is a workaround for GCC 4.5.0 (sed crash)
37 # "CFLAGS=-fno-tree-pta" may be a workaround for GCC 4.5.0 (sed garbage)
38 make -j 4 "CFLAGS=-O0" && make "CFLAGS=-O0" install
39 else
40 make -j 4 && make install
41 fi
42 echo "Chmod 4755 on busybox binary..."
43 chmod 4755 _install/bin/busybox
44 }
46 # Rules to gen a SliTaz package suitable for Tazpkg.
47 genpkg_rules()
48 {
49 cp -a $src/_install/* $fs
50 mkdir -p $fs/etc/init.d
51 # Busybox config files.
52 cp stuff/busybox.conf $fs/etc
53 chmod 600 $fs/etc/busybox.conf
54 cp stuff/dnsd.conf $fs/etc
55 cp stuff/udhcpd.conf $fs/etc
56 touch $fs/etc/resolv.conf
57 cp stuff/inetd.conf $fs/etc
58 cp stuff/daemon $fs/etc/init.d
59 for i in crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd \
60 udhcpd zcip ; do
61 grep -qi config_$i=y $src/.config &&
62 ln -s daemon $fs/etc/init.d/$i
63 done
64 cp stuff/init $fs
65 rm $fs/linuxrc
66 mkdir -p $fs/etc/modprobe.d
67 # Udhcpc stuff.
68 mkdir -p $fs/usr/share/udhcpc
69 cp stuff/udhcp.script $fs/usr/share/udhcpc/default.script
70 chmod +x $fs/usr/share/udhcpc/default.script
71 # ZeroConf stuff.
72 cp stuff/zcip.script $fs/etc
73 # Httpd stuff.
74 cp stuff/httpd_helper.sh $fs/usr/bin
75 chmod +x $fs/usr/bin/httpd_helper.sh
76 # .desktop stuff
77 mkdir -p $fs/usr/share
78 cp -a stuff/applications $fs/usr/share
79 }
81 # Force glibc-2.7 reinstall if 2.3.6 still in use.
82 pre_install()
83 {
84 local i
85 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
86 if grep -q 'VERSION="2.3.6"' /var/lib/tazpkg/installed/glibc-base/receipt; then
87 tazpkg get-install glibc-base --forced
88 fi
89 answer=""
90 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
91 [ -f $1$i ] || continue
92 case "$i" in
93 /bin/busybox) continue ;;
94 *bin/*) ;;
95 *) continue ;;
96 esac
97 if [ -z "$answer" ]; then
98 echo -n "Keep installed GNU utilities ? "
99 read -t 30 answer # by default: keep
100 case "$answer" in
101 n*|N*) break;;
102 *) answer="Y";;
103 esac
104 fi
105 cp -a $1$i $1$i-busybox-install
106 done
107 }
109 post_install()
110 {
111 local i
112 [ -f /etc/resolv.conf-busybox-install ] &&
113 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
114 while read i ; do
115 [ -f $1$i-busybox-install ] || continue
116 mv $1$i-busybox-install $1$i
117 done < $1$INSTALLED/$PACKAGE/files.list
118 chmod 4755 $1/bin/busybox
119 sed -i "s@vcsa2txt.*\$@busybox conspy -d | sed 's/ *\$//;/^\$/d;/^Processi\\\\|^.witchi/,\$!d' > /var/log/boot.log@" $1/etc/init.d/rcS
120 }