aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/package/netfilter
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-20 04:37:42 +0900
committerOphestra <cat@gensokyo.uk>2026-05-20 04:37:58 +0900
commit47f4e287fc7ec65a3de20891004462a63dea68b3 (patch)
tree24bc65bff28c00caee2da4fb4d1b282fa3eefa15 /internal/rosa/package/netfilter
parent2e710328a4a64f5803de317c936912cf2ccddddf (diff)
internal/rosa/package: migrate multiple libraries
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/package/netfilter')
-rw-r--r--internal/rosa/package/netfilter/libbsd-sys-queue.patch13
-rw-r--r--internal/rosa/package/netfilter/package.az107
2 files changed, 120 insertions, 0 deletions
diff --git a/internal/rosa/package/netfilter/libbsd-sys-queue.patch b/internal/rosa/package/netfilter/libbsd-sys-queue.patch
new file mode 100644
index 00000000..369ff19e
--- /dev/null
+++ b/internal/rosa/package/netfilter/libbsd-sys-queue.patch
@@ -0,0 +1,13 @@
+diff --git a/examples/netfilter/nfct-daemon.c b/examples/netfilter/nfct-daemon.c
+index d223ac2..a7878d0 100644
+--- a/examples/netfilter/nfct-daemon.c
++++ b/examples/netfilter/nfct-daemon.c
+@@ -20,7 +20,7 @@
+ #include <linux/netfilter/nfnetlink.h>
+ #include <linux/netfilter/nfnetlink_conntrack.h>
+
+-#include <sys/queue.h>
++#include <bsd/sys/queue.h>
+
+ struct nstats {
+ LIST_ENTRY(nstats) list;
diff --git a/internal/rosa/package/netfilter/package.az b/internal/rosa/package/netfilter/package.az
new file mode 100644
index 00000000..b6ee9cd5
--- /dev/null
+++ b/internal/rosa/package/netfilter/package.az
@@ -0,0 +1,107 @@
+package libmnl {
+ description = "a minimalistic user-space library oriented to Netlink developers";
+ website = "https://www.netfilter.org/projects/libmnl";
+ anitya = 1663;
+
+ version* = "1.0.5";
+ source = remoteTar {
+ url = "https://www.netfilter.org/projects/libmnl/files/"+
+ "libmnl-"+version+".tar.bz2";
+ checksum = "DN-vbbvQDpxXJm0TJ6xlluILvfrB86avrCTX50XyE9SEFSAZ_o8nuKc5Gu0Am7-u";
+ compress = bzip2;
+ };
+ patches = [ "libbsd-sys-queue.patch" ];
+
+ exec = make {
+ configure = {
+ "enable-static";
+ };
+ };
+
+ inputs = [
+ libbsd,
+ kernel-headers,
+ ];
+}
+
+package libnftnl {
+ description = "a userspace library providing a low-level netlink API to the in-kernel nf_tables subsystem";
+ website = "https://www.netfilter.org/projects/libnftnl";
+ anitya = 1681;
+
+ version* = "1.3.1";
+ source = remoteGit {
+ url = "https://git.netfilter.org/libnftnl";
+ tag = "libnftnl-"+version;
+ checksum = "91ou66K-I17iX6DB6hiQkhhC_v4DFW5iDGzwjVRNbJNEmKqowLZBlh3FY-ZDO0r9";
+ };
+
+ env = [
+ "CFLAGS=-D_GNU_SOURCE",
+ ];
+
+ exec = make {
+ generate = "./autogen.sh";
+ configure = {
+ "enable-static";
+ };
+ };
+
+ inputs = [
+ automake,
+ libtool,
+ pkg-config,
+
+ libmnl,
+ kernel-headers,
+ ];
+
+ runtime = [ libmnl ];
+}
+
+package iptables {
+ description = "the userspace command line program used to configure the Linux 2.4.x and later packet filtering ruleset";
+ website = "https://www.netfilter.org/projects/iptables";
+ anitya = 1394;
+
+ version* = "1.8.13";
+ source = remoteGit {
+ url = "https://git.netfilter.org/iptables";
+ tag = "v"+version;
+ checksum = "TUA-cFIAsiMvtRR-XzQvXzoIhJUOc9J2gQDJCbBRjmgmVfGfPTCf58wL7e-cUKVQ";
+ };
+
+ early = `
+rm \
+ extensions/libxt_connlabel.txlate \
+ extensions/libxt_conntrack.txlate
+sed -i \
+ 's/de:ad:0:be:ee:ff/DE:AD:00:BE:EE:FF/g' \
+ extensions/libebt_dnat.txlate \
+ extensions/libebt_snat.txlate
+`;
+
+ exec = make {
+ generate = "./autogen.sh";
+ configure = {
+ "enable-static";
+ };
+ preCheck = `
+ln -s ../system/bin/bash /bin/
+chmod +w /etc/ && ln -s ../usr/src/iptables/etc/ethertypes /etc/
+`;
+ };
+
+ inputs = [
+ automake,
+ libtool,
+ pkg-config,
+ bash,
+ python,
+
+ libnftnl,
+ kernel-headers,
+ ];
+
+ runtime = [ libnftnl ];
+}