Skip to content

Commit

Permalink
main/iptables: use tmpfiles to populate etc and var
Browse files Browse the repository at this point in the history
  • Loading branch information
q66 committed Sep 30, 2024
1 parent e5e8e0a commit 29c3ed9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions main/iptables/files/tmpfiles.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Populate iptables /etc and /var with some defaults

C /etc/iptables - - - - /usr/share/xtables/etc
C /var/lib/iptables - - - - /usr/share/xtables/var
14 changes: 6 additions & 8 deletions main/iptables/template.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
pkgname = "iptables"
pkgver = "1.8.10"
pkgrel = 0
pkgrel = 1
build_style = "gnu_configure"
configure_args = [
"--enable-devel",
"--enable-shared",
"--enable-bpf-compiler",
]
hostmakedepends = ["pkgconf", "flex"]
hostmakedepends = ["automake", "flex", "libtool", "pkgconf"]
makedepends = [
"libfl-devel-static",
"libpcap-devel",
Expand Down Expand Up @@ -75,12 +75,13 @@ def post_install(self):
self.install_file(fpath / "iptables-start", "usr/libexec", mode=0o755)
self.install_service(self.files_path / "iptables")
self.install_service(self.files_path / "ip6tables")
self.install_tmpfiles(self.files_path / "tmpfiles.conf")

# config files/rules taken from void
# some default config files to be populated (originally from void)
for f in ["empty", "simple_firewall"]:
self.install_file(fpath / f"{f}.rules", "etc/iptables")
self.install_file(fpath / f"{f}.rules", "usr/share/xtables/etc")
for f in ["filter", "mangle", "nat", "raw", "security"]:
self.install_file(fpath / f"empty-{f}.rules", "var/lib/iptables")
self.install_file(fpath / f"empty-{f}.rules", "usr/share/xtables/var")

# make room for defaults
for f in ["tables", "tables-save", "tables-restore"]:
Expand Down Expand Up @@ -115,6 +116,3 @@ def _(self):
"@usr/bin/iptables-restore=>xtables-legacy-multi",
"@usr/bin/ip6tables-restore=>xtables-legacy-multi",
]


configure_gen = []

0 comments on commit 29c3ed9

Please sign in to comment.