# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=libnftnl
pkgver=1.3.1
pkgrel=0
pkgdesc="Netfilter library providing interface to the nf_tables subsystem"
url="https://netfilter.org/projects/libnftnl"
arch="all"
license="GPL-2.0-or-later"
makedepends="bash jansson-dev libmnl-dev"
provides="$pkgname-libs=$pkgver-r$pkgrel"  # for backward compatibility (Alpine <3.15)
replaces="$pkgname-libs"  # for backward compatibility (Alpine <3.15)
subpackages="$pkgname-dev"
source="https://netfilter.org/projects/libnftnl/files/libnftnl-$pkgver.tar.xz"

case "$CARCH" in
	s390x) options="!check" ;; # FIXME
esac

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-static
	make
}

check() {
	cd tests
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
a4e689b003cc2ae2ecf203335265f337d6de7a50af5410d649a567535c109d08ee9dbae9e8572b1af8c67f09ea27877ca059e04ed3b1c12183ef7b4185bdd10f  libnftnl-1.3.1.tar.xz
"
