wok view busybox/receipt @ rev 9225

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