wok view busybox/receipt @ rev 7274

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