# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Patryk Kowalczyk <patryk@kowalczyk.ws>
pkgname=libiscsi
pkgver=1.20.0
pkgrel=2
makedepends=('git')
depends=('glibc' 'popt' 'libgcrypt')
pkgdesc="Clientside library to implement the iSCSI protocol"
arch=(x86_64 aarch64)
url="https://github.com/sahlberg/libiscsi"
license=('LGPL-2.1-or-later')
source=(libiscsi::git+https://github.com/sahlberg/libiscsi.git#tag=${pkgver})
sha512sums=('b8f304137fe05011f4548fd1a14cb7dfb8562a1e41530b6f357238ce9f0603ec2e1b2be709478d0d72971f3903ee10f6915be57e8108aaea4ae0e82cd53e566c')

build() {
  cd "${srcdir}/${pkgname}"
  ./autogen.sh

  # Disabled werror due to GCC 8 warnings: https://github.com/sahlberg/libiscsi/issues/266
  ./configure --prefix=/usr --disable-static --libdir=/usr/lib --disable-werror 
  make
}

check() {
  cd "${srcdir}/${pkgname}"
  make check
}

package () {
  cd "${srcdir}/${pkgname}"
  make DESTDIR="${pkgdir}" install
}
