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

TARBALL=make-$PKGVER.tar.gz
MD5SUM=d7575a26a94ee8427130e9db23cdaa78
BUNDLE=fatdog-base-11.3.tar
SRC_URL=http://distro.ibiblio.org/fatdog/source/900/$BUNDLE

SLACKREQ=
SLACKDESC="make: make $PKGVER (Build system)  
make:  
make: Utility that automatically builds executable programs and libraries from 
make: source code by reading files called makefiles which specify how to 
make: derive the target program.  
make: 
make: 
make: 
make: 
make: 
make:
"


### override download for LFS sources bundle
# $1-src-dir $2-tarball 
pkg_download() {
	echo downloading $BUNDLE for $TARBALL
	wget -P $1 $SRC_URL
	tar -xf $1/$BUNDLE --strip-components=1 -C $1 
	rm $1/$BUNDLE
}

### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/make* &&
	
	# LFS 8.2 patch for glibc 2.27 onwards (this is for make 4.2.1)
	#sed -i '211,217 d; 219,229 d; 232 d' glob/glob.c

	# LFS 11.3 - for make 4.4.
	sed -e '/ifdef SIGPIPE/,+2 d' \
		-e '/undef  FATAL_SIG/i FATAL_SIG (SIGPIPE);' \
		-i src/main.c &&

	pkg_build_autoconf && pkg_build_slackdesc
}
