wok-next diff busybox/receipt @ rev 19972

Up copyq (3.1.1), qedit (2.8.1)
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Tue Oct 17 19:29:54 2017 +0200 (2017-10-17)
parents d6dd7b81a69c
children 0e7893ac206d
line diff
     1.1 --- a/busybox/receipt	Thu Feb 09 11:25:50 2017 +0100
     1.2 +++ b/busybox/receipt	Tue Oct 17 19:29:54 2017 +0200
     1.3 @@ -1,9 +1,9 @@
     1.4 -# SliTaz package receipt.
     1.5 +# SliTaz package receipt v2.
     1.6  
     1.7  PACKAGE="busybox"
     1.8 -VERSION="1.26.2"
     1.9 +VERSION="1.27.2"
    1.10  CATEGORY="base-system"
    1.11 -SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities."
    1.12 +SHORT_DESC="Tiny versions of UNIX utilities"
    1.13  MAINTAINER="pascal.bellard@slitaz.org"
    1.14  LICENSE="GPL2"
    1.15  WEB_SITE="https://busybox.net/"
    1.16 @@ -12,53 +12,16 @@
    1.17  TARBALL="$PACKAGE-$VERSION.tar.bz2"
    1.18  WGET_URL="${WEB_SITE}downloads/$TARBALL"
    1.19  
    1.20 -DEPENDS="slitaz-base-files glibc-base ncurses"
    1.21 -BUILD_DEPENDS="bzip2 gettext perl pam pam-dev musl-libc-dev dietlibc"
    1.22 -
    1.23 -SPLIT="busybox-boot busybox-pam busybox-static ssfs-busybox busybox-slish"
    1.24 -
    1.25 -CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf \
    1.26 -/etc/resolv.conf /etc/httpd.conf"
    1.27 -
    1.28 -# Handle cross compilation
    1.29 -case "$ARCH" in
    1.30 -	arm*) BUILD_DEPENDS="bzip2" ;;
    1.31 -esac
    1.32 -
    1.33 -# Busybox patches
    1.34 -apply_bb_patches()
    1.35 -{
    1.36 -	while read file; do
    1.37 -		[ -f done.$file ] && continue
    1.38 -		echo "Apply $file..."
    1.39 -		patch -p1 < $stuff/${VERSION%.*}/$file || return 1
    1.40 -		touch done.$file
    1.41 -	done <<EOT
    1.42 -tar.u
    1.43 -stat.u
    1.44 -ris.u
    1.45 -zmodules.u
    1.46 -cmdline.u
    1.47 -diff.u
    1.48 -diet.u
    1.49 -losetup.u
    1.50 -fbvnc.u
    1.51 -cpio.u
    1.52 -ftpd.u
    1.53 -shutdown.u
    1.54 -scriptreplay.u
    1.55 -bug9471.u
    1.56 -EOT
    1.57 -	cp $stuff/${VERSION%.*}/.config .
    1.58 -}
    1.59 +BUILD_DEPENDS_arm="bzip2"
    1.60 +BUILD_DEPENDS="patch bzip2 gettext perl pam-dev" # uclibc-cross-compiler-i486 musl-libc-dev dietlibc
    1.61 +#SPLIT="busybox-boot busybox-pam busybox-static ssfs-busybox"
    1.62 +SPLIT="busybox-pam ssfs-busybox"
    1.63  
    1.64  # Rules to configure and make the package.
    1.65 -compile_rules()
    1.66 -{
    1.67 +compile_rules() {
    1.68  	case "$ARCH" in
    1.69  		arm*)
    1.70  			echo "cook: CROSS_COMPILE=$CROSS_COMPILE"
    1.71 -			apply_bb_patches &&
    1.72  			cp $stuff/arm/$PACKAGE.config .config
    1.73  			make oldconfig &&
    1.74  			make && make install || return 1
    1.75 @@ -69,58 +32,67 @@
    1.76  			;;
    1.77  		i?86)
    1.78  			echo 'Making busybox'
    1.79 -			apply_bb_patches &&
    1.80 +			cp $stuff/.config $src &&
    1.81  			make oldconfig &&
    1.82 -			make && make install || return 1
    1.83 +			make &&
    1.84 +			make install || return 1
    1.85  			strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr \
    1.86  				$src/_install/bin/busybox
    1.87  			mv docs/busybox.1 docs/busybox.base.1
    1.88  
    1.89  			# prepare busybox-pam package
    1.90 -			echo "Making busybox-pam"
    1.91 -			sed -i 's|# CONFIG_PAM is not set|CONFIG_PAM=y|' .config
    1.92 -			make oldconfig && make || return 1
    1.93 +			echo 'Making busybox-pam'
    1.94 +			sed -i 's|# CONFIG_PAM is not set|CONFIG_PAM=y|' $src/.config
    1.95 +			make oldconfig &&
    1.96 +			make || return 1
    1.97  			strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox
    1.98  			mv busybox busybox-pam
    1.99  			mv docs/busybox.1 docs/busybox.pam.1
   1.100  
   1.101  			# prepare busybox-static package
   1.102  			if [ -n "$(/usr/bin/uclibc-i486-gcc --version 2>/dev/null)" ]; then
   1.103 -				echo "Making busybox-uclibc"
   1.104 -				cp $stuff/${VERSION%.*}/.config-static .config
   1.105 -				sed -i 's|# CONFIG_ASH_INTERNAL_GLOB is not set|CONFIG_ASH_INTERNAL_GLOB=y|' .config
   1.106 -				make oldconfig && make || return 1
   1.107 +				echo 'Making busybox-uclibc'
   1.108 +				cp $stuff/.config-static $src/.config
   1.109 +				sed -i 's|# CONFIG_ASH_INTERNAL_GLOB is not set|CONFIG_ASH_INTERNAL_GLOB=y|' $src/.config
   1.110 +				make oldconfig &&
   1.111 +				make || return 1
   1.112  				cp busybox busybox-static
   1.113  				mv busybox busybox-uclibc
   1.114  				mv -f docs/busybox.1 docs/busybox.static.1
   1.115  			fi
   1.116  
   1.117 -			if [ -x /usr/bin/musl-gcc ]; then
   1.118 -				echo "Making busybox-musl"
   1.119 +			if [ -x '/usr/bin/musl-gcc' ]; then
   1.120 +				echo 'Making busybox-musl'
   1.121  				# prepare busybox-musl package
   1.122 -				cp $stuff/${VERSION%.*}/.config-static .config
   1.123 -				sed -i 's|uclibc-i486-||' .config
   1.124 -				make oldconfig && make CC=musl-gcc || return 1
   1.125 +				cp $stuff/.config-static $src/.config
   1.126 +				sed -i 's|uclibc-i486-||' $src/.config
   1.127 +				make oldconfig &&
   1.128 +				make CC=musl-gcc || return 1
   1.129  				mv busybox busybox-musl
   1.130  				mv -f docs/busybox.1 docs/busybox.static.1
   1.131  			fi
   1.132  
   1.133 -			if [ -x /usr/lib/diet/bin/diet ]; then
   1.134 -				echo "Making busybox-diet"
   1.135 +			if [ -x '/usr/lib/diet/bin/diet' ]; then
   1.136 +				echo 'Making busybox-diet'
   1.137  				# prepare busybox-diet package
   1.138 -				cp $stuff/${VERSION%.*}/.config-static .config
   1.139 -				sed -i 's|uclibc-i486-||;s|CFLAGS="|&-D_BSD_SOURCE |;s|LDFLAGS="|&-Wl,--allow-multiple-definition |;s|LDLIBS="|&compat rpc |' .config
   1.140 -				make oldconfig && make CC="/usr/lib/diet/bin/diet gcc" || return 1
   1.141 +				cp $stuff/.config-static $src/.config
   1.142 +				sed -i 's|uclibc-i486-||;
   1.143 +						s|CFLAGS="|&-D_BSD_SOURCE |;
   1.144 +						s|LDFLAGS="|&-Wl,--allow-multiple-definition |;
   1.145 +						s|LDLIBS="|&compat rpc |' $src/.config
   1.146 +				make oldconfig &&
   1.147 +				make CC="/usr/lib/diet/bin/diet gcc" || return 1
   1.148  				mv busybox busybox-diet
   1.149  				mv -f docs/busybox.1 docs/busybox.static.1
   1.150  			fi
   1.151  
   1.152  			# prepare ssfs-busybox package
   1.153 -			echo "Making busybox-ssfs"
   1.154 -			rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs
   1.155 +			echo 'Making busybox-ssfs'
   1.156 +			rootfs="$src/ssfs-busybox/usr/share/ssfs/rootfs"
   1.157  			mkdir -p $rootfs/etc
   1.158 -			cp $stuff/${VERSION%.*}/.config-ssfs .config
   1.159 -			make oldconfig && make busybox &&
   1.160 +			cp $stuff/.config-ssfs $src/.config
   1.161 +			make oldconfig &&
   1.162 +			make busybox &&
   1.163  			make CONFIG_PREFIX=$rootfs install || return 1
   1.164  			cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf
   1.165  			chown -R 0.0 $rootfs/etc
   1.166 @@ -135,69 +107,147 @@
   1.167  	esac
   1.168  
   1.169  	cook_pick_manpages $src/docs/busybox.1
   1.170 -
   1.171 -	mkdir -p $install/usr/share/doc/busybox
   1.172 -	cp -a $src/docs/*.txt  $install/usr/share/doc/busybox
   1.173 -	cp -a $src/docs/*.htm* $install/usr/share/doc/busybox
   1.174 -	cp -a $src/docs/cgi    $install/usr/share/doc/busybox
   1.175 +	cook_pick_docs \
   1.176 +		$src/docs/*.txt \
   1.177 +		$src/docs/*.htm* \
   1.178 +		$src/docs/cgi
   1.179  }
   1.180  
   1.181  # Cross compilation check.
   1.182 -testsuite()
   1.183 -{
   1.184 +testsuite() {
   1.185  	readelf -h $src/_install/bin/busybox
   1.186  }
   1.187  
   1.188  # Rules to gen a SliTaz package suitable for Tazpkg.
   1.189 -genpkg_rules()
   1.190 -{
   1.191 -	cp -a $src/_install/* $fs
   1.192 -	[ -e $fs/sbin/ip ] && ln -s busybox $fs/bin/ip
   1.193 -	rm -f $fs/bin/bbconfig $fs/usr/bin/ar
   1.194 -	mkdir -p $fs/etc/init.d $fs/var/spool/cron/crontabs $fs/var/spool/lpd \
   1.195 -		 $fs/var/lib/misc
   1.196 +genpkg_rules() {
   1.197 +	case $PACKAGE in
   1.198 +		busybox)
   1.199 +			DEPENDS="slitaz-base-files glibc-base ncurses"
   1.200 +			CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf \
   1.201 +			/etc/resolv.conf /etc/httpd.conf"
   1.202 +			cp -a $src/_install/* $fs
   1.203 +			[ -e $fs/sbin/ip ] && ln -s busybox $fs/bin/ip
   1.204 +			rm -f $fs/bin/bbconfig $fs/usr/bin/ar
   1.205 +			mkdir -p \
   1.206 +				$fs/etc/init.d \
   1.207 +				$fs/var/spool/cron/crontabs \
   1.208 +				$fs/var/spool/lpd \
   1.209 +				$fs/var/lib/misc \
   1.210 +				$fs/etc/modprobe.d \
   1.211 +				$fs/usr/share/udhcpc
   1.212  
   1.213 -	# Busybox config files.
   1.214 -	for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf \
   1.215 -		syslog.conf zcip.script
   1.216 -	do
   1.217 -		cp $stuff/$f $fs/etc
   1.218 -	done
   1.219 -	chown -R 0.0 $fs/etc
   1.220 -	chmod 600 $fs/etc/busybox.conf
   1.221 -	touch $fs/etc/resolv.conf
   1.222 +			# Busybox config files
   1.223 +			cp -a $stuff/etc/* $fs/etc
   1.224 +			chown -R 0.0 $fs/etc
   1.225 +			chmod 600 $fs/etc/busybox.conf
   1.226  
   1.227 -	# Daemon scripts.
   1.228 -	cp $stuff/daemon $fs/etc/init.d
   1.229 -	for i in crond dnsd ftpd httpd inetd lpd klogd ntpd syslogd telnetd tftpd \
   1.230 -		udhcpd zcip; do
   1.231 -		grep -qi config_$i=y $stuff/${VERSION%.*}/.config &&
   1.232 -		ln -s daemon $fs/etc/init.d/$i
   1.233 -	done
   1.234 -	rm $fs/linuxrc
   1.235 -	mkdir -p $fs/etc/modprobe.d
   1.236 +			# Daemon scripts
   1.237 +			cp $stuff/daemon $fs/etc/init.d
   1.238 +			for i in crond dnsd ftpd httpd inetd lpd klogd ntpd syslogd \
   1.239 +			         telnetd tftpd udhcpd zcip; do
   1.240 +				grep -qi "config_$i=y" $stuff/.config &&
   1.241 +				ln -s daemon $fs/etc/init.d/$i
   1.242 +			done
   1.243 +			rm $fs/linuxrc
   1.244  
   1.245 -	# Udhcpc stuff.
   1.246 -	mkdir -p $fs/usr/share/udhcpc
   1.247 -	cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
   1.248 -	chmod +x $fs/usr/share/udhcpc/default.script
   1.249 +			# Udhcpc stuff
   1.250 +			cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script
   1.251 +			chmod +x $fs/usr/share/udhcpc/default.script
   1.252  
   1.253 -	# Httpd stuff.
   1.254 -	ln -s /usr/lib/slitaz/httphelper.sh $fs/usr/bin/httpd_helper.sh
   1.255 -	cp -a $stuff/www $fs/var
   1.256 +			# Httpd stuff (httphelper.sh found in slitaz-base-files package)
   1.257 +			ln -s /usr/lib/slitaz/httphelper.sh $fs/usr/bin/httpd_helper.sh
   1.258 +			cp -r $stuff/www $fs/var
   1.259  
   1.260 -	# Update copyright year
   1.261 -	grep -rl 'YEAR' $fs/var/www | xargs sed -i "s|YEAR|$(date +%Y)|"
   1.262 -	:
   1.263 +			# Update copyright year
   1.264 +			grep -rl 'YEAR' $fs/var/www | xargs sed -i "s|YEAR|$(date +%Y)|"
   1.265 +			:
   1.266 +			;;
   1.267 +		busybox-boot)
   1.268 +			jslinux=false
   1.269 +			CAT="base-system|for core-5in1/boot flavor"
   1.270 +			DEPENDS="linux syslinux"
   1.271 +			mkdir -p \
   1.272 +				$fs/usr/share/boot/bin \
   1.273 +				$fs/usr/share/boot/dev
   1.274 +
   1.275 +			CHOICE='static'
   1.276 +			for i in uclibc musl diet; do
   1.277 +				[ -x "$src/busybox-$i" ] || continue
   1.278 +				[ -x "$src/busybox-$CHOICE" ] &&
   1.279 +					[ $(stat -c %s $src/busybox-$i) -ge \
   1.280 +					  $(stat -c %s $src/busybox-$CHOICE) ] &&
   1.281 +					continue
   1.282 +				CHOICE="$i"
   1.283 +			done
   1.284 +			cp -a $src/busybox-$CHOICE $fs/usr/share/boot/bin/busybox
   1.285 +
   1.286 +			chmod   4755 $fs/usr/share/boot/bin/busybox
   1.287 +			mknod -m 660 $fs/usr/share/boot/dev/console c 5 1
   1.288 +			mknod -m 771 $fs/usr/share/boot/dev/null    c 1 3
   1.289 +			mknod -m 660 $fs/usr/share/boot/dev/tty     c 5 0
   1.290 +			mknod -m 660 $fs/usr/share/boot/dev/tty1    c 4 1
   1.291 +			if $jslinux; then
   1.292 +				mknod -m 644 $fs/usr/share/boot/dev/clipboard c 10 231
   1.293 +				mknod -m 660 $fs/usr/share/boot/dev/ttyS0     c  4  64
   1.294 +			fi
   1.295 +
   1.296 +			cp $stuff/init $fs/usr/share/boot/init
   1.297 +			$jslinux || sed -i '/jslinux/d' $fs/usr/share/boot/init
   1.298 +			chmod +x $fs/usr/share/boot/init
   1.299 +
   1.300 +			( cd $fs/usr/share/boot; find bin dev init | cpio -o -H newc > initrd )
   1.301 +			rm -rf \
   1.302 +				$fs/usr/share/boot/bin \
   1.303 +				$fs/usr/share/boot/dev \
   1.304 +				$fs/usr/share/boot/init
   1.305 +			;;
   1.306 +		busybox-pam)
   1.307 +			CAT="base-system|with PAM support"
   1.308 +			DEPENDS="busybox pam"
   1.309 +			CONFIG_FILES="/etc/pam.d"
   1.310 +			PROVIDE="busybox:pam"
   1.311 +			mkdir -p \
   1.312 +				$fs/bin/ \
   1.313 +				$fs/etc/pam.d/
   1.314 +			cp -a $src/busybox-pam $fs/bin/busybox
   1.315 +			cp $stuff/login $fs/etc/pam.d/
   1.316 +			;;
   1.317 +		busybox-static)
   1.318 +			CAT="base-system|static version"
   1.319 +			DEPENDS=" "
   1.320 +			mkdir -p $fs/usr/share/boot
   1.321 +
   1.322 +			CHOICE='static'
   1.323 +			for i in uclibc musl diet; do
   1.324 +				[ -x "$src/busybox-$i" ] || continue
   1.325 +				[ -x "$src/busybox-$CHOICE" ] &&
   1.326 +					[ $(stat -c %s $src/busybox-$i) -ge \
   1.327 +					  $(stat -c %s $src/busybox-$CHOICE) ] &&
   1.328 +					continue
   1.329 +				CHOICE="$i"
   1.330 +			done
   1.331 +			cp -a $src/busybox-$CHOICE $fs/usr/share/boot/busybox-static
   1.332 +			;;
   1.333 +		ssfs-busybox)
   1.334 +			# NOTE: We install files in Ssfs data directory to always have ready
   1.335 +			# to create chroot on the server and provide an easy way to update
   1.336 +			# the vdisk. We don't do a static build, we need some shared lib in
   1.337 +			# the chroot anyway. Busybox is configured to not use /usr and with
   1.338 +			# a minimal set of applets.
   1.339 +
   1.340 +			CAT="base-system|for Ssfs virtual disk minimal chroot"
   1.341 +			rootfs=$fs/usr/share/ssfs/rootfs
   1.342 +			cp -a $src/ssfs-busybox/* $fs
   1.343 +			;;
   1.344 +	esac
   1.345  }
   1.346  
   1.347  # GNU utils stuff.
   1.348 -pre_install()
   1.349 -{
   1.350 +pre_install_busybox() {
   1.351  	local i
   1.352  	[ -s $1/etc/resolv.conf ] &&
   1.353  	cp -a $1/etc/resolv.conf $1/etc/resolv.conf-busybox-install
   1.354 -	answer=""
   1.355 +	answer=''
   1.356  	for i in $(sed '/busybox$/d; /bin\//!d' "$1$INSTALLED/$PACKAGE/files.list"); do
   1.357  		[ -f "$1$i" ] || continue
   1.358  		if [ -z "$answer" ]; then
   1.359 @@ -209,8 +259,7 @@
   1.360  	done
   1.361  }
   1.362  
   1.363 -post_install()
   1.364 -{
   1.365 +post_install_busybox() {
   1.366  	local i
   1.367  	[ -f $1/etc/resolv.conf-busybox-install ] &&
   1.368  	mv -f $1/etc/resolv.conf-busybox-install $1/etc/resolv.conf
   1.369 @@ -236,11 +285,28 @@
   1.370  
   1.371  EOF
   1.372  	fi
   1.373 -	sed -i "s/copy; 20../copy; $(date +%Y)/" $1/var/www/httpd/404.html
   1.374  }
   1.375  
   1.376 -pre_remove()
   1.377 -{
   1.378 -	# We can not remove this package!
   1.379 +# We can't remove this package!
   1.380 +pre_remove_busybox() {
   1.381  	exit 1
   1.382  }
   1.383 +
   1.384 +pre_remove_busybox_pam() {
   1.385 +	# We install non-pam busybox to replace busybox-pam.
   1.386 +	tazpkg get-install busybox --forced
   1.387 +
   1.388 +	# We remove /bin/busybox from the file.list of busybox-pam.
   1.389 +	# This way, the non-pam busybox we just installed will not be
   1.390 +	# removed.
   1.391 +	sed '/\/bin\/busybox/d' \
   1.392 +		-i /var/lib/tazpkg/installed/busybox-pam/files.list
   1.393 +}
   1.394 +
   1.395 +post_install_busybox_pam() {
   1.396 +	chmod 4755 "$1/bin/busybox"
   1.397 +}
   1.398 +
   1.399 +post_install_busybox_static() {
   1.400 +	chmod 4755 "$1/usr/share/boot/busybox-static"
   1.401 +}