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

# 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="xz32: xz32 $PKGVER (XZ file compression utilities)  
xz32:  
xz32: The Xz package contains programs for compressing and decompressing files. 
xz32: It provides capabilities for the lzma and the newer xz compression 
xz32: formats. Compressing text files with xz yields a better compression 
xz32: percentage than with the traditional gzip or bzip2 commands; but it is 
xz32: slower to compress.  
xz32: 
xz32: This contains 32-bit version of the libraries.
xz32: 
xz32:
"


### 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
### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share
}

### build
pkg_build() {
	cd /tmp/xz*
		
	# CLFS 3.0.0 way
	CC="gcc ${BUILD32}" ./configure --prefix=/usr \
		--docdir=/usr/share/doc/xz-$PKGVER &&
	
	make $MAKEFLAGS && make install &&	
	#mv -v /usr/lib/liblzma.so.* /lib &&
	#ln -sfv ../../lib/$(readlink /usr/lib/liblzma.so) /usr/lib/liblzma.so	 &&
	
	pkg_build_slackdesc
}


