# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
setvar pkgname = 'xz'
setvar pkgver = '5.2.3'
setvar pkgrel = '1'
setvar pkgdesc = ""Library and command line tools for XZ and LZMA compressed files""
setvar url = ""http://tukaani.org/xz/""
setvar arch = ""all""
setvar license = ""custom""
setvar depends = """"
setvar makedepends = """"
setvar subpackages = ""$pkgname-dev $pkgname-doc $pkgname-libs""
setvar source = ""http://tukaani.org/xz/xz-$pkgver.tar.gz""

proc build {
	cd $builddir
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-rpath \
		--disable-werror

	sed 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
		-i libtool
	sed 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
		-i libtool

	make
}

proc check {
	cd $builddir
	make check
}

proc package {
	make -C $builddir DESTDIR="$pkgdir" install
	install -Dm644 "$builddir"/COPYING \
		"$pkgdir"/usr/share/licenses/$pkgname
}

setvar md5sums = ""ef68674fb47a8b8e741b34e429d86e9d  xz-5.2.3.tar.gz""
setvar sha256sums = ""71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb  xz-5.2.3.tar.gz""
setvar sha512sums = ""a5eb4f707cf31579d166a6f95dbac45cf7ea181036d1632b4f123a4072f502f8d57cd6e7d0588f0bf831a07b8fc4065d26589a25c399b95ddcf5f73435163da6  xz-5.2.3.tar.gz""