# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libarchive
pkgver=3.7.4
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')
provides=('libarchive.so')
              'DB2C7CF1B4C265FAEF56E3FC5848A18B8F14184B') # Martin Matuska <martin@matuska.org>
source=("https://github.com/${pkgname}/${pkgname}/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.xz"{,.asc})
sha256sums=('f887755c434a736a609cbd28d87ddbfbe9d6a3bb5b703c22c02f6af80a802735'
            'SKIP')

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

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

check() {
  cd "${pkgname}-${pkgver}"

  make check
}

package() {
  cd "${pkgname}-${pkgver}"

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