[arch-commits] Commit in nftables/repos (5 files)

Sébastien Luttringer seblu at archlinux.org
Sun Jul 4 07:58:35 UTC 2021


    Date: Sunday, July 4, 2021 @ 07:58:35
  Author: seblu
Revision: 418916

archrelease: copy trunk to testing-x86_64

Added:
  nftables/repos/testing-x86_64/
  nftables/repos/testing-x86_64/PKGBUILD
    (from rev 418915, nftables/trunk/PKGBUILD)
  nftables/repos/testing-x86_64/nftables.conf
    (from rev 418915, nftables/trunk/nftables.conf)
  nftables/repos/testing-x86_64/nftables.install
    (from rev 418915, nftables/trunk/nftables.install)
  nftables/repos/testing-x86_64/nftables.service
    (from rev 418915, nftables/trunk/nftables.service)

------------------+
 PKGBUILD         |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 nftables.conf    |   39 +++++++++++++++++++++++++++++++++++
 nftables.install |   10 ++++++++
 nftables.service |   12 ++++++++++
 4 files changed, 120 insertions(+)

Copied: nftables/repos/testing-x86_64/PKGBUILD (from rev 418915, nftables/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2021-07-04 07:58:35 UTC (rev 418916)
@@ -0,0 +1,59 @@
+# Maintainer: Sébastien "Seblu" Luttringer <seblu at archlinux.org>
+
+pkgname=nftables
+epoch=1
+pkgver=0.9.9
+pkgrel=2
+pkgdesc='Netfilter tables userspace tools'
+arch=('x86_64')
+url='https://netfilter.org/projects/nftables/'
+license=('GPL2')
+depends=('libmnl' 'libnftnl' 'gmp' 'readline' 'ncurses' 'jansson')
+optdepends=('python: Python bindings')
+makedepends=('asciidoc' 'python')
+backup=('etc/nftables.conf')
+validpgpkeys=('37D964ACC04981C75500FB9BD55D978A8A1420E4') # Netfilter Core Team
+source=("https://netfilter.org/projects/nftables/files/nftables-$pkgver.tar.bz2"{,.sig}
+        'nftables.conf'
+        'nftables.service')
+install=nftables.install
+sha256sums=('76ef2dc7fd0d79031a8369487739a217ca83996b3a746cec5bda79da11e3f1b4'
+            'SKIP'
+            '9a387cf2b467cc8c552301bd3da22e7a8a966c2c5bd04e90571c771fca9ffe3e'
+            'deffeef36fe658867dd9203ec13dec85047a6d224ea63334dcf60db97e1809ea')
+
+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 \
+    --with-json \
+    --disable-debug
+  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"
+}
+
+# vim:set ts=2 sw=2 et:

Copied: nftables/repos/testing-x86_64/nftables.conf (from rev 418915, nftables/trunk/nftables.conf)
===================================================================
--- testing-x86_64/nftables.conf	                        (rev 0)
+++ testing-x86_64/nftables.conf	2021-07-04 07:58:35 UTC (rev 418916)
@@ -0,0 +1,39 @@
+#!/usr/bin/nft -f
+#vim:set ts=2 sw=2 et:
+
+# IPv4/IPv6 Simple & Safe firewall ruleset.
+# More examples in /usr/share/nftables/ and /usr/share/doc/nftables/examples/.
+
+table inet filter
+delete table inet filter
+table inet filter {
+  chain input {
+    type filter hook input priority 0;
+
+    # allow established/related connections
+    ct state {established, related} accept
+
+    # early drop of invalid connections
+    ct state invalid drop
+
+    # allow from loopback
+    iifname lo accept
+
+    # allow icmp
+    ip protocol icmp accept
+    meta l4proto ipv6-icmp accept
+
+    # allow ssh
+    tcp dport ssh accept
+
+    # everything else
+    reject with icmpx type port-unreachable
+
+    # count dropped
+    counter
+  }
+  chain forward {
+    type filter hook forward priority 0;
+    policy drop
+  }
+}

Copied: nftables/repos/testing-x86_64/nftables.install (from rev 418915, nftables/trunk/nftables.install)
===================================================================
--- testing-x86_64/nftables.install	                        (rev 0)
+++ testing-x86_64/nftables.install	2021-07-04 07:58:35 UTC (rev 418916)
@@ -0,0 +1,10 @@
+## arg 1:  the new package version
+## arg 2:  the old package version
+post_upgrade() {
+  (( $(vercmp "$2" '1:0.9.9-1') > 0 )) || cat <<EOF
+==> Stopping/restarting the nftables service does NOT flush the ruleset anymore.
+==> The nftables.conf file requires a delete/flush directive to be restarted.
+==> See examples in /usr/share/nftables/ and /usr/share/doc/nftables/examples.
+==> The nftables service reload has been removed as it is now equivalent to a restart.
+EOF
+}

Copied: nftables/repos/testing-x86_64/nftables.service (from rev 418915, nftables/trunk/nftables.service)
===================================================================
--- testing-x86_64/nftables.service	                        (rev 0)
+++ testing-x86_64/nftables.service	2021-07-04 07:58:35 UTC (rev 418916)
@@ -0,0 +1,12 @@
+[Unit]
+Description=Netfilter Tables
+Documentation=man:nft(8)
+Wants=network-pre.target
+Before=network-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/nft -f /etc/nftables.conf
+
+[Install]
+WantedBy=multi-user.target




More information about the arch-commits mailing list