wok view busybox/receipt @ rev 8236

busybox-pam needs pam-dev for security/pam_appl.h security/pam_misc.h
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jan 27 11:52:18 2011 +0100 (2011-01-27)
parents ffc5675acd45
children da0fd74ac96d
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.18.2"
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 compile & install the temporary toolchain.
16 cook_tmp_toolchain()
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 EOT
32 cp ../stuff/$PACKAGE-$VERSION.config .config
33 { make oldconfig &&
34 make &&
35 make CONFIG_PREFIX=/tools install
36 } || return 1
37 echo "Chmod 4755 on busybox binary..."
38 chmod 4755 /tools/bin/busybox
39 }
41 # Rules to configure and make the package.
42 compile_rules()
43 {
44 cd $src
45 while read file; do
46 [ -f done.$file ] && continue
47 echo "Apply $file..."
48 patch -p1 < ../stuff/$PACKAGE-$VERSION-$file || return 1
49 touch done.$file
50 done <<EOT
51 tar.u
52 stat.u
53 ris.u
54 zmodules.u
55 printable.u
56 cmdline.u
57 EOT
58 cp ../stuff/$PACKAGE-$VERSION.config .config
59 make oldconfig
60 make || return 1
61 make install || return 1
62 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
63 make oldconfig
64 make || return 1
65 mv busybox busybox-pam
66 cp ../stuff/$PACKAGE-$VERSION.config-static .config
67 make oldconfig
68 make || return 1
69 mv busybox busybox-static
70 }
72 # Rules to gen a SliTaz package suitable for Tazpkg.
73 genpkg_rules()
74 {
75 cp -a $src/_install/* $fs
76 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
77 mkdir -p $fs/etc/init.d
78 # Busybox config files.
79 cp stuff/busybox.conf $fs/etc
80 chmod 600 $fs/etc/busybox.conf
81 cp stuff/dnsd.conf $fs/etc
82 cp stuff/udhcpd.conf $fs/etc
83 touch $fs/etc/resolv.conf
84 cp stuff/inetd.conf $fs/etc
85 cp stuff/daemon $fs/etc/init.d
86 for i in crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd \
87 udhcpd zcip ; do
88 grep -qi config_$i=y $src/.config &&
89 ln -s daemon $fs/etc/init.d/$i
90 done
91 cp stuff/init $fs
92 rm $fs/linuxrc
93 mkdir -p $fs/etc/modprobe.d
94 # Udhcpc stuff.
95 mkdir -p $fs/usr/share/udhcpc
96 cp stuff/udhcp.script $fs/usr/share/udhcpc/default.script
97 chmod +x $fs/usr/share/udhcpc/default.script
98 # ZeroConf stuff.
99 cp stuff/zcip.script $fs/etc
100 # Httpd stuff.
101 cp stuff/httpd_helper.sh $fs/usr/bin
102 chmod +x $fs/usr/bin/httpd_helper.sh
103 # .desktop stuff
104 mkdir -p $fs/usr/share
105 cp -a stuff/applications $fs/usr/share
106 }
108 # Force glibc-2.7 reinstall if 2.3.6 still in use.
109 pre_install()
110 {
111 local i
112 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
113 if grep -q 'VERSION="2.3.6"' /var/lib/tazpkg/installed/glibc-base/receipt; then
114 tazpkg get-install glibc-base --forced
115 fi
116 answer=""
117 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
118 [ -f $1$i ] || continue
119 case "$i" in
120 /bin/busybox) continue ;;
121 *bin/*) ;;
122 *) continue ;;
123 esac
124 if [ -z "$answer" ]; then
125 echo -n "Keep installed GNU utilities ? "
126 read -t 30 answer # by default: keep
127 case "$answer" in
128 n*|N*) break;;
129 *) answer="Y";;
130 esac
131 fi
132 cp -a $1$i $1$i-busybox-install
133 done
134 }
136 post_install()
137 {
138 local i
139 [ -f /etc/resolv.conf-busybox-install ] &&
140 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
141 while read i ; do
142 [ -f $1$i-busybox-install ] || continue
143 mv $1$i-busybox-install $1$i
144 done < $1$INSTALLED/$PACKAGE/files.list
145 chmod 4755 $1/bin/busybox
146 sed -i "s@vcsa2txt.*\$@busybox conspy -d | sed 's/ *\$//;/^\$/d;/^Processi\\\\|^.witchi/,\$!d' > /var/log/boot.log@" $1/etc/init.d/rcS
147 }