# Contributor: Sören Tempel # Contributor: Jakub Jirutka # Maintainer: Francesco Colista pkgname=nftables pkgver=1.0.8 pkgrel=0 pkgdesc="Netfilter tables userspace tools" url="https://netfilter.org/projects/nftables" arch="all" license="GPL-2.0-or-later" makedepends=" asciidoc bison docbook2x flex gmp-dev jansson-dev libmnl-dev libnftnl-dev ncurses-dev py3-gpep517 py3-setuptools py3-wheel readline-dev " install="$pkgname.post-upgrade" subpackages=" $pkgname-static $pkgname-dev $pkgname-doc $pkgname-openrc py3-$pkgname-pyc py3-$pkgname:_py3:noarch " source="https://netfilter.org/projects/nftables/files/nftables-$pkgver.tar.xz nftables.confd nftables.initd nftables.nft " prepare() { default_prepare sed -i '1i#include "config.h"' "$builddir"/src/proto.c } build() { CONFIG_MAN=y DB2MAN=docbook2x-man ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/usr/share \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --localstatedir=/var \ --disable-python \ --enable-static=yes \ --with-json \ --with-cli=readline make cd py gpep517 build-wheel \ --wheel-dir "$builddir"/.dist \ --output-fd 3 3>&1 >&2 } package() { make DESTDIR="$pkgdir" install python3 -m installer -d "$pkgdir" \ .dist/*.whl install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname install -Dm644 "$srcdir"/nftables.nft "$pkgdir"/etc/nftables.nft install -dm755 "$pkgdir"/etc/nftables.d install -dm750 "$pkgdir"/var/lib/nftables } _py3() { pkgdesc="$pkgdesc (Python interface)" depends="$pkgname=$pkgver-r$pkgrel" amove usr/lib/python3* } sha512sums=" 06053c05a0d7c84a5cc4d22733836dadf9880c3552df3dace6d30aea95c7e1edb5528ea45df8576f282c15bf58f23407e26efb22257bd98a478849a8bdd4f8d5 nftables-1.0.8.tar.xz 5a298ea01df60b434791fea94306d5b14f7ce684329e4122cc78bb52d1c272fcc48b06eaae154fd082c05f7030792fe42e73814caf3c7be3c446bb265fe25642 nftables.confd d425442b37693afb334123ff9dd1e1ddf91c299831f5508d3088a0938389d937b437e9886f69a91185c939693e6f0e9f0cac3e0ce988cc7cd7bf4090c7cdf908 nftables.initd 2dfc81a204af6e9516f78df97603e320453679bd9d34e7e8376b110438bb4d406d571df5efcbb76a446cd4a456c8a497092933219286e41a67bbd1483b38af39 nftables.nft "