### this file is sourced not run
PKGVER=1.23.2
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=busybox-$PKGVER.tar.bz2
MD5SUM=7925683d7dd105aabe9b6b618d48cc73
SRC_URL=http://busybox.net/downloads/$TARBALL
#SRC_URL=http://distro.ibiblio.org/fatdog/source/700/$TARBALL
BUNDLE=

SLACKREQ=
SLACKDESC="busybox: busybox $PKGVER (All-in-one utilities)  
busybox:  
busybox: BusyBox combines tiny versions of many common UNIX utilities into a 
busybox: single small executable. It provides replacements for most of the 
busybox: utilities you usually find in GNU fileutils, shellutils, etc. The 
busybox: utilities in BusyBox generally have fewer options than their 
busybox: full-featured GNU cousins; however, the options that are included 
busybox: provide the expected functionality and behave very much like their 
busybox: GNU counterparts. BusyBox provides a fairly complete environment for 
busybox: any small or embedded system.  
busybox:
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	
	# patches and default config
	cd tmp/busybox* &&
	patch -Np1 -i $CHROOT_DIR/tmp/pkg/busybox-1.22-20130821-guess_fstype-applet.patch &&
	cp $CHROOT_DIR/tmp/pkg/bb-config-fatdog-1.23.1 .config
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/busybox*
	make oldconfig && # make defconfig
	make $MAKEFLAGS &&
	
	# install binary and udhcpc script; note: NO SYMLINK CREATED
	cp busybox /bin &&
	cp docs/busybox.1 /usr/share/man/man1 &&
	cp docs/BusyBox.txt /usr/share/doc &&
	mkdir -pv /usr/share/udhcpc &&
	cp -v examples/udhcp/simple.script /usr/share/udhcpc/default.script &&	
	
	# samples
	cp -v examples/udhcp/udhcpd.conf /etc &&
	cp -v examples/inetd.conf /etc &&
	cp -v examples/mdev_fat.conf /etc &&
	cp -v examples/mdev.conf.change_blockdev.sh	/etc &&
	#sh &&
	
	# applet list for further symlinking during SFS building later
	./busybox --list-full > /bin/busybox-applet-list &&
	pkg_build_slackdesc
}


