wok-current view busybox/receipt @ rev 5684
Up busybox (1.16.1)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jun 04 17:00:07 2010 +0200 (2010-06-04) |
parents | b26d43c2908c |
children | 2eef070456a4 |
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.16.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 vcsa2txt.u
26 ftpd.u
27 cpio-mkdir.u
28 tar.u
29 stat.u
30 ris.u
31 dpkg_deb.u
32 syslogd.u
33 modinfo.u
34 zmodules.u
35 EOT
36 cp ../stuff/$PACKAGE-$VERSION.config .config
37 make oldconfig
38 # "CFLAGS=-O0" is a workaround for GCC 4.5.0
39 make "CFLAGS=-O0" && make "CFLAGS=-O0" install
40 echo "Chmod 4755 on busybox binary..."
41 chmod 4755 _install/bin/busybox
42 }
44 # Rules to gen a SliTaz package suitable for Tazpkg.
45 genpkg_rules()
46 {
47 cp -a $src/_install/* $fs
48 rm -f $fs/sbin/depmod $fs/usr/bin/ar
49 mkdir -p $fs/etc/init.d
50 # Busybox config files.
51 cp stuff/busybox.conf $fs/etc
52 chmod 600 $fs/etc/busybox.conf
53 cp stuff/dnsd.conf $fs/etc
54 cp stuff/udhcpd.conf $fs/etc
55 touch $fs/etc/resolv.conf
56 cp stuff/inetd.conf $fs/etc
57 cp stuff/daemon $fs/etc/init.d
58 for i in crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd \
59 udhcpd zcip ; do
60 grep -qi config_$i=y $src/.config &&
61 ln -s daemon $fs/etc/init.d/$i
62 done
63 cp stuff/init $fs
64 rm $fs/linuxrc
65 mkdir -p $fs/etc/modprobe.d
66 # Udhcpc stuff.
67 mkdir -p $fs/usr/share/udhcpc
68 cp stuff/udhcp.script $fs/usr/share/udhcpc/default.script
69 chmod +x $fs/usr/share/udhcpc/default.script
70 # ZeroConf stuff.
71 cp stuff/zcip.script $fs/etc
72 # Httpd stuff.
73 cp stuff/httpd_helper.sh $fs/usr/bin
74 chmod +x $fs/usr/bin/httpd_helper.sh
75 }
77 # Force glibc-2.7 reinstall if 2.3.6 still in use.
78 pre_install()
79 {
80 local i
81 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
82 if grep -q 'VERSION="2.3.6"' /var/lib/tazpkg/installed/glibc-base/receipt; then
83 tazpkg get-install glibc-base --forced
84 fi
85 answer=""
86 while read i ; do
87 [ -e $ROOT$i ] || continue
88 if [ -z "$answer" ]; then
89 echo -n "Keep installed GNU utilities ? "
90 read answer
91 case "$answer" in
92 y*|Y*|o*|O*);;
93 *) break;;
94 esac
95 fi
96 mv $ROOT$i $ROOT$i-busybox-install
97 done < $1$INSTALLED/$PACKAGE/files.list
98 }
100 post_install()
101 {
102 local i
103 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
104 while read i ; do
105 [ -e $ROOT$i-busybox-install ] || continue
106 mv $ROOT$i-busybox-install $ROOT$i
107 done < $1$INSTALLED/$PACKAGE/files.list