wok-6.x annotate busybox/receipt @ rev 12847

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