wok-tiny view busybox/receipt @ rev 96

No shadow passwords
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Oct 07 10:53:41 2015 +0200 (2015-10-07)
parents 371673f39e46
children 7cd5e798bfe2
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 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 printable.u
32 cmdline.u
33 conspy.u
34 EOT
35 cp $stuff/$PACKAGE-${VERSION%.*}.config .config
36 var="CONFIG_CROSS_COMPILER_PREFIX"
37 sed -i "s/.*$var.*/$var=\"uclibc-$TARGET-\"/" .config
38 }
40 # Rules to configure and make the package.
41 compile_rules()
42 {
43 { apply_bb_patchs &&
44 make oldconfig &&
45 make &&
46 make install
47 } || return 1
48 echo "Chmod 4755 on busybox binary..."
49 chmod 4755 _install/bin/busybox
50 mkdir -p rootfs/lib
51 LD_LIBRARY_PATH=/usr/share/uclibc-cross-compiler-$TARGET/lib \
52 uclibc-$TARGET-ldd busybox 2> /dev/null | \
53 awk '/=>/ { print $3 }' | while read file ; do
54 cp -a $file rootfs/lib
55 while [ -L "$file" ]; do
56 dir="$(dirname $file)/"
57 file="$(readlink $file)"
58 case "$file" in
59 /*) ;;
60 *) file="$dir$file";;
61 esac
62 cp -a "$file" rootfs/lib
63 done
64 done
65 chown 0.0 rootfs/lib/*
66 }
68 # Rules to gen a SliTaz package suitable for Tazpkg.
69 genpkg_rules()
70 {
71 cp -a $WOK/base-tiny/stuff/. $fs/
72 cp -a $src/_install/bin/busybox $fs/bin
73 for i in /bin/sh /bin/login /bin/getty /bin/false \
74 /sbin/getty /sbin/reboot; do
75 ln $fs/bin/busybox $fs$i
76 done
77 mkdir -p $fs/etc/init.d
78 # Busybox config files.
79 cp $stuff/busybox.conf $fs/etc
80 chmod 600 $fs/etc/busybox.conf
81 #cp $stuff/dnsd.conf $fs/etc
82 #cp $stuff/udhcpd.conf $fs/etc
83 touch $fs/etc/resolv.conf
84 cp $stuff/inetd.conf $fs/etc
85 cp $stuff/daemon $fs/etc/init.d
86 for i in crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd \
87 udhcpd zcip ; do
88 grep -qi config_$i=y $src/.config &&
89 ln -s daemon $fs/etc/init.d/$i
90 done
91 #rm $fs/linuxrc
92 #mkdir -p $fs/etc/modprobe.d
93 # Udhcpc stuff.
94 mkdir -p $fs/usr/share/udhcpc
95 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
96 chmod +x $fs/usr/share/udhcpc/default.script
97 # ZeroConf stuff.
98 #cp $stuff/zcip.script $fs/etc
99 # Httpd stuff.
100 #cp $stuff/httpd_helper.sh $fs/usr/bin
101 #chmod +x $fs/usr/bin/httpd_helper.sh
102 # .desktop stuff
103 mkdir -p $fs/usr/share
104 #cp -a $stuff/applications $fs/usr/share
105 # prepare rootfs.cpio for kernel-* packages
106 mkdir -p $src/rootfs/lib
107 cp -a $fs/. $src/rootfs/.
108 cd $src
109 false &&
110 for i in slitaz-base-files slitaz-boot-scripts ; do
111 tazpkg get $i
112 tazpkg extract $i*.tazpkg
113 cp -a $i*/fs/. rootfs/.
114 grep -qs ^post_install $i*/receipt || continue
115 ( . $i*/receipt ; post_install rootfs )
116 done
118 ln rootfs/bin/busybox rootfs/init
119 #ln -s var/tmp rootfs/tmp
121 ( cd rootfs ; find | cpio -o -H newc ) > rootfs.cpio
122 du -h rootfs.cpio
124 rm -rf $fs/*
125 cp rootfs.cpio $fs
126 cp $stuff/busybox*config $fs/busybox.config.txt
127 }
129 # Force glibc-2.7 reinstall if 2.3.6 still in use.
130 pre_install()
131 {
132 local i
133 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install
134 answer=""
135 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do
136 [ -f $1$i ] || continue
137 case "$i" in
138 /bin/busybox) continue ;;
139 *bin/*) ;;
140 *) continue ;;
141 esac
142 if [ -z "$answer" ]; then
143 echo -n "Keep installed GNU utilities ? "
144 read -t 30 answer # by default: keep
145 case "$answer" in
146 n*|N*) break;;
147 *) answer="Y";;
148 esac
149 fi
150 cp -a $1$i $1$i-busybox-install
151 done
152 }
154 post_install()
155 {
156 local i
157 [ -f /etc/resolv.conf-busybox-install ] &&
158 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf
159 while read i ; do
160 [ -f $1$i-busybox-install ] || continue
161 mv $1$i-busybox-install $1$i
162 done < $1$INSTALLED/$PACKAGE/files.list
163 chmod 4755 $1/bin/busybox
164 sed -i "s@vcsa2txt.*\$@busybox conspy -d | sed 's/ *\$//;/^\$/d;/^Processi\\\\|^.witchi/,\$!d' > /var/log/boot.log@" $1/etc/init.d/rcS
165 }