# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Patryk Kowalczyk <patryk@kowalczyk.ws>
pkgname=libiscsi
pkgver=1.20.3
pkgrel=1
makedepends=('git')
depends=('glibc' 'gnutls' '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})
b2sums=('7ea384839354df8ad562e6ede59d7064b4d315d91e5da682bb4e74761aa8e2e71fd58feb25e3b621bf470928e560696131c4224e0cce19b14ac8f726983fee2a')

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
}
