wok-current annotate busybox/receipt @ rev 18619
Up wireshark (2.0.0)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Nov 21 14:15:15 2015 +0100 (2015-11-21) |
parents | 57ce4a5c6e0f |
children | 9e01bc6321ea |
rev | line source |
---|---|
pankso@0 | 1 # SliTaz package receipt. |
pankso@0 | 2 |
pankso@0 | 3 PACKAGE="busybox" |
pascal@17836 | 4 VERSION="1.23.2" |
pankso@0 | 5 CATEGORY="base-system" |
pankso@0 | 6 SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities." |
pankso@289 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@14657 | 8 LICENSE="GPL2" |
pankso@0 | 9 TARBALL="$PACKAGE-$VERSION.tar.bz2" |
pankso@0 | 10 WEB_SITE="http://www.busybox.net/" |
pankso@0 | 11 WGET_URL="http://www.busybox.net/downloads/$TARBALL" |
pankso@12772 | 12 HOST_ARCH="i486 arm" |
pankso@0 | 13 |
pankso@12755 | 14 DEPENDS="slitaz-base-files glibc-base ncurses-common" |
pascal@14748 | 15 BUILD_DEPENDS="bzip2 pam pam-dev uclibc-cross-compiler-i486 \ |
pascal@14748 | 16 musl-libc-dev dietlibc" |
pankso@12926 | 17 |
pankso@12772 | 18 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf \ |
pankso@12772 | 19 /etc/resolv.conf /etc/httpd.conf" |
pascal@14222 | 20 AUFS_NOT_RAMFS="uclibc-cross-compiler-i486 is not compatible with aufs+tmpfs 8(" |
pankso@12755 | 21 |
pankso@12926 | 22 # Handle cross compilation |
pankso@12755 | 23 case "$ARCH" in |
pankso@16528 | 24 arm*) BUILD_DEPENDS="bzip2" ;; |
pankso@12755 | 25 esac |
pankso@12755 | 26 |
pankso@12926 | 27 # Busybox patches |
pascal@8237 | 28 apply_bb_patchs() |
slaxemulator@8159 | 29 { |
slaxemulator@8159 | 30 while read file; do |
slaxemulator@8159 | 31 [ -f done.$file ] && continue |
slaxemulator@8159 | 32 echo "Apply $file..." |
slaxemulator@9279 | 33 patch -p1 < $stuff/$PACKAGE-${VERSION%.*}-$file || return 1 |
slaxemulator@8159 | 34 touch done.$file |
slaxemulator@8159 | 35 done <<EOT |
slaxemulator@8159 | 36 tar.u |
slaxemulator@8159 | 37 stat.u |
slaxemulator@8159 | 38 ris.u |
slaxemulator@8159 | 39 zmodules.u |
slaxemulator@8159 | 40 printable.u |
slaxemulator@8159 | 41 cmdline.u |
gokhlayeh@12135 | 42 diff.u |
pascal@14748 | 43 diet.u |
pascal@15779 | 44 losetup.u |
pascal@17271 | 45 fbvnc.u |
pascal@17414 | 46 cpio.u |
pascal@17518 | 47 ftpd.u |
pascal@17518 | 48 dpkgxz.u |
pascal@18429 | 49 shutdown.u |
slaxemulator@8159 | 50 EOT |
slaxemulator@9279 | 51 cp $stuff/$PACKAGE-${VERSION%.*}.config .config |
pascal@8237 | 52 } |
pascal@8237 | 53 |
pankso@0 | 54 # Rules to configure and make the package. |
pankso@0 | 55 compile_rules() |
pankso@0 | 56 { |
pankso@12755 | 57 case "$ARCH" in |
pankso@16528 | 58 arm*) |
pankso@12755 | 59 echo "cook: CROSS_COMPILE=$CROSS_COMPILE" |
pankso@12926 | 60 apply_bb_patchs && |
pankso@12926 | 61 cp $stuff/arm/$PACKAGE.config .config |
pankso@12926 | 62 make oldconfig && |
pankso@12926 | 63 make && make install || return 1 |
pankso@12755 | 64 chmod 4755 $src/_install/bin/busybox ;; |
pankso@12755 | 65 x86_64) echo "TODO" ;; |
pankso@12755 | 66 i?86) |
pankso@12926 | 67 apply_bb_patchs && |
pankso@12926 | 68 make oldconfig && |
pankso@12926 | 69 make && make install || return 1 |
pankso@12926 | 70 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \ |
pankso@12755 | 71 $src/_install/bin/busybox |
pascal@11017 | 72 |
pankso@12755 | 73 # prepare busybox-pam package |
pankso@12755 | 74 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config |
pankso@12755 | 75 make oldconfig && make || return 1 |
pankso@12755 | 76 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox |
pankso@12755 | 77 mv busybox busybox-pam |
pascal@11017 | 78 |
pankso@12755 | 79 # prepare busybox-static package |
pascal@14748 | 80 if [ -x /usr/bin/uclibc-i486-gcc ]; then |
pascal@14748 | 81 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config |
pascal@14748 | 82 make oldconfig && make || return 1 |
pascal@14748 | 83 cp busybox busybox-static |
pascal@14748 | 84 mv busybox busybox-uclibc |
pascal@14748 | 85 fi |
pascal@14748 | 86 |
pascal@14748 | 87 if [ -x /usr/bin/musl-gcc ]; then |
pascal@14748 | 88 # prepare busybox-musl package |
pascal@14748 | 89 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config |
pascal@15392 | 90 sed -i 's|uclibc-i486-||' .config |
pascal@14748 | 91 make oldconfig && make CC=musl-gcc || return 1 |
pascal@14748 | 92 mv busybox busybox-musl |
pascal@14748 | 93 fi |
pascal@14748 | 94 |
pascal@14748 | 95 if [ -x /usr/lib/diet/bin/diet ]; then |
pascal@14748 | 96 # prepare busybox-diet package |
pascal@14748 | 97 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config |
pascal@14748 | 98 sed -i 's|uclibc-i486-||;s|CFLAGS="|&-D_BSD_SOURCE |;s|LDFLAGS="|&-Wl,--allow-multiple-definition |;s|LDLIBS="|&compat rpc |' .config |
pascal@14749 | 99 make oldconfig && make CC="/usr/lib/diet/bin/diet gcc" || return 1 |
pascal@14748 | 100 mv busybox busybox-diet |
pascal@14748 | 101 fi |
pascal@11017 | 102 |
pankso@12755 | 103 # prepare ssfs-busybox package |
pankso@12755 | 104 rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs |
pankso@12755 | 105 mkdir -p $rootfs/etc |
pankso@12755 | 106 cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config |
pankso@12755 | 107 make oldconfig && make busybox && |
pankso@12755 | 108 make CONFIG_PREFIX=$rootfs install || return 1 |
pankso@12755 | 109 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf |
pankso@12755 | 110 chown -R 0.0 $rootfs/etc |
pankso@12755 | 111 chmod 0600 $rootfs/etc/busybox.conf |
pankso@12755 | 112 chmod 4755 $rootfs/bin/busybox ;; |
pankso@12755 | 113 esac |
pankso@12755 | 114 } |
pankso@12755 | 115 |
pankso@12755 | 116 # Cross compilation check. |
pankso@12755 | 117 testsuite() |
pankso@12755 | 118 { |
pankso@12755 | 119 readelf -h $src/_install/bin/busybox |
pankso@0 | 120 } |
pankso@0 | 121 |
pankso@0 | 122 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@0 | 123 genpkg_rules() |
pankso@0 | 124 { |
pascal@14872 | 125 cp -a $src/_install/* $fs |
pascal@18182 | 126 [ -e $fs/sbin/ip ] && ln -s busybox $fs/bin/ip |
pascal@14872 | 127 rm -f $fs/bin/bbconfig $fs/usr/bin/ar |
pascal@18619 | 128 mkdir -p $fs/etc/init.d $fs/var/spool/cron/crontabs $fs/var/spool/lpd \ |
pascal@18619 | 129 $fs/var/lib/misc |
pankso@12755 | 130 |
pascal@14872 | 131 # Busybox config files. |
pascal@14872 | 132 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf \ |
pascal@14872 | 133 syslog.conf zcip.script |
pascal@14872 | 134 do |
pankso@10817 | 135 cp $stuff/$f $fs/etc |
pascal@14872 | 136 done |
pascal@14872 | 137 chown -R 0.0 $fs/etc |
pascal@14872 | 138 chmod 600 $fs/etc/busybox.conf |
pascal@14872 | 139 touch $fs/etc/resolv.conf |
pankso@10817 | 140 |
pascal@14872 | 141 # Daemon scripts. |
pascal@14872 | 142 cp $stuff/daemon $fs/etc/init.d |
pascal@14872 | 143 DAEMON="crond dnsd ftpd httpd inetd lpd klogd ntpd syslogd telnetd tftpd udhcpd zcip" |
pascal@14872 | 144 for i in $DAEMON; do |
pankso@12755 | 145 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config && |
pankso@10817 | 146 ln -s daemon $fs/etc/init.d/$i |
pascal@14872 | 147 done |
pascal@14872 | 148 rm $fs/linuxrc |
pascal@14872 | 149 mkdir -p $fs/etc/modprobe.d |
pankso@12755 | 150 |
pascal@14872 | 151 # Udhcpc stuff. |
pascal@14872 | 152 mkdir -p $fs/usr/share/udhcpc |
pascal@14872 | 153 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script |
pascal@14872 | 154 chmod +x $fs/usr/share/udhcpc/default.script |
pankso@10817 | 155 |
pascal@14872 | 156 # Httpd stuff. |
pascal@14872 | 157 ln -s /usr/lib/slitaz/httphelper.sh $fs/usr/bin/httpd_helper.sh |
pascal@14872 | 158 cp -a $stuff/www $fs/var |
pascal@18006 | 159 |
pascal@18006 | 160 # Update copyright year |
pascal@18007 | 161 grep -rl 'copy; 2' $fs/var/www | xargs \ |
pascal@18006 | 162 sed -i "s/copy; [0-9]*/copy; $(date +%Y)/" |
pankso@0 | 163 } |
pankso@557 | 164 |
pankso@12755 | 165 # GNU utils stuff. |
pankso@557 | 166 pre_install() |
pankso@557 | 167 { |
pascal@5015 | 168 local i |
pascal@983 | 169 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install |
pascal@5015 | 170 answer="" |
pascal@5924 | 171 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do |
pascal@5863 | 172 [ -f $1$i ] || continue |
pascal@5874 | 173 case "$i" in |
pankso@12755 | 174 /bin/busybox) continue ;; |
pankso@12755 | 175 *bin/*) ;; |
pankso@12755 | 176 *) continue ;; |
pascal@5874 | 177 esac |
pascal@5015 | 178 if [ -z "$answer" ]; then |
pascal@5015 | 179 echo -n "Keep installed GNU utilities ? " |
pascal@5711 | 180 read -t 30 answer # by default: keep |
pascal@5015 | 181 case "$answer" in |
pascal@5711 | 182 n*|N*) break;; |
pascal@5975 | 183 *) answer="Y";; |
pascal@5015 | 184 esac |
pascal@5015 | 185 fi |
pascal@5863 | 186 cp -a $1$i $1$i-busybox-install |
pascal@5924 | 187 done |
pankso@557 | 188 } |
pascal@983 | 189 |
pascal@983 | 190 post_install() |
pascal@983 | 191 { |
pascal@5015 | 192 local i |
pascal@5924 | 193 [ -f /etc/resolv.conf-busybox-install ] && |
pascal@983 | 194 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf |
pascal@5015 | 195 while read i ; do |
pascal@5863 | 196 [ -f $1$i-busybox-install ] || continue |
pascal@5749 | 197 mv $1$i-busybox-install $1$i |
pascal@5015 | 198 done < $1$INSTALLED/$PACKAGE/files.list |
pascal@5749 | 199 chmod 4755 $1/bin/busybox |
pankso@10818 | 200 |
al@18606 | 201 touch $root/etc/daemons.conf |
pankso@10818 | 202 # /etc/daemons.conf (tftp + dnsd + httpd may not be present) |
pankso@10818 | 203 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then |
pankso@10818 | 204 echo '# Domain name server options.' >> $root/etc/daemons.conf |
pankso@10818 | 205 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf |
pankso@10818 | 206 echo '' >> $root/etc/daemons.conf |
pankso@10818 | 207 fi |
pankso@10818 | 208 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then |
pankso@10818 | 209 echo '# Tftp daemon options.' >> $root/etc/daemons.conf |
pankso@10818 | 210 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf |
pankso@10818 | 211 echo '' >> $root/etc/daemons.conf |
pankso@10818 | 212 fi |
pascal@17521 | 213 sed -i "s/copy; 20../copy; $(date +%Y)/" $root/var/www/httpd/404.html |
pascal@5686 | 214 } |
pascal@8932 | 215 |
pascal@8932 | 216 pre_remove() |
pascal@8932 | 217 { |
pascal@8932 | 218 # We can not remove this package ! |
pascal@8932 | 219 exit 1 |
pascal@8932 | 220 } |