desktop/nftables/PKGBUILD

52 lines
1.3 KiB
Bash

pkgname=nftables
pkgver=0.9.0
pkgrel=2
pkgdesc='Netfilter tables userspace tools'
arch=('x86_64')
url='https://netfilter.org/projects/nftables/'
license=('GPL2')
depends=('libmnl' 'libnftnl' 'gmp' 'readline' 'ncurses')
makedepends=('docbook2x')
backup=('etc/nftables.conf')
source=("https://netfilter.org/projects/nftables/files/nftables-$pkgver.tar.bz2"
'nftables.conf'
'nftables.service')
sha1sums=('a3463fc6589c08631ec3f306f6db7f0905249542'
'7869aa31ac802922073310ffd4cbbc16450171e5'
'59185e947ebfd599954800ad2c774171b3f4cd58')
prepare() {
cd $pkgname-$pkgver
# apply patch from the source array (should be a pacman feature)
local filename
for filename in "${source[@]}"; do
if [[ "$filename" =~ \.patch$ ]]; then
msg2 "Applying patch ${filename##*/}"
patch -p1 -N -i "$srcdir/${filename##*/}"
fi
done
:
}
build() {
cd $pkgname-$pkgver
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--sysconfdir=/usr/share \
CONFIG_MAN=y DB2MAN=docbook2man
make
}
package() {
pushd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
popd
# basic safe firewall config
install -Dm644 nftables.conf "$pkgdir/etc/nftables.conf"
# systemd
install -Dm644 nftables.service "$pkgdir/usr/lib/systemd/system/nftables.service"
}