### this file is sourced not run
PKGVER=3.0.1
PKGBUILD=1
PKGARCH=i686

# source: post BLFS 7.8 updated to 3.0.1 (3.0.0 from BLFS 8.2 is **BUGGY**)
TARBALL=scons-$PKGVER.tar.gz
MD5SUM=b6a292e251b34b82c203b56cfa3968b3
SRC_URL=http://downloads.sourceforge.net/scons/$TARBALL
BUNDLE=

SLACKREQ=python32
SLACKDESC="scons32: scons32 $PKGVER (SCONS build system)  
scons32:  
scons32: SCons is a tool for building software (and other files) implemented in 
scons32: Python. It is similar to the ever popular Make.  
scons32: 
scons32: This contains 32-bit version of the library.
scons32: 
scons32: 
scons32: 
scons32: 
scons32:
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/scons* &&
	tar -xf ../pkg/scons_3.0.1-1.debian.tar.xz &&
	for p in $(cat debian/patches/series); do
		case $p in \#*) continue ;;
		*) patch -Np1 -i debian/patches/$p || return 1 ;;
		esac
	done &&
	true
}

### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share
}

### build
pkg_build() {
	cd /tmp/scons* &&
	python setup.py build --build-base=build32 &&
	python setup.py install \
		--prefix=/usr  \
		--standard-lib \
		--prefix=/usr  \
		--install-data=/usr/share \
		--install-purelib=/usr/$LIBDIR/python2.7/site-packages &&
	pkg_build_slackdesc &&
	scons --version # run it for the first time so its byte code gets generated
}


