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

# CLFS 3.0.0 updated to latest 5.2.0 (LFS post-7.6, 2015-02-26)
TARBALL=xz-$PKGVER.tar.xz
MD5SUM=d87c242778fcf5ce4598de80a55ded28
SRC_URL=http://tukaani.org/xz/$TARBALL
BUNDLE=

#TARBALL=xz-5.0.5.tar.xz
#MD5SUM=aa17280f4521dbeebed0fbd11cd7fa30
#SRC_URL=http://distro.ibiblio.org/fatdog/source/700/lfs-packages-7.5.tar
#BUNDLE=lfs-packages-7.5.tar

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*
	
	# LFS 7.4
	#./configure --prefix=/usr --libdir=/lib64 --docdir=/usr/share/doc/xz-5.0.5 &&
	#make $MAKEFLAGS && make pkgconfigdir=/usr/lib64/pkgconfig install &&
	
	# LFS 7.5 way
	#./configure --prefix=/usr --docdir=/usr/share/doc/xz-5.2.0 --libdir=/usr/lib64 &&
	
	# 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
}


