wok annotate busybox/receipt @ rev 23376
updated perl-net-ldap (0.39 -> 0.66)
author | Hans-G?nter Theisgen |
---|---|
date | Tue Mar 31 14:06:02 2020 +0100 (2020-03-31) |
parents | 7f2789b79625 |
children | 539876c71561 |
rev | line source |
---|---|
pankso@0 | 1 # SliTaz package receipt. |
pankso@0 | 2 |
pankso@0 | 3 PACKAGE="busybox" |
pascal@22095 | 4 VERSION="1.31.1" |
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@19350 | 15 BUILD_DEPENDS="bzip2 pam pam-dev uclibc-cross-compiler-i486 \ |
pascal@19622 | 16 musl-libc-dev dietlibc gettext-tools" |
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 |
pascal@22822 | 27 current_version() |
pascal@22822 | 28 { |
pascal@22822 | 29 wget -O - $WEB_SITE 2>/dev/null | \ |
pascal@22822 | 30 sed "/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|;q" |
pascal@22822 | 31 } |
pascal@22822 | 32 |
pankso@12926 | 33 # Busybox patches |
pascal@8237 | 34 apply_bb_patchs() |
slaxemulator@8159 | 35 { |
pascal@20652 | 36 sed -i 's|march=|&i486 -mtune=|' arch/i386/Makefile |
slaxemulator@8159 | 37 while read file; do |
slaxemulator@8159 | 38 [ -f done.$file ] && continue |
slaxemulator@8159 | 39 echo "Apply $file..." |
slaxemulator@9279 | 40 patch -p1 < $stuff/$PACKAGE-${VERSION%.*}-$file || return 1 |
slaxemulator@8159 | 41 touch done.$file |
slaxemulator@8159 | 42 done <<EOT |
slaxemulator@8159 | 43 tar.u |
slaxemulator@8159 | 44 stat.u |
slaxemulator@8159 | 45 ris.u |
slaxemulator@8159 | 46 zmodules.u |
slaxemulator@8159 | 47 cmdline.u |
gokhlayeh@12135 | 48 diff.u |
pascal@14748 | 49 diet.u |
pascal@15779 | 50 losetup.u |
pascal@17271 | 51 fbvnc.u |
pascal@17414 | 52 cpio.u |
pascal@18429 | 53 shutdown.u |
pascal@19622 | 54 scriptreplay.u |
pascal@19850 | 55 mkfs_vfat.u |
pascal@20654 | 56 ash.u |
slaxemulator@8159 | 57 EOT |
slaxemulator@9279 | 58 cp $stuff/$PACKAGE-${VERSION%.*}.config .config |
pascal@8237 | 59 } |
pascal@8237 | 60 |
pankso@0 | 61 # Rules to configure and make the package. |
pankso@0 | 62 compile_rules() |
pankso@0 | 63 { |
pankso@12755 | 64 case "$ARCH" in |
pankso@16528 | 65 arm*) |
pankso@12755 | 66 echo "cook: CROSS_COMPILE=$CROSS_COMPILE" |
pankso@12926 | 67 apply_bb_patchs && |
pankso@12926 | 68 cp $stuff/arm/$PACKAGE.config .config |
pascal@21763 | 69 make oldconfig | sed 's|ERROR|error|' && |
pankso@12926 | 70 make && make install || return 1 |
pankso@12755 | 71 chmod 4755 $src/_install/bin/busybox ;; |
pankso@12755 | 72 x86_64) echo "TODO" ;; |
pankso@12755 | 73 i?86) |
pascal@19610 | 74 echo "=== Build busybox ===" |
pascal@20212 | 75 sed -i 's|uname -m|echo i486|' Makefile |
pankso@12926 | 76 apply_bb_patchs && |
pascal@21763 | 77 make oldconfig | sed 's|ERROR|error|' && |
pankso@12926 | 78 make && make install || return 1 |
pankso@12926 | 79 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \ |
pankso@12755 | 80 $src/_install/bin/busybox |
pascal@20029 | 81 mv busybox_unstripped.map busybox-glibc.map |
pascal@19268 | 82 mv docs/busybox.1 docs/busybox.base.1 |
pascal@11017 | 83 |
pankso@12755 | 84 # prepare busybox-pam package |
pascal@19610 | 85 echo "=== Build busybox-pam ===" |
pankso@12755 | 86 sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config |
pascal@21763 | 87 make oldconfig | sed 's|ERROR|error|' && make || return 1 |
pankso@12755 | 88 strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox |
pankso@12755 | 89 mv busybox busybox-pam |
pascal@20029 | 90 mv busybox_unstripped.map busybox-pam.map |
pascal@19268 | 91 mv docs/busybox.1 docs/busybox.pam.1 |
pascal@11017 | 92 |
pankso@12755 | 93 # prepare busybox-static package |
pascal@14748 | 94 if [ -x /usr/bin/uclibc-i486-gcc ]; then |
pascal@19610 | 95 echo "=== Build busybox-uclibc ===" |
pascal@14748 | 96 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config |
pascal@19610 | 97 sed -i 's/# CONFIG_ASH_INTERNAL_GLOB is not set/CONFIG_ASH_INTERNAL_GLOB=y/' .config |
pascal@21763 | 98 make oldconfig | sed 's|ERROR|error|' && make || return 1 |
pascal@14748 | 99 cp busybox busybox-static |
pascal@14748 | 100 mv busybox busybox-uclibc |
pascal@20029 | 101 mv busybox_unstripped.map busybox-uclibc.map |
pascal@19268 | 102 mv -f docs/busybox.1 docs/busybox.static.1 |
pascal@14748 | 103 fi |
pascal@14748 | 104 |
pascal@14748 | 105 if [ -x /usr/bin/musl-gcc ]; then |
pascal@19610 | 106 echo "=== Build busybox-musl ===" |
pascal@14748 | 107 # prepare busybox-musl package |
pascal@14748 | 108 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config |
pascal@15392 | 109 sed -i 's|uclibc-i486-||' .config |
pascal@21763 | 110 make oldconfig | sed 's|ERROR|error|' && |
pascal@21763 | 111 make CC=musl-gcc || return 1 |
pascal@14748 | 112 mv busybox busybox-musl |
pascal@20029 | 113 mv busybox_unstripped.map busybox-musl.map |
pascal@19268 | 114 mv -f docs/busybox.1 docs/busybox.static.1 |
pascal@14748 | 115 fi |
pascal@14748 | 116 |
pascal@14748 | 117 if [ -x /usr/lib/diet/bin/diet ]; then |
pascal@19610 | 118 echo "=== Build busybox-diet ===" |
pascal@14748 | 119 # prepare busybox-diet package |
pascal@14748 | 120 cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config |
pascal@14748 | 121 sed -i 's|uclibc-i486-||;s|CFLAGS="|&-D_BSD_SOURCE |;s|LDFLAGS="|&-Wl,--allow-multiple-definition |;s|LDLIBS="|&compat rpc |' .config |
pascal@21763 | 122 make oldconfig | sed 's|ERROR|error|' && |
pascal@21763 | 123 make CC="/usr/lib/diet/bin/diet gcc" || return 1 |
pascal@14748 | 124 mv busybox busybox-diet |
pascal@20029 | 125 mv busybox_unstripped.map busybox-diet.map |
pascal@19268 | 126 mv -f docs/busybox.1 docs/busybox.static.1 |
pascal@14748 | 127 fi |
pascal@11017 | 128 |
pankso@12755 | 129 # prepare ssfs-busybox package |
pascal@19610 | 130 echo "=== Build busybox-ssfs ===" |
pankso@12755 | 131 rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs |
pankso@12755 | 132 mkdir -p $rootfs/etc |
pankso@12755 | 133 cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config |
pascal@21763 | 134 make oldconfig | sed 's|ERROR|error|' && make busybox && |
pankso@12755 | 135 make CONFIG_PREFIX=$rootfs install || return 1 |
pascal@20029 | 136 mv busybox_unstripped.map busybox-ssfs.map |
pankso@12755 | 137 cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf |
pankso@12755 | 138 chown -R 0.0 $rootfs/etc |
pankso@12755 | 139 chmod 0600 $rootfs/etc/busybox.conf |
al@19159 | 140 chmod 4755 $rootfs/bin/busybox |
al@19159 | 141 |
al@19159 | 142 # Compile translations |
pascal@19610 | 143 echo "=== Build translations ===" |
al@19159 | 144 make -C $stuff/po install |
pascal@19268 | 145 cp docs/busybox.base.1 docs/busybox.1 |
al@19159 | 146 |
al@19159 | 147 ;; |
al@19159 | 148 |
pankso@12755 | 149 esac |
pankso@12755 | 150 } |
pankso@12755 | 151 |
pankso@12755 | 152 # Cross compilation check. |
pankso@12755 | 153 testsuite() |
pankso@12755 | 154 { |
pankso@12755 | 155 readelf -h $src/_install/bin/busybox |
pankso@0 | 156 } |
pankso@0 | 157 |
pascal@19793 | 158 # Keep e2fsprogs kmod & util-linux-mount files |
pascal@19788 | 159 REMOVED_SYMLINKS="/bin/mount /bin/mountpoint /bin/umount /sbin/depmod \ |
pascal@19793 | 160 /sbin/insmod /sbin/modinfo /sbin/modprobe /sbin/rmmod /bin/lsattr /bin/chattr \ |
pascal@19793 | 161 /sbin/tune2fs" |
pascal@19788 | 162 |
pankso@0 | 163 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@0 | 164 genpkg_rules() |
pankso@0 | 165 { |
pascal@19282 | 166 mkdir -p $install/usr/share/man/man1 $install/usr/share/doc/busybox |
pascal@14872 | 167 cp -a $src/_install/* $fs |
pascal@19350 | 168 cp -a $src/docs/busybox.base.1 $install/usr/share/man/man1/busybox.1 |
pascal@19282 | 169 cp -a $src/docs/*.txt $install/usr/share/doc/busybox |
pascal@19282 | 170 cp -a $src/docs/*.htm* $install/usr/share/doc/busybox |
pascal@19282 | 171 cp -a $src/docs/cgi $install/usr/share/doc/busybox |
pascal@18182 | 172 [ -e $fs/sbin/ip ] && ln -s busybox $fs/bin/ip |
pascal@14872 | 173 rm -f $fs/bin/bbconfig $fs/usr/bin/ar |
pascal@18619 | 174 mkdir -p $fs/etc/init.d $fs/var/spool/cron/crontabs $fs/var/spool/lpd \ |
pascal@18619 | 175 $fs/var/lib/misc |
pascal@21860 | 176 cp $stuff/command_not_found $fs/bin |
pankso@12755 | 177 |
pascal@14872 | 178 # Busybox config files. |
pascal@14872 | 179 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf \ |
pascal@14872 | 180 syslog.conf zcip.script |
pascal@14872 | 181 do |
pankso@10817 | 182 cp $stuff/$f $fs/etc |
pascal@14872 | 183 done |
pascal@14872 | 184 chown -R 0.0 $fs/etc |
pascal@14872 | 185 chmod 600 $fs/etc/busybox.conf |
pascal@14872 | 186 touch $fs/etc/resolv.conf |
pankso@10817 | 187 |
pascal@14872 | 188 # Daemon scripts. |
pascal@14872 | 189 cp $stuff/daemon $fs/etc/init.d |
pascal@14872 | 190 DAEMON="crond dnsd ftpd httpd inetd lpd klogd ntpd syslogd telnetd tftpd udhcpd zcip" |
pascal@14872 | 191 for i in $DAEMON; do |
pankso@12755 | 192 grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config && |
pankso@10817 | 193 ln -s daemon $fs/etc/init.d/$i |
pascal@14872 | 194 done |
pascal@14872 | 195 mkdir -p $fs/etc/modprobe.d |
pankso@12755 | 196 |
pascal@14872 | 197 # Udhcpc stuff. |
pascal@14872 | 198 mkdir -p $fs/usr/share/udhcpc |
pascal@14872 | 199 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script |
pascal@14872 | 200 chmod +x $fs/usr/share/udhcpc/default.script |
pankso@10817 | 201 |
pascal@14872 | 202 # Httpd stuff. |
pascal@14872 | 203 ln -s /usr/lib/slitaz/httphelper.sh $fs/usr/bin/httpd_helper.sh |
pascal@14872 | 204 cp -a $stuff/www $fs/var |
pascal@18006 | 205 |
pascal@18006 | 206 # Update copyright year |
pascal@18007 | 207 grep -rl 'copy; 2' $fs/var/www | xargs \ |
pascal@18006 | 208 sed -i "s/copy; [0-9]*/copy; $(date +%Y)/" |
pascal@18790 | 209 |
pascal@19785 | 210 # Remove kmod & util-linux-mount links |
pascal@19788 | 211 for link in $REMOVED_SYMLINKS; do |
pascal@18790 | 212 rm -f $fs$link |
pascal@19789 | 213 done |
pankso@0 | 214 } |
pankso@557 | 215 |
pankso@12755 | 216 # GNU utils stuff. |
pankso@557 | 217 pre_install() |
pankso@557 | 218 { |
pascal@5015 | 219 local i |
pascal@18846 | 220 [ -s $1/etc/resolv.conf ] && |
pascal@18816 | 221 cp -a $1/etc/resolv.conf $1/etc/resolv.conf-busybox-install |
pascal@5015 | 222 answer="" |
pascal@18730 | 223 for i in $(cat "$1$INSTALLED/$PACKAGE/files.list"); do |
pascal@18730 | 224 [ -f "$1$i" ] || continue |
pascal@5874 | 225 case "$i" in |
pankso@12755 | 226 /bin/busybox) continue ;; |
pankso@12755 | 227 *bin/*) ;; |
pankso@12755 | 228 *) continue ;; |
pascal@5874 | 229 esac |
pascal@5015 | 230 if [ -z "$answer" ]; then |
pascal@20319 | 231 echo |
pascal@5015 | 232 echo -n "Keep installed GNU utilities ? " |
pascal@5711 | 233 read -t 30 answer # by default: keep |
pascal@5015 | 234 case "$answer" in |
pascal@5711 | 235 n*|N*) break;; |
pascal@5975 | 236 *) answer="Y";; |
pascal@5015 | 237 esac |
pascal@5015 | 238 fi |
pascal@18730 | 239 cp -a "$1$i" "$1$i-busybox-install" |
pascal@5924 | 240 done |
pankso@557 | 241 } |
pascal@983 | 242 |
pascal@983 | 243 post_install() |
pascal@983 | 244 { |
pascal@5015 | 245 local i |
pascal@18816 | 246 [ -f $1/etc/resolv.conf-busybox-install ] && |
pascal@18816 | 247 mv -f $1/etc/resolv.conf-busybox-install $1/etc/resolv.conf |
pascal@5015 | 248 while read i ; do |
pascal@18730 | 249 [ -f "$1$i-busybox-install" ] || continue |
pascal@18730 | 250 mv "$1$i-busybox-install" "$1$i" |
pascal@18730 | 251 done < "$1$INSTALLED/$PACKAGE/files.list" |
pascal@18730 | 252 chmod 4755 "$1/bin/busybox" |
pankso@10818 | 253 |
pascal@18816 | 254 touch $1/etc/daemons.conf |
pankso@10818 | 255 # /etc/daemons.conf (tftp + dnsd + httpd may not be present) |
pascal@18816 | 256 if ! grep -q ^DNSD_OPTIONS $1/etc/daemons.conf; then |
pascal@18816 | 257 echo '# Domain name server options.' >> $1/etc/daemons.conf |
pascal@18816 | 258 echo 'DNSD_OPTIONS="-d"' >> $1/etc/daemons.conf |
pascal@18816 | 259 echo '' >> $1/etc/daemons.conf |
pankso@10818 | 260 fi |
pascal@18816 | 261 if ! grep -q ^TFTPD_OPTIONS $1/etc/daemons.conf; then |
pascal@18816 | 262 echo '# Tftp daemon options.' >> $1/etc/daemons.conf |
pascal@18816 | 263 echo 'TFTPD_OPTIONS="-r /boot"' >> $1/etc/daemons.conf |
pascal@18816 | 264 echo '' >> $1/etc/daemons.conf |
pankso@10818 | 265 fi |
pascal@18816 | 266 sed -i "s/copy; 20../copy; $(date +%Y)/" $1/var/www/httpd/404.html |
pascal@19788 | 267 for link in $REMOVED_SYMLINKS; do |
pascal@19788 | 268 [ -e $1$link ] || ln -s /bin/busybox $1$link |
pascal@19788 | 269 done |
pascal@5686 | 270 } |
pascal@8932 | 271 |
pascal@8932 | 272 pre_remove() |
pascal@8932 | 273 { |
pascal@8932 | 274 # We can not remove this package ! |
pascal@8932 | 275 exit 1 |
pascal@8932 | 276 } |