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

TARBALL=tar-1.27.1.tar.xz
MD5SUM=e0382a4064e09a4943f3adeff1435978
SRC_URL=http://distro.ibiblio.org/fatdog/source/710/clfs-packages-3.0.0.tar
BUNDLE=clfs-packages-3.0.0.tar

SLACKREQ=
SLACKDESC='tar: tar 1.27.1 (Archiver)  
tar:  
tar: The Tar package contains an archiving program. Traditionally used for 
tar: tape (tar=tape archive), tar is now the most popular archiver used to 
tar: bundle files in the Unix world.  
tar: 
tar: 
tar: 
tar: 
tar: 
tar:
'


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

### prepare
pkg_prepare() {
	if pkg_prepare_default; then
		cd tmp/tar*
		patch -Np1 -i $SRC_DIR/tar-1.27.1-manpage-1.patch
	fi
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/tar*
	
	FORCE_UNSAFE_CONFIGURE=1 CC="gcc ${BUILD64}" \
	./configure --prefix=/usr \
            --bindir=/bin &&
            
    make $MAKEFLAGS && make install &&
	perl tarman > /usr/share/man/man1/tar.1 &&    
    make -C doc install-html docdir=/usr/share/doc/tar-1.27.1 &&
	pkg_build_slackdesc
}
