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

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