# Maintainer: Pierre Schmitz <pierre@archlinux.de>
# Contributor: François Charette <firmicus@gmx.net>

pkgname=xz
pkgver=5.8.1
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=('cb78e69a09fd5002bc4ab31ca2665a1d20003c2f3ab39bfe081043f086bd8728')
sha512sums=('b9a0f746215cd93c04fecd390ca44fc281d892b989e740ec6abbaa6a1eb457bbef40a33596dfe6e2285a319f2b09ae1994d778f0cf61114cbee9454a0eaa754b')

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/"
}
