wok-6.x view busybox/receipt @ rev 7795

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