# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=xz
pkgver=5.6.3
pkgrel=1
pkgdesc='Library and command line tools for XZ and LZMA compressed files'
arch=('x86_64')
url='https://tukaani.org/xz/'
license=('GPL' 'LGPL' 'custom')
depends=('sh')
makedepends=('git' 'po4a' 'doxygen')
provides=('liblzma.so')
validpgpkeys=('3690C240CE51B4670D30AD1C38EE757D69184620') # Lasse Collin <lasse.collin@tukaani.org>
source=("git+https://github.com/tukaani-project/xz#tag=v${pkgver}?signed")
sha256sums=('5a4495e85ddec6979a7c34fec7355304588e37830d663ffb5e57069636f47900')
sha512sums=('5dab9545bc63249c7716d40464f77b603a4255a91d65743d4fa8163e9819768c8a26b31dc783c1fb65904c954a6d5fd4a974420e4d599c7079828bdd3c78b593')

prepare() {
  cd ${pkgname}

  ./autogen.sh
}

build() {
  cd ${pkgname}

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

check() {
  cd ${pkgname}

  make check
}

package() {
  cd ${pkgname}

  make DESTDIR="${pkgdir}" install

  install -d -m0755 "${pkgdir}/usr/share/licenses/xz/"
  ln -sf /usr/share/doc/xz/COPYING "${pkgdir}/usr/share/licenses/xz/"
}
