#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=xz
pkgver=5.4.2
pkgrel=01
pkgdesc='Library and command line tools for XZ and LZMA compressed files'
url='https://tukaani.org/xz/'
depends=('sh')
#options=('debug')   ##### uncomment this to produce the debug pkg
source=("https://tukaani.org/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.sig})
# temporary use of unsigned mirror at SF since zoner.fi is down
# Sums same with arch 
#source=("xz-5.2.9.tar.gz:https://downloads.sourceforge.net/project/lzmautils/xz-5.2.9.tar.gz?ts=gAAAAABjiAaACqaAp0YyfNS0hoSgTfR8z7zafIiHfu8jZuEf9Dk3IX7wbWPwuuekp1LHnfAHvVrsFD4kpAbKm9HOsRMfAzd3CA%3D%3D&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Flzmautils%2Ffiles%2Fxz-5.2.9.tar.gz")
##        "https://tukaani.org/${pkgname}/xzgrep-ZDI-CAN-16587.patch"{,.sig})
 
#prepare() {
#	cd "${srcdir}/${pkgname}-${pkgver}"
#
#	patch -p1 -i "${srcdir}/xzgrep-ZDI-CAN-16587.patch"
#}

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	./configure --prefix=/usr \
		--disable-rpath \
		--enable-werror
	make
}

check() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make check
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
	install -d -m755 "${pkgdir}/usr/share/licenses/xz/"
	ln -sf /usr/share/doc/xz/COPYING "${pkgdir}/usr/share/licenses/xz/"
	ln -sf /usr/share/licenses/common/GPL2/license.txt "${pkgdir}/usr/share/doc/xz/COPYING.GPLv2"
}

#---- arch license gpg-key & sha256sums ----

arch=(x86_64)

license=('GPL' 'LGPL' 'custom')

validpgpkeys=('3690C240CE51B4670D30AD1C38EE757D69184620') # Lasse Collin <lasse.collin@tukaani.org>

sha256sums=(87947679abcf77cc509d8d1b474218fd16b72281e2797360e909deaee1ac9d05  # xz-5.4.2.tar.gz
	49b48fe20a7620c6d688e6633ae055bf27d987dcc89d55bafcc148256cdca37a) # xz-5.4.2.tar.gz.sig

##  a52aeed0c582a827023b979de05faf341cf5793067d3fdbbfa17b6790525403d  xz-5.4.2-01-x86_64.pkg.tar.lz


