wok-6.x view busybox/receipt @ rev 7595
mirror-tools: add scm
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Dec 11 12:04:25 2010 +0100 (2010-12-11) |
parents | 1a1bfecb4881 |
children | 040555bd4620 |
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.17.4"
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 pam pam-dev uclibc-cross-compiler-i486"
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 printable.u
33 cmdline.u
34 EOT
35 cp ../stuff/$PACKAGE-$VERSION.config .config
36 make oldconfig
37 if [ "$(gcc --version | awk '{ print $3; exit }')" == "4.5.0" ]; then
38 # "CFLAGS=-O0" is a workaround for GCC 4.5.0 (sed crash)
39 # "CFLAGS=-fno-tree-pta" may be a workaround for GCC 4.5.0 (sed garbage)
40 make -j 4 "CFLAGS=-O0" && make "CFLAGS=-O0" install
41 else
42 make -j 4 && make install
43 fi
44 echo "Chmod 4755 on busybox binary..."
45 chmod 4755 _install/bin/busybox
46 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
47 make oldconfig
48 if [ "$(gcc --version | awk '{ print $3; exit }')" == "4.5.0" ]; then
49 # "CFLAGS=-O0" is a workaround for GCC 4.5.0 (sed crash)
50 # "CFLAGS=-fno-tree-pta" may be a workaround for GCC 4.5.0 (sed garbage)
51 make -j 4 "CFLAGS=-O0"
52 else
53 make -j 4
54 fi
55 mv busybox busybox-pam
56 chmod 4755 busybox-pam
57 cp ../stuff/$PACKAGE-$VERSION.config-static .config
58 make oldconfig
59 make -j 4
60 mv busybox busybox-static
61 chmod 4755 busybox-static
62 }
64 # Rules to gen a SliTaz package suitable for Tazpkg.
65 genpkg_rules()
66 {
67 cp -a $src/_install/* $fs
68 mkdir -p $fs/etc/init.d
69 # Busybox config files.
70 cp stuff/busybox.conf $fs/etc
71 chmod 600 $fs/etc/busybox.conf
72 cp stuff/dnsd.conf $fs/etc
73 cp stuff/udhcpd.conf $fs/etc
74 touch $fs/etc/resolv.conf
75 cp stuff/inetd.conf $fs/etc
76 cp stuff/daemon $fs/etc/init.d
77 for i in crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd \
78 udhcpd zcip ; do
79 grep -qi config_$i=y $src/.config &&
80 ln -s daemon $fs/etc/init.d/$i
81 done
82 cp stuff/init $fs
83 rm $fs/linuxrc
84 mkdir -p $fs/etc/modprobe.d
85 # Udhcpc stuff.
86 mkdir -p $fs/usr/share/udhcpc
87 cp stuff/udhcp.script $fs/usr/share/udhcpc/default.script
88 chmod +x $fs/usr/share/udhcpc/default.script
89 # ZeroConf stuff.
90 cp stuff/zcip.script $fs/etc
91 # Httpd stuff.
92 cp stuff/httpd_helper.sh $fs/usr/bin
93 chmod +x $fs/usr/bin/httpd_helper.sh
94 # .desktop stuff
95 mkdir -p $fs/usr/share
96 cp -a stuff/applications $fs/usr/share
97 }
99 # Force glibc-2.7 reinstall if 2.3.6 still in use.
100 pre_install()
101 {
102 local i
103 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
104 if grep -q 'VERSION="2.3.6"' /var/lib/tazpkg/installed/glibc-base/receipt; then
105 tazpkg get-install glibc-base --forced
106 fi
107 answer=""
108 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
109 [ -f $1$i ] || continue
110 case "$i" in
111 /bin/busybox) continue ;;
112 *bin/*) ;;
113 *) continue ;;
114 esac
115 if [ -z "$answer" ]; then
116 echo -n "Keep installed GNU utilities ? "
117 read -t 30 answer # by default: keep
118 case "$answer" in
119 n*|N*) break;;
120 *) answer="Y";;
121 esac
122 fi
123 cp -a $1$i $1$i-busybox-install
124 done
125 }
127 post_install()
128 {
129 local i
130 [ -f /etc/resolv.conf-busybox-install ] &&
131 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
132 while read i ; do
133 [ -f $1$i-busybox-install ] || continue
134 mv $1$i-busybox-install $1$i
135 done < $1$INSTALLED/$PACKAGE/files.list
136 chmod 4755 $1/bin/busybox
137 sed -i "s@vcsa2txt.*\$@busybox conspy -d | sed 's/ *\$//;/^\$/d;/^Processi\\\\|^.witchi/,\$!d' > /var/log/boot.log@" $1/etc/init.d/rcS
138 }