summaryrefslogtreecommitdiff
path: root/opt/nftables/MAKEPKG
diff options
context:
space:
mode:
Diffstat (limited to 'opt/nftables/MAKEPKG')
-rw-r--r--opt/nftables/MAKEPKG73
1 files changed, 73 insertions, 0 deletions
diff --git a/opt/nftables/MAKEPKG b/opt/nftables/MAKEPKG
new file mode 100644
index 0000000..2dc8d4e
--- /dev/null
+++ b/opt/nftables/MAKEPKG
@@ -0,0 +1,73 @@
+#!/bin/mkpkg
+# description: Netfilter nftables - firewalling, NAT, and packet mangling for Linux (minimal)
+# url: https://netfilter.org/projects/nftables/
+
+# Note: This is a minimal build WITHOUT Python bindings
+
+name=nftables
+version=1.1.7
+release=1
+depends=(libmnl libnftnl libedit gmp)
+makedeps=(bison flex)
+groups=(nftables)
+services=(nftables)
+source=(
+ https://www.netfilter.org/pub/nftables/nftables-$version.tar.xz
+)
+sha256sums=(
+ "a6fbf060d8d4fff001517a2b94f356bb4366bfbf0ba366366f9d27cc38caa58f"
+)
+
+build() {
+ cd $name-$version
+ export CONFIG_SHELL=/bin/bash
+ ./configure \
+ --prefix=/usr \
+ --sbindir=/usr/bin \
+ --sysconfdir=/etc \
+ --with-cli=editline \
+ --without-json \
+ --without-python-bin \
+ --disable-debug \
+ --disable-man-doc \
+ --disable-python
+ make
+ make DESTDIR=$PKG install
+
+ rm -rf $PKG/usr/share/doc
+}
+
+post_build() {
+ # runit service
+ install -d $PKG/etc/sv/nftables/log
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'exec 2>&1' \
+ '[ ! -r /etc/nftables.conf ] && exit 0' \
+ 'nft -f /etc/nftables.conf' \
+ 'exec chpst -b nftables pause' \
+ > $PKG/etc/sv/nftables/run
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'nft flush ruleset' \
+ > $PKG/etc/sv/nftables/finish
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'mkdir -p /var/log/nftables' \
+ 'exec svlogd -tt /var/log/nftables' \
+ > $PKG/etc/sv/nftables/log/run
+
+ chmod 755 $PKG/etc/sv/nftables/run
+ chmod 755 $PKG/etc/sv/nftables/finish
+ chmod 755 $PKG/etc/sv/nftables/log/run
+}
+
+signify() {
+ untrusted comment: public key
+ RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
+}
+
+# vim: filetype=sh