wok-current view busybox/receipt @ rev 13409
Add: iniparser*
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Mon Oct 01 01:36:27 2012 +0200 (2012-10-01) |
parents | f5e71a92c2a8 |
children | 1ca52b3246f2 |
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 \
105 syslog.conf zcip.script
106 do
107 cp $stuff/$f $fs/etc
108 done
109 chown -R 0.0 $fs/etc
110 chmod 600 $fs/etc/busybox.conf
111 touch $fs/etc/resolv.conf
113 # Daemon scripts.
114 cp $stuff/daemon $fs/etc/init.d
115 DAEMON="crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd udhcpd zcip"
116 for i in $DAEMON; do
117 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config &&
118 ln -s daemon $fs/etc/init.d/$i
119 done
120 rm $fs/linuxrc
121 mkdir -p $fs/etc/modprobe.d
123 # Udhcpc stuff.
124 mkdir -p $fs/usr/share/udhcpc
125 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
126 chmod +x $fs/usr/share/udhcpc/default.script
128 # Httpd stuff.
129 cp -a $stuff/www $fs/var
130 }
132 # GNU utils stuff.
133 pre_install()
134 {
135 local i
136 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
137 answer=""
138 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
139 [ -f $1$i ] || continue
140 case "$i" in
141 /bin/busybox) continue ;;
142 *bin/*) ;;
143 *) continue ;;
144 esac
145 if [ -z "$answer" ]; then
146 echo -n "Keep installed GNU utilities ? "
147 read -t 30 answer # by default: keep
148 case "$answer" in
149 n*|N*) break;;
150 *) answer="Y";;
151 esac
152 fi
153 cp -a $1$i $1$i-busybox-install
154 done
155 }
157 post_install()
158 {
159 local i
160 [ -f /etc/resolv.conf-busybox-install ] &&
161 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
162 while read i ; do
163 [ -f $1$i-busybox-install ] || continue
164 mv $1$i-busybox-install $1$i
165 done < $1$INSTALLED/$PACKAGE/files.list
166 chmod 4755 $1/bin/busybox
168 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
169 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then
170 echo '# Domain name server options.' >> $root/etc/daemons.conf
171 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf
172 echo '' >> $root/etc/daemons.conf
173 fi
174 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then
175 echo '# Tftp daemon options.' >> $root/etc/daemons.conf
176 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf
177 echo '' >> $root/etc/daemons.conf
178 fi
179 if ! grep -q ^HTTPD_OPTIONS $root/etc/daemons.conf; then
180 echo '# Busybox HTTP web server options.' >> $root/etc/daemons.conf
181 echo 'HTTPD_OPTIONS="-u www"' >> $root/etc/daemons.conf
182 echo '' >> $root/etc/daemons.conf
183 fi
184 }
186 pre_remove()
187 {
188 # We can not remove this package !
189 exit 1
190 }