wok annotate busybox/receipt @ rev 13371
Up: slitaz-base-files (5.3) - bunch of improvments, thanks Aleksej
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Sep 14 22:30:53 2012 +0200 (2012-09-14) |
parents | f5e71a92c2a8 |
children | 1ca52b3246f2 |
rev | line source |
---|---|
pankso@0 | 1 # SliTaz package receipt. |
pankso@0 | 2 |
pankso@0 | 3 PACKAGE="busybox" |
pascal@13118 | 4 VERSION="1.20.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" |
pankso@0 | 8 TARBALL="$PACKAGE-$VERSION.tar.bz2" |
pankso@0 | 9 WEB_SITE="http://www.busybox.net/" |
pankso@0 | 10 WGET_URL="http://www.busybox.net/downloads/$TARBALL" |
pankso@12772 | 11 HOST_ARCH="i486 arm" |
pankso@0 | 12 |
pankso@12755 | 13 DEPENDS="slitaz-base-files glibc-base ncurses-common" |
pankso@12755 | 14 BUILD_DEPENDS="bzip2 pam pam-dev uclibc-cross-compiler-i486" |
pankso@12926 | 15 |
pankso@12772 | 16 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf \ |
pankso@12772 | 17 /etc/resolv.conf /etc/httpd.conf" |
pankso@12772 | 18 AUFS_NOT_SUPPORTED="uclibc-cross-compiler-i486 is not compatible with aufs 8(" |
pankso@12755 | 19 |
pankso@12926 | 20 # Handle cross compilation |
pankso@12755 | 21 case "$ARCH" in |
pankso@12755 | 22 arm) BUILD_DEPENDS="bzip2" ;; |
pankso@12755 | 23 esac |
pankso@12755 | 24 |
pankso@12926 | 25 # Busybox patches |
pascal@8237 | 26 apply_bb_patchs() |
slaxemulator@8159 | 27 { |
slaxemulator@8159 | 28 cd $src |
slaxemulator@8159 | 29 while read file; do |
slaxemulator@8159 | 30 [ -f done.$file ] && continue |
slaxemulator@8159 | 31 echo "Apply $file..." |
slaxemulator@9279 | 32 patch -p1 < $stuff/$PACKAGE-${VERSION%.*}-$file || return 1 |
slaxemulator@8159 | 33 touch done.$file |
slaxemulator@8159 | 34 done <<EOT |
slaxemulator@8159 | 35 tar.u |
slaxemulator@8159 | 36 stat.u |
slaxemulator@8159 | 37 ris.u |
slaxemulator@8159 | 38 zmodules.u |
slaxemulator@8159 | 39 printable.u |
slaxemulator@8159 | 40 cmdline.u |
pascal@12084 | 41 su-nochdir.u |
gokhlayeh@12135 | 42 diff.u |
slaxemulator@8159 | 43 EOT |
slaxemulator@9279 | 44 cp $stuff/$PACKAGE-${VERSION%.*}.config .config |
pascal@8237 | 45 } |
pascal@8237 | 46 |
pankso@0 | 47 # Rules to configure and make the package. |
pankso@0 | 48 compile_rules() |
pankso@0 | 49 { |
pankso@12755 | 50 case "$ARCH" in |
pankso@12755 | 51 arm) |
pankso@12755 | 52 echo "cook: CROSS_COMPILE=$CROSS_COMPILE" |
pankso@12926 | 53 apply_bb_patchs && |
pankso@12926 | 54 cp $stuff/arm/$PACKAGE.config .config |
pankso@12926 | 55 make oldconfig && |
pankso@12926 | 56 make && make install || return 1 |
pankso@12755 | 57 chmod 4755 $src/_install/bin/busybox ;; |
pankso@12755 | 58 x86_64) echo "TODO" ;; |
pankso@12755 | 59 i?86) |
pankso@12926 | 60 apply_bb_patchs && |
pankso@12926 | 61 make oldconfig && |
pankso@12926 | 62 make && make install || return 1 |
pankso@12926 | 63 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \ |
pankso@12755 | 64 $src/_install/bin/busybox |
pascal@11017 | 65 |
pankso@12755 | 66 # prepare busybox-pam package |
pankso@12755 | 67 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config |
pankso@12755 | 68 make oldconfig && make || return 1 |
pankso@12755 | 69 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox |
pankso@12755 | 70 mv busybox busybox-pam |
pascal@11017 | 71 |
pankso@12755 | 72 # prepare busybox-static package |
pankso@12755 | 73 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config |
pankso@12755 | 74 make oldconfig && make || return 1 |
pankso@12755 | 75 mv busybox busybox-static |
pascal@11017 | 76 |
pankso@12755 | 77 # prepare ssfs-busybox package |
pankso@12755 | 78 rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs |
pankso@12755 | 79 mkdir -p $rootfs/etc |
pankso@12755 | 80 cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config |
pankso@12755 | 81 make oldconfig && make busybox && |
pankso@12755 | 82 make CONFIG_PREFIX=$rootfs install || return 1 |
pankso@12755 | 83 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf |
pankso@12755 | 84 chown -R 0.0 $rootfs/etc |
pankso@12755 | 85 chmod 0600 $rootfs/etc/busybox.conf |
pankso@12755 | 86 chmod 4755 $rootfs/bin/busybox ;; |
pankso@12755 | 87 esac |
pankso@12755 | 88 } |
pankso@12755 | 89 |
pankso@12755 | 90 # Cross compilation check. |
pankso@12755 | 91 testsuite() |
pankso@12755 | 92 { |
pankso@12755 | 93 readelf -h $src/_install/bin/busybox |
pankso@0 | 94 } |
pankso@0 | 95 |
pankso@0 | 96 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@0 | 97 genpkg_rules() |
pankso@0 | 98 { |
pankso@0 | 99 cp -a $src/_install/* $fs |
pascal@7755 | 100 rm -f $fs/bin/bbconfig $fs/usr/bin/ar |
pankso@10817 | 101 mkdir -p $fs/etc/init.d $fs/var |
pankso@12755 | 102 |
pascal@514 | 103 # Busybox config files. |
pascal@13186 | 104 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf \ |
pascal@13186 | 105 syslog.conf zcip.script |
pankso@10817 | 106 do |
pankso@10817 | 107 cp $stuff/$f $fs/etc |
pankso@10817 | 108 done |
pankso@10817 | 109 chown -R 0.0 $fs/etc |
pankso@0 | 110 chmod 600 $fs/etc/busybox.conf |
pascal@847 | 111 touch $fs/etc/resolv.conf |
pankso@10817 | 112 |
pascal@12460 | 113 # Daemon scripts. |
slaxemulator@9279 | 114 cp $stuff/daemon $fs/etc/init.d |
slaxemulator@9279 | 115 DAEMON="crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd udhcpd zcip" |
slaxemulator@9279 | 116 for i in $DAEMON; do |
pankso@12755 | 117 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config && |
pankso@10817 | 118 ln -s daemon $fs/etc/init.d/$i |
pascal@5308 | 119 done |
pascal@1703 | 120 rm $fs/linuxrc |
pascal@1299 | 121 mkdir -p $fs/etc/modprobe.d |
pankso@12755 | 122 |
pankso@0 | 123 # Udhcpc stuff. |
pankso@0 | 124 mkdir -p $fs/usr/share/udhcpc |
slaxemulator@9279 | 125 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script |
pankso@0 | 126 chmod +x $fs/usr/share/udhcpc/default.script |
pankso@10817 | 127 |
pascal@5684 | 128 # Httpd stuff. |
pankso@10817 | 129 cp -a $stuff/www $fs/var |
pankso@0 | 130 } |
pankso@557 | 131 |
pankso@12755 | 132 # GNU utils stuff. |
pankso@557 | 133 pre_install() |
pankso@557 | 134 { |
pascal@5015 | 135 local i |
pascal@983 | 136 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install |
pascal@5015 | 137 answer="" |
pascal@5924 | 138 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do |
pascal@5863 | 139 [ -f $1$i ] || continue |
pascal@5874 | 140 case "$i" in |
pankso@12755 | 141 /bin/busybox) continue ;; |
pankso@12755 | 142 *bin/*) ;; |
pankso@12755 | 143 *) continue ;; |
pascal@5874 | 144 esac |
pascal@5015 | 145 if [ -z "$answer" ]; then |
pascal@5015 | 146 echo -n "Keep installed GNU utilities ? " |
pascal@5711 | 147 read -t 30 answer # by default: keep |
pascal@5015 | 148 case "$answer" in |
pascal@5711 | 149 n*|N*) break;; |
pascal@5975 | 150 *) answer="Y";; |
pascal@5015 | 151 esac |
pascal@5015 | 152 fi |
pascal@5863 | 153 cp -a $1$i $1$i-busybox-install |
pascal@5924 | 154 done |
pankso@557 | 155 } |
pascal@983 | 156 |
pascal@983 | 157 post_install() |
pascal@983 | 158 { |
pascal@5015 | 159 local i |
pascal@5924 | 160 [ -f /etc/resolv.conf-busybox-install ] && |
pascal@983 | 161 mv -f /etc/resolv.conf-busybox-install /etc/resolv.conf |
pascal@5015 | 162 while read i ; do |
pascal@5863 | 163 [ -f $1$i-busybox-install ] || continue |
pascal@5749 | 164 mv $1$i-busybox-install $1$i |
pascal@5015 | 165 done < $1$INSTALLED/$PACKAGE/files.list |
pascal@5749 | 166 chmod 4755 $1/bin/busybox |
pankso@10818 | 167 |
pankso@10818 | 168 # /etc/daemons.conf (tftp + dnsd + httpd may not be present) |
pankso@10818 | 169 if ! grep -q ^DNSD_OPTIONS $root/etc/daemons.conf; then |
pankso@10818 | 170 echo '# Domain name server options.' >> $root/etc/daemons.conf |
pankso@10818 | 171 echo 'DNSD_OPTIONS="-d"' >> $root/etc/daemons.conf |
pankso@10818 | 172 echo '' >> $root/etc/daemons.conf |
pankso@10818 | 173 fi |
pankso@10818 | 174 if ! grep -q ^TFTPD_OPTIONS $root/etc/daemons.conf; then |
pankso@10818 | 175 echo '# Tftp daemon options.' >> $root/etc/daemons.conf |
pankso@10818 | 176 echo 'TFTPD_OPTIONS="-r /boot"' >> $root/etc/daemons.conf |
pankso@10818 | 177 echo '' >> $root/etc/daemons.conf |
pankso@10818 | 178 fi |
pankso@10818 | 179 if ! grep -q ^HTTPD_OPTIONS $root/etc/daemons.conf; then |
pankso@10818 | 180 echo '# Busybox HTTP web server options.' >> $root/etc/daemons.conf |
pankso@10818 | 181 echo 'HTTPD_OPTIONS="-u www"' >> $root/etc/daemons.conf |
pankso@10818 | 182 echo '' >> $root/etc/daemons.conf |
pankso@10818 | 183 fi |
pascal@5686 | 184 } |
pascal@8932 | 185 |
pascal@8932 | 186 pre_remove() |
pascal@8932 | 187 { |
pascal@8932 | 188 # We can not remove this package ! |
pascal@8932 | 189 exit 1 |
pascal@8932 | 190 } |