wok-tiny view busybox/receipt @ rev 48

busybox: update from wok
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Apr 30 15:50:16 2011 +0200 (2011-04-30)
parents e8ff6078f000
children 58f784db001c
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.18.4"
5 CATEGORY="base-system"
6 SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 [ -n "$TARGET" ] || TARGET="i486"
9 DEPENDS="slitaz-base-files"
10 BUILD_DEPENDS="bzip2 uclibc-cross-compiler-$TARGET"
11 TARBALL="$PACKAGE-$VERSION.tar.bz2"
12 WEB_SITE="http://www.busybox.net/"
13 WGET_URL="http://www.busybox.net/downloads/$TARBALL"
14 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf"
16 apply_bb_patchs()
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 conspy.u
32 EOT
33 cp ../stuff/$PACKAGE-${VERSION%.*}.config .config
34 var="CONFIG_CROSS_COMPILER_PREFIX"
35 sed -i "s/.*$var.*/$var=\"uclibc-$TARGET-\"/" .config
36 }
38 # Rules to compile & install the temporary toolchain.
39 cook_tmp_toolchain()
40 {
41 { apply_bb_patchs &&
42 make oldconfig &&
43 make &&
44 make CONFIG_PREFIX=/tools install
45 } || return 1
46 echo "Chmod 4755 on busybox binary..."
47 chmod 4755 /tools/bin/busybox
48 }
50 # Rules to configure and make the package.
51 compile_rules()
52 {
53 { apply_bb_patchs &&
54 make oldconfig &&
55 make &&
56 make install
57 } || return 1
58 echo "Chmod 4755 on busybox binary..."
59 chmod 4755 _install/bin/busybox
60 }
62 # Rules to gen a SliTaz package suitable for Tazpkg.
63 genpkg_rules()
64 {
65 cp -a $src/_install/* $fs
66 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
67 mkdir -p $fs/etc/init.d
68 # Busybox config files.
69 cp stuff/busybox.conf $fs/etc
70 chmod 600 $fs/etc/busybox.conf
71 cp stuff/dnsd.conf $fs/etc
72 cp stuff/udhcpd.conf $fs/etc
73 touch $fs/etc/resolv.conf
74 cp stuff/inetd.conf $fs/etc
75 cp stuff/daemon $fs/etc/init.d
76 for i in crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd \
77 udhcpd zcip ; do
78 grep -qi config_$i=y $src/.config &&
79 ln -s daemon $fs/etc/init.d/$i
80 done
81 ln -s bin/busybox $fs/init
82 rm $fs/linuxrc
83 mkdir -p $fs/etc/modprobe.d
84 # Udhcpc stuff.
85 mkdir -p $fs/usr/share/udhcpc
86 cp stuff/udhcp.script $fs/usr/share/udhcpc/default.script
87 chmod +x $fs/usr/share/udhcpc/default.script
88 # ZeroConf stuff.
89 cp stuff/zcip.script $fs/etc
90 # Httpd stuff.
91 cp stuff/httpd_helper.sh $fs/usr/bin
92 chmod +x $fs/usr/bin/httpd_helper.sh
93 # .desktop stuff
94 mkdir -p $fs/usr/share
95 cp -a stuff/applications $fs/usr/share
96 # prepare rootfs.cpio for kernel-* packages
97 mkdir -p $src/rootfs/lib
98 cp -a $fs/. $src/rootfs/.
99 cd $src
100 for i in slitaz-base-files slitaz-boot-scripts ; do
101 tazpkg get $i
102 tazpkg extract $i*.tazpkg
103 cp -a $i*/fs/. rootfs/.
104 grep -qs ^post_install $i*/receipt || continue
105 ( . $i*/receipt ; post_install rootfs )
106 done
107 LD_LIBRARY_PATH=/usr/share/uclibc-cross-compiler-$TARGET/lib \
108 uclibc-$TARGET-ldd busybox 2> /dev/null | \
109 awk '/=>/ { print $3 }' | while read file ; do
110 cp -a $file rootfs/lib
111 while [ -L "$file" ]; do
112 dir="$(dirname $file)/"
113 file="$(readlink $file)"
114 case "$file" in
115 /*) ;;
116 *) file="$dir$file";;
117 esac
118 cp -a "$file" rootfs/lib
119 done
120 done
121 chown 0.0 rootfs/lib/*
122 rm -rf rootfs/tmp rootfs/var/games rootfs/var/cache \
123 rootfs/bin/bootlog rootfs/etc/modprobe.d rootfs/home \
124 rootfs/sbin/mktazdevs.sh rootfs/usr/bin/man \
125 rootfs/usr/share/applications rootfs/sys rootfs/usr/bin/ldd \
126 rootfs/etc/nsswitch.conf rootfs/etc/zcip.script \
127 rootfs/etc/udhcpd.conf rootfs/etc/inetd.conf \
128 rootfs/usr/lib rootfs/usr/games rootfs/usr/share/doc \
129 rootfs/usr/local rootfs/var/lock rootfs/var/spool rootfs/media
131 ln -s var/tmp rootfs/tmp
133 ( cd rootfs ; find | cpio -o -H newc ) > rootfs.cpio
134 du -h rootfs.cpio
135 }
137 # Force glibc-2.7 reinstall if 2.3.6 still in use.
138 pre_install()
139 {
140 local i
141 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
142 answer=""
143 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
144 [ -f $1$i ] || continue
145 case "$i" in
146 /bin/busybox) continue ;;
147 *bin/*) ;;
148 *) continue ;;
149 esac
150 if [ -z "$answer" ]; then
151 echo -n "Keep installed GNU utilities ? "
152 read -t 30 answer # by default: keep
153 case "$answer" in
154 n*|N*) break;;
155 *) answer="Y";;
156 esac
157 fi
158 cp -a $1$i $1$i-busybox-install
159 done
160 }
162 post_install()
163 {
164 local i
165 [ -f /etc/resolv.conf-busybox-install ] &&
166 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
167 while read i ; do
168 [ -f $1$i-busybox-install ] || continue
169 mv $1$i-busybox-install $1$i
170 done < $1$INSTALLED/$PACKAGE/files.list
171 chmod 4755 $1/bin/busybox
172 sed -i "s@vcsa2txt.*\$@busybox conspy -d | sed 's/ *\$//;/^\$/d;/^Processi\\\\|^.witchi/,\$!d' > /var/log/boot.log@" $1/etc/init.d/rcS
173 }