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

# CLFS 2017.07
TARBALL=xz-$PKGVER.tar.xz
MD5SUM=60fb79cab777e3f71ca43d298adacbd5
BUNDLE=fatdog-base-8.2.tar
SRC_URL=http://distro.ibiblio.org/fatdog/source/800/$BUNDLE

SLACKREQ=
SLACKDESC="xz: xz $PKGVER (XZ file compression utilities)  
xz:  
xz: The Xz package contains programs for compressing and decompressing files. 
xz: It provides capabilities for the lzma and the newer xz compression 
xz: formats. Compressing text files with xz yields a better compression 
xz: percentage than with the traditional gzip or bzip2 commands; but it is 
xz: slower to compress.  
xz: 
xz: 
xz: 
xz:
"


### 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/xz*
	
	# CLFS 3.0.0 way
	CC="gcc ${BUILD64}" ./configure --prefix=/usr \
		--libdir=/usr/$LIBDIR --docdir=/usr/share/doc/xz-$PKGVER &&
	
	make $MAKEFLAGS && make install &&	
	#mv -v /usr/bin/{xz,lzma,lzcat,unlzma,unxz,xzcat} /bin # don't move
	#mv -v /usr/$LIBDIR/liblzma.so.* /$LIBDIR &&
	#ln -sfv ../../$LIBDIR/$(readlink /usr/$LIBDIR/liblzma.so) /usr/$LIBDIR/liblzma.so &&
	
	pkg_build_slackdesc
}


