### this file is sourced not run
PKGVER=4.4.0
PKGBUILD=1
PKGARCH=noarch

PYTHON_VER=3.11

# source: BLFS 11.3
TARBALL=SCons-$PKGVER.tar.gz
MD5SUM=056b141b420583e8faef8b1c64bc43cf
SRC_URL=http://downloads.sourceforge.net/scons/$TARBALL
BUNDLE=

SLACKREQ=python3
SLACKDESC="python3-scons: python3-scons $PKGVER (SCONS build system)  
python3-scons:  
python3-scons: SCons is a tool for building software (and other files) implemented in 
python3-scons: Python. It is similar to the ever popular Make.  
python3-scons: 
python3-scons: 
python3-scons: 
python3-scons: 
python3-scons: 
python3-scons: 
python3-scons:
"

### 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
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/SCons* &&

	# use python3
	sed -i 's/env python/&3/' SCons/Utilities/*.py &&

	python3 setup.py install --prefix=/usr \
							--optimize=1  &&

	cp -v /usr/lib/python$PYTHON_VER/site-packages/SCons-$PKGVER-py$PYTHON_VER.egg/*.1 \
      /usr/share/man/man1 &&
      
	pkg_build_slackdesc &&
	scons --version # run it for the first time so its byte code gets generated
}


