wok-next view busybox/receipt @ rev 19624

Fix some WANTED versions
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Feb 08 16:29:10 2017 +0100 (2017-02-08)
parents dd1205f552b8
children c8f1af81c244
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 WEB_SITE="https://busybox.net/"
10 HOST_ARCH="i486 arm"
12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
13 WGET_URL="${WEB_SITE}downloads/$TARBALL"
15 DEPENDS="slitaz-base-files glibc-base ncurses"
16 BUILD_DEPENDS="bzip2 gettext perl"
17 SIBLINGS="busybox-boot busybox-pam busybox-static ssfs-busybox busybox-slish"
19 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf \
20 /etc/resolv.conf /etc/httpd.conf"
22 # Handle cross compilation
23 case "$ARCH" in
24 arm*) BUILD_DEPENDS="bzip2" ;;
25 esac
27 # Busybox patches
28 apply_bb_patches()
29 {
30 while read file; do
31 [ -f done.$file ] && continue
32 echo "Apply $file..."
33 patch -p1 < $stuff/${VERSION%.*}/$file || return 1
34 touch done.$file
35 done <<EOT
36 tar.u
37 stat.u
38 ris.u
39 zmodules.u
40 cmdline.u
41 diff.u
42 diet.u
43 losetup.u
44 fbvnc.u
45 cpio.u
46 ftpd.u
47 shutdown.u
48 scriptreplay.u
49 bug9471.u
50 EOT
51 cp $stuff/${VERSION%.*}/.config .
52 }
54 # Rules to configure and make the package.
55 compile_rules()
56 {
57 case "$ARCH" in
58 arm*)
59 echo "cook: CROSS_COMPILE=$CROSS_COMPILE"
60 apply_bb_patches &&
61 cp $stuff/arm/$PACKAGE.config .config
62 make oldconfig &&
63 make && make install || return 1
64 chmod 4755 $src/_install/bin/busybox
65 ;;
66 x86_64)
67 echo "TODO"
68 ;;
69 i?86)
70 echo 'Making busybox'
71 apply_bb_patches &&
72 make oldconfig &&
73 make && make install || return 1
74 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \
75 $src/_install/bin/busybox
77 echo 'Making translations'
78 make -C $stuff/po install
79 ;;
81 esac
83 cook_pick_manpages $src/docs/busybox.1
85 mkdir -p $install/usr/share/doc/busybox
86 cp -a $src/docs/*.txt $install/usr/share/doc/busybox
87 cp -a $src/docs/*.htm* $install/usr/share/doc/busybox
88 cp -a $src/docs/cgi $install/usr/share/doc/busybox
89 }
91 # Cross compilation check.
92 testsuite()
93 {
94 readelf -h $src/_install/bin/busybox
95 }
97 # Rules to gen a SliTaz package suitable for Tazpkg.
98 genpkg_rules()
99 {
100 cp -a $src/_install/* $fs
101 [ -e $fs/sbin/ip ] && ln -s busybox $fs/bin/ip
102 rm -f $fs/bin/bbconfig $fs/usr/bin/ar
103 mkdir -p $fs/etc/init.d $fs/var/spool/cron/crontabs $fs/var/spool/lpd \
104 $fs/var/lib/misc
106 # Busybox config files.
107 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf \
108 syslog.conf zcip.script
109 do
110 cp $stuff/$f $fs/etc
111 done
112 chown -R 0.0 $fs/etc
113 chmod 600 $fs/etc/busybox.conf
114 touch $fs/etc/resolv.conf
116 # Daemon scripts.
117 cp $stuff/daemon $fs/etc/init.d
118 for i in crond dnsd ftpd httpd inetd lpd klogd ntpd syslogd telnetd tftpd \
119 udhcpd zcip; do
120 grep -qi config_$i=y $stuff/${VERSION%.*}/.config &&
121 ln -s daemon $fs/etc/init.d/$i
122 done
123 rm $fs/linuxrc
124 mkdir -p $fs/etc/modprobe.d
126 # Udhcpc stuff.
127 mkdir -p $fs/usr/share/udhcpc
128 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
129 chmod +x $fs/usr/share/udhcpc/default.script
131 # Httpd stuff.
132 ln -s /usr/lib/slitaz/httphelper.sh $fs/usr/bin/httpd_helper.sh
133 cp -a $stuff/www $fs/var
135 # Update copyright year
136 grep -rl 'YEAR' $fs/var/www | xargs sed -i "s|YEAR|$(date +%Y)|"
137 :
138 }
140 # GNU utils stuff.
141 pre_install()
142 {
143 local i
144 [ -s $1/etc/resolv.conf ] &&
145 cp -a $1/etc/resolv.conf $1/etc/resolv.conf-busybox-install
146 answer=""
147 for i in $(sed '/busybox$/d; /bin\//!d' "$1$INSTALLED/$PACKAGE/files.list"); do
148 [ -f "$1$i" ] || continue
149 if [ -z "$answer" ]; then
150 echo
151 confirm 'Keep installed GNU utilities?' y || break
152 answer='Y'
153 fi
154 cp -a "$1$i" "$1$i-busybox-install"
155 done
156 }
158 post_install()
159 {
160 local i
161 [ -f $1/etc/resolv.conf-busybox-install ] &&
162 mv -f $1/etc/resolv.conf-busybox-install $1/etc/resolv.conf
163 for i in $($1/bin/busybox --list-full); do
164 [ -f "$1/$i-busybox-install" ] || continue
165 mv "$1/$i-busybox-install" "$1/$i"
166 done
167 chmod 4755 "$1/bin/busybox"
169 touch "$1/etc/daemons.conf"
170 # /etc/daemons.conf (tftp + dnsd + httpd may not be present)
171 if ! grep -q ^DNSD_OPTIONS "$1/etc/daemons.conf"; then
172 cat >> "$1/etc/daemons.conf" <<EOF
173 # Domain name server options.
174 DNSD_OPTIONS="-d"
176 EOF
177 fi
178 if ! grep -q ^TFTPD_OPTIONS $1/etc/daemons.conf; then
179 cat >> "$1/etc/daemons.conf" <<EOF
180 # Tftp daemon options.
181 TFTPD_OPTIONS="-r /boot"
183 EOF
184 fi
185 sed -i "s/copy; 20../copy; $(date +%Y)/" $1/var/www/httpd/404.html
186 }
188 pre_remove()
189 {
190 # We can not remove this package!
191 exit 1
192 }