# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libarchive
pkgver=3.7.7
pkgrel=1
pkgdesc='Multi-format archive and compression library'
arch=('x86_64')
url='https://libarchive.org/'
license=('BSD')
depends=('acl' 'libacl.so'
         'bzip2' 'libbz2.so'
         'libxml2' 'libxml2.so'
         'lz4'
         'openssl' 'libcrypto.so'
         'xz' 'liblzma.so'
         'zlib' 'libz.so'
         'zstd' 'libzstd.so')
makedepends=('git')
provides=('libarchive.so')
validpgpkeys=('A5A45B12AD92D964B89EEE2DEC560C81CEC2276E'  # Martin Matuska <mm@FreeBSD.org>
              'DB2C7CF1B4C265FAEF56E3FC5848A18B8F14184B') # Martin Matuska <martin@matuska.org>
source=("git+https://github.com/${pkgname}/${pkgname}.git?signed#tag=v${pkgver}")
sha256sums=('5f34ae74d1a780a7147f255903a04b475f674ea48252f3a059fb27d67eb083a9')

prepare() {
  cd "${pkgname}"
  autoreconf -fiv
}

build() {
  cd "${pkgname}"

  ./configure \
      --prefix=/usr \
      --without-nettle \
      --disable-static
  make
}

check() {
  cd "${pkgname}"

  make check
}

package() {
  cd "${pkgname}"

  make DESTDIR="$pkgdir" install
  install -Dm0644 COPYING "$pkgdir/usr/share/licenses/libarchive/COPYING"
}
