wok view busybox/receipt @ rev 13185

Up: drupal to 7.15.
author Christopher Rogers <slaxemulator@gmail.com>
date Thu Aug 02 23:52:02 2012 +0000 (2012-08-02)
parents 61ad9c3b0a5a
children a8fcb4e54df0
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.20.2"
5 CATEGORY="base-system"
6 SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
9 WEB_SITE="http://www.busybox.net/"
10 WGET_URL="http://www.busybox.net/downloads/$TARBALL"
11 HOST_ARCH="i486 arm"
13 DEPENDS="slitaz-base-files glibc-base ncurses-common"
14 BUILD_DEPENDS="bzip2 pam pam-dev uclibc-cross-compiler-i486"
16 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf \
17 /etc/resolv.conf /etc/httpd.conf"
18 AUFS_NOT_SUPPORTED="uclibc-cross-compiler-i486 is not compatible with aufs 8("
20 # Handle cross compilation
21 case "$ARCH" in
22 arm) BUILD_DEPENDS="bzip2" ;;
23 esac
25 # Busybox patches
26 apply_bb_patchs()
27 {
28 cd $src
29 while read file; do
30 [ -f done.$file ] && continue
31 echo "Apply $file..."
32 patch -p1 < $stuff/$PACKAGE-${VERSION%.*}-$file || return 1
33 touch done.$file
34 done <<EOT
35 tar.u
36 stat.u
37 ris.u
38 zmodules.u
39 printable.u
40 cmdline.u
41 su-nochdir.u
42 diff.u
43 EOT
44 cp $stuff/$PACKAGE-${VERSION%.*}.config .config
45 }
47 # Rules to configure and make the package.
48 compile_rules()
49 {
50 case "$ARCH" in
51 arm)
52 echo "cook: CROSS_COMPILE=$CROSS_COMPILE"
53 apply_bb_patchs &&
54 cp $stuff/arm/$PACKAGE.config .config
55 make oldconfig &&
56 make && make install || return 1
57 chmod 4755 $src/_install/bin/busybox ;;
58 x86_64) echo "TODO" ;;
59 i?86)
60 apply_bb_patchs &&
61 make oldconfig &&
62 make && make install || return 1
63 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \
64 $src/_install/bin/busybox
66 # prepare busybox-pam package
67 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config
68 make oldconfig && make || return 1
69 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox
70 mv busybox busybox-pam
72 # prepare busybox-static package
73 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config
74 make oldconfig && make || return 1
75 mv busybox busybox-static
77 # prepare ssfs-busybox package
78 rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs
79 mkdir -p $rootfs/etc
80 cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config
81 make oldconfig && make busybox &&
82 make CONFIG_PREFIX=$rootfs install || return 1
83 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf
84 chown -R 0.0 $rootfs/etc
85 chmod 0600 $rootfs/etc/busybox.conf
86 chmod 4755 $rootfs/bin/busybox ;;
87 esac
88 }
90 # Cross compilation check.
91 testsuite()
92 {
93 readelf -h $src/_install/bin/busybox
94 }
96 # Rules to gen a SliTaz package suitable for Tazpkg.
97 genpkg_rules()
98 {
99 cp -a $src/_install/* $fs
100 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
101 mkdir -p $fs/etc/init.d $fs/var
103 # Busybox config files.
104 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf zcip.script
105 do
106 cp $stuff/$f $fs/etc
107 done
108 chown -R 0.0 $fs/etc
109 chmod 600 $fs/etc/busybox.conf
110 touch $fs/etc/resolv.conf
112 # Daemon scripts.
113 cp $stuff/daemon $fs/etc/init.d
114 DAEMON="crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd udhcpd zcip"
115 for i in $DAEMON; do
116 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config &&
117 ln -s daemon $fs/etc/init.d/$i
118 done
119 rm $fs/linuxrc
120 mkdir -p $fs/etc/modprobe.d
122 # Udhcpc stuff.
123 mkdir -p $fs/usr/share/udhcpc
124 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
125 chmod +x $fs/usr/share/udhcpc/default.script
127 # Httpd stuff.
128 cp -a $stuff/www $fs/var
129 }
131 # GNU utils stuff.
132 pre_install()
133 {
134 local i
135 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
136 answer=""
137 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
138 [ -f $1$i ] || continue
139 case "$i" in
140 /bin/busybox) continue ;;
141 *bin/*) ;;
142 *) continue ;;
143 esac
144 if [ -z "$answer" ]; then
145 echo -n "Keep installed GNU utilities ? "
146 read -t 30 answer # by default: keep
147 case "$answer" in
148 n*|N*) break;;
149 *) answer="Y";;
150 esac
151 fi
152 cp -a $1$i $1$i-busybox-install
153 done
154 }
156 post_install()
157 {
158 local i
159 [ -f /etc/resolv.conf-busybox-install ] &&
160 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
161 while read i ; do
162 [ -f $1$i-busybox-install ] || continue
163 mv $1$i-busybox-install $1$i
164 done < $1$INSTALLED/$PACKAGE/files.list
165 chmod 4755 $1/bin/busybox
167 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
168 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
169 echo '# Domain name server options.' >> $root/etc/daemons.conf
170 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
171 echo '' >> $root/etc/daemons.conf
172 fi
173 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
174 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
175 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
176 echo '' >> $root/etc/daemons.conf
177 fi
178 if ! grep -q ^HTTPD_OPTIONS $root/etc/daemons.conf; then
179 echo '# Busybox HTTP web server options.' >> $root/etc/daemons.conf
180 echo 'HTTPD_OPTIONS="-u www"' >> $root/etc/daemons.conf
181 echo '' >> $root/etc/daemons.conf
182 fi
183 }
185 pre_remove()
186 {
187 # We can not remove this package !
188 exit 1
189 }