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