# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Alexander Rødseth <rodseth@gmail.com>

pkgname=nzbget
pkgver=21.1
pkgrel=1
pkgdesc="Download from Usenet using .nzb files"
arch=('x86_64')
url="https://nzbget.net/"
license=('GPL')
depends=('libxml2')
optdepends=('python: to run included scripts'
            'unrar: unpacking archives'
            'p7zip: unpacking archives')
changelog=$pkgname.changelog
source=(https://github.com/nzbget/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver-src.tar.gz)
sha256sums=('4e8fc1beb80dc2af2d6a36a33a33f44dedddd4486002c644f4c4793043072025')

build() {
  cd $pkgname-$pkgver

  ./configure --prefix='/usr' --sbindir='/usr/bin' --enable-parcheck --with-tlslib=OpenSSL
  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="${pkgdir}" install

  install -d "${pkgdir}"/usr/share/$pkgname
  install -m644 -t "${pkgdir}"/usr/share/$pkgname ChangeLog README
}
