wok-tiny view busybox/receipt @ rev 126

Update config_form()
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 12 19:39:46 2017 +0100 (2017-02-12)
parents f04e6a2d1224
children 395df81fd01f
line source
1 # SliTaz package receipt.
3 PACKAGE="busybox"
4 VERSION="1.26.2"
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 [ -n "$TARGET" ] || TARGET="i486"
10 DEPENDS="slitaz-base-files"
11 BUILD_DEPENDS="bzip2 uclibc-cross-compiler-$TARGET"
12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
13 WEB_SITE="http://www.busybox.net/"
14 WGET_URL="http://www.busybox.net/downloads/$TARBALL"
15 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf"
16 AUTO_SELECTION="never"
18 apply_bb_patchs()
19 {
20 cd $src
21 while read file; do
22 [ -f done.$file ] && continue
23 echo "Apply $file..."
24 patch -p1 < $stuff/$PACKAGE-${VERSION%.*}-$file || return 1
25 touch done.$file
26 done <<EOT
27 tar.u
28 stat.u
29 ris.u
30 zmodules.u
31 cmdline.u
32 diff.u
33 diet.u
34 losetup.u
35 fbvnc.u
36 cpio.u
37 ftpd.u
38 shutdown.u
39 scriptreplay.u
40 bug9471.u
41 EOT
42 cp $stuff/$PACKAGE-${VERSION%.*}.config .config
43 var="CONFIG_CROSS_COMPILER_PREFIX"
44 sed -i "s/.*$var.*/$var=\"uclibc-$TARGET-\"/" .config
45 }
47 # Rules to configure and make the package.
48 compile_rules()
49 {
50 { apply_bb_patchs &&
51 make oldconfig &&
52 make &&
53 make install
54 } || return 1
55 echo "Chmod 4755 on busybox binary..."
56 chmod 4755 _install/bin/busybox
57 mkdir -p rootfs/lib
58 LD_LIBRARY_PATH=/usr/share/uclibc-cross-compiler-$TARGET/lib \
59 uclibc-$TARGET-ldd busybox 2> /dev/null | \
60 awk '/=>/ { print $3 }' | while read file ; do
61 cp -a $file rootfs/lib
62 while [ -L "$file" ]; do
63 dir="$(dirname $file)/"
64 file="$(readlink $file)"
65 case "$file" in
66 /*) ;;
67 *) file="$dir$file";;
68 esac
69 cp -a "$file" rootfs/lib
70 done
71 done
72 chown 0.0 rootfs/lib/*
73 }
75 # Rules to gen a SliTaz package suitable for Tazpkg.
76 genpkg_rules()
77 {
78 cp -a $WOK/base-tiny/stuff/. $fs/
79 cp -a $src/_install/bin/busybox $fs/bin
80 for i in /bin/sh /bin/login /bin/false ; do
81 ln $fs/bin/busybox $fs$i
82 done
83 mkdir -p $fs/etc/init.d
84 # Busybox config files.
85 cp $stuff/busybox.conf $fs/etc
86 chmod 600 $fs/etc/busybox.conf
87 #cp $stuff/dnsd.conf $fs/etc
88 #cp $stuff/udhcpd.conf $fs/etc
89 touch $fs/etc/resolv.conf
90 cp $stuff/inetd.conf $fs/etc
91 cp $stuff/daemon $fs/etc/init.d
92 for i in crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd \
93 udhcpd zcip ; do
94 grep -qi config_$i=y $src/.config &&
95 ln -s daemon $fs/etc/init.d/$i
96 done
97 #rm $fs/linuxrc
98 #mkdir -p $fs/etc/modprobe.d
99 # Udhcpc stuff.
100 mkdir -p $fs/usr/share/udhcpc
101 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
102 chmod +x $fs/usr/share/udhcpc/default.script
103 # ZeroConf stuff.
104 #cp $stuff/zcip.script $fs/etc
105 # Httpd stuff.
106 #cp $stuff/httpd_helper.sh $fs/usr/bin
107 #chmod +x $fs/usr/bin/httpd_helper.sh
108 # .desktop stuff
109 mkdir -p $fs/usr/share
110 #cp -a $stuff/applications $fs/usr/share
111 # prepare rootfs.cpio for kernel-* packages
112 mkdir -p $src/rootfs/lib
113 cp -a $fs/. $src/rootfs/.
114 cd $src
115 false &&
116 for i in slitaz-base-files slitaz-boot-scripts ; do
117 tazpkg get $i
118 tazpkg extract $i*.tazpkg
119 cp -a $i*/fs/. rootfs/.
120 grep -qs ^post_install $i*/receipt || continue
121 ( . $i*/receipt ; post_install rootfs )
122 done
124 ln rootfs/bin/busybox rootfs/init
125 #ln -s var/tmp rootfs/tmp
127 sed -i 's/[ \t]*#.*//;s/[ \t] / /g;s/[ \t]\t/\t/g;/^$/d' rootfs/etc/services
128 sed -i '2,$s/^#.*//;/^$/d' rootfs/etc/init.d/rc* rootfs/etc/init.d/daemon \
129 rootfs/etc/init.d/*.sh
130 sed -i 's/^#.*//;/^$/d' rootfs/etc/*.conf rootfs/etc/*tab \
131 rootfs/etc/profile rootfs/etc/securetty rootfs/etc/shells
132 find rootfs -exec touch -r rootfs {} \;
133 ( cd rootfs ; find | cpio -o -H newc ) > rootfs.cpio
134 du -h rootfs.cpio
136 rm -rf $fs/*
137 cp rootfs.cpio $fs
138 cp $stuff/busybox-${VERSION%.*}*config $fs/busybox.config.txt
139 }
141 # Force glibc-2.7 reinstall if 2.3.6 still in use.
142 pre_install()
143 {
144 local i
145 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
146 answer=""
147 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
148 [ -f $1$i ] || continue
149 case "$i" in
150 /bin/busybox) continue ;;
151 *bin/*) ;;
152 *) continue ;;
153 esac
154 if [ -z "$answer" ]; then
155 echo -n "Keep installed GNU utilities ? "
156 read -t 30 answer # by default: keep
157 case "$answer" in
158 n*|N*) break;;
159 *) answer="Y";;
160 esac
161 fi
162 cp -a $1$i $1$i-busybox-install
163 done
164 }
166 post_install()
167 {
168 local i
169 [ -f /etc/resolv.conf-busybox-install ] &&
170 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
171 while read i ; do
172 [ -f $1$i-busybox-install ] || continue
173 mv $1$i-busybox-install $1$i
174 done < $1$INSTALLED/$PACKAGE/files.list
175 chmod 4755 $1/bin/busybox
176 sed -i "s@vcsa2txt.*\$@busybox conspy -d | sed 's/ *\$//;/^\$/d;/^Processi\\\\|^.witchi/,\$!d' > /var/log/boot.log@" $1/etc/init.d/rcS
177 }