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

# source: CLFS 3.0 updated to 5.31 with debian and step patches then on to LFS 11.3
TARBALL=file-$PKGVER.tar.gz
MD5SUM=a60d586d49d015d842b9294864a89c7a
BUNDLE=fatdog-base-11.3.tar
SRC_URL=http://distro.ibiblio.org/fatdog/source/900/$BUNDLE

SLACKREQ=
SLACKDESC="file: file $PKGVER (Determine file types)  
file:  
file: The File package contains a utility for determining the type of a given 
file: file or files.  
file: 
file: http://darwinsys.com/file/
file: 
file: 
file: 
file: 
file:
"

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

### prepare
pkg_prepare() {
	local patches
	
	pkg_prepare_default &&
	cd tmp/file* &&

	# debian patches
	patches=../pkg/patch/Debian &&
	while read p; do
		case $p in ''|\#*|local.extra-magic*|local.manpage-seccomp-is-disabled*) continue ;; esac
		patch -p1 -i "$patches/$p" || return 1
	done < $patches/series &&

	# local patches - currently none
	#patches=../pkg/patch &&
	#for p in $patches/*; do
	#	[ -d "$p" ] && continue
	#	patch -p1 -i "$p" || return 1
	#done &&

	true
}

### default pkg_package
### buid
pkg_build() {
	cd /tmp/file* &&

	autoreconf -fiv &&
	pkg_build_autoconf &&
	pkg_build_slackdesc
}
