commit: 09ee4581ec218b242141bcdae1f737f39d33b490 Author: Jaco Kroon <jaco <AT> uls <DOT> co <DOT> za> AuthorDate: Mon Mar 17 15:32:09 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed May 21 20:55:08 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09ee4581
net-firewall/ipt_netflow: add 2.6_p20250317 Snapshot version of https://github.com/aabc/ipt-netflow/pull/239 Updated the -gentoo.patch to sort out LDFLAGS not respected QA error. Signed-off-by: Jaco Kroon <jaco <AT> uls.co.za> Bug: https://bugs.gentoo.org/950506 Bug: https://bugs.gentoo.org/831306 Part-of: https://github.com/gentoo/gentoo/pull/41138 Closes: https://github.com/gentoo/gentoo/pull/41138 Signed-off-by: Sam James <sam <AT> gentoo.org> net-firewall/ipt_netflow/Manifest | 1 + .../files/ipt_netflow-9999-gentoo.patch | 16 +++- .../ipt_netflow/ipt_netflow-2.6_p20250317.ebuild | 106 +++++++++++++++++++++ 3 files changed, 118 insertions(+), 5 deletions(-) diff --git a/net-firewall/ipt_netflow/Manifest b/net-firewall/ipt_netflow/Manifest index 8d7eda977928..e5f4998b6c83 100644 --- a/net-firewall/ipt_netflow/Manifest +++ b/net-firewall/ipt_netflow/Manifest @@ -1 +1,2 @@ DIST ipt_netflow-2.6.tar.gz 95752 BLAKE2B 088c7030addd34d9d889cfa705aa060d0793e33be957deb3b703daea4229afc24f7268285ce336e425a024dc9d8139633a5206ff9d769c95cf71c156acbd4f25 SHA512 0ccea556e25dc6bc2d8c7648ed1b4ab366097baf5b06f167ccd19d2adb0a195ad652635181573785f9e9fa208d163f22b6527310eb939455d7ee3bc141cbeed5 +DIST ipt_netflow-2.6_p20250317.tar.gz 96793 BLAKE2B 8d397b79574b472a806da6c5a4aa2e9922765c046682266904f3d291594420f884131c24e45affa989f56c335a10d5e64540a235dffdc8368d78581181ae7192 SHA512 2569b372a24ac3c05505313a0dae2846055d265fcddc7c2f8112145960f857f1eb6b68e33bba7d888f253c34d1f9c1486d0bfaa3881c1c26dd8a83257631048e diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-9999-gentoo.patch b/net-firewall/ipt_netflow/files/ipt_netflow-9999-gentoo.patch index de797495f0fd..4853d7505362 100644 --- a/net-firewall/ipt_netflow/files/ipt_netflow-9999-gentoo.patch +++ b/net-firewall/ipt_netflow/files/ipt_netflow-9999-gentoo.patch @@ -1,3 +1,5 @@ +diff --git a/Makefile.in b/Makefile.in +index 65edf4c..7d6ccc8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,7 +13,7 @@ CARGS = @CARGS@ @@ -9,7 +11,7 @@ # https://www.kernel.org/doc/Documentation/kbuild/modules.txt # https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt -@@ -24,7 +24,7 @@ +@@ -24,7 +24,7 @@ all: ipt_NETFLOW.ko libipt_NETFLOW.so libip6t_NETFLOW.so @SNMPTARGET@ ipt_NETFLOW.ko: version.h ipt_NETFLOW.c ipt_NETFLOW.h compat_def.h compat.h Makefile @echo Compiling $(shell ./version.sh) for kernel $(KVERSION) @@ -18,7 +20,7 @@ @touch $@ compat_def.h: gen_compat_def ./gen_compat_def > $@- -@@ -32,24 +32,24 @@ +@@ -32,24 +32,24 @@ compat_def.h: gen_compat_def sparse: | version.h ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile @rm -f ipt_NETFLOW.ko ipt_NETFLOW.o @echo Compiling for kernel $(KVERSION) @@ -47,12 +49,16 @@ sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my @echo " *" -@@ -69,7 +69,7 @@ +@@ -69,10 +69,10 @@ sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my fi %_sh.o: libipt_NETFLOW.c - $(CC) $(CFLAGS) -O2 -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c libipt_NETFLOW.c -+ $(CC) $(CFLAGS) $(LDFLAGS) -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c libipt_NETFLOW.c ++ $(CC) $(CFLAGS) -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c libipt_NETFLOW.c %.so: %_sh.o - $(CC) -shared -o $@ $< +- $(CC) -shared -o $@ $< ++ $(CC) $(LDFLAGS) -shared -o $@ $< + + version.h: ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile + @./version.sh --define > version.h diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.6_p20250317.ebuild b/net-firewall/ipt_netflow/ipt_netflow-2.6_p20250317.ebuild new file mode 100644 index 000000000000..71baeddafbe9 --- /dev/null +++ b/net-firewall/ipt_netflow/ipt_netflow-2.6_p20250317.ebuild @@ -0,0 +1,106 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit linux-mod-r1 toolchain-funcs + +# Hash of commit point. +SNAPSHOT=0c5759d002131ac3ae161713f4ce0d515037c1de + +DESCRIPTION="Netflow iptables module" +HOMEPAGE="https://github.com/aabc/ipt-netflow" +SRC_URI="https://github.com/aabc/ipt-netflow/archive/${SNAPSHOT}.tar.gz -> ${P}.tar.gz" + +S="${WORKDIR}/ipt-netflow-${SNAPSHOT}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="natevents snmp" + +RDEPEND=" + net-firewall/iptables:0= + snmp? ( net-analyzer/net-snmp ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + virtual/linux-sources + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984 + "${FILESDIR}/${PN}-9999-gentoo.patch" +) + +pkg_setup() { + local CONFIG_CHECK="BRIDGE_NETFILTER ~IP_NF_IPTABLES VLAN_8021Q" + if use natevents; then + CONFIG_CHECK+=" NF_CONNTRACK_EVENTS" + if kernel_is lt 5 2; then + CONFIG_CHECK+=" NF_NAT_NEEDED" + else + CONFIG_CHECK+=" NF_NAT" + fi + fi + + IPT_LIB="/usr/$(get_libdir)/xtables" + linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + # Fix incorrect module version in sources + sed -i \ + -e '/IPT_NETFLOW_VERSION/s#"[0-9.]*"#"'${PV}'"#' \ + ipt_NETFLOW.c || die + + # Checking for directory is enough + sed -i \ + -e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' \ + configure || die +} + +do_conf() { + tc-export CC + echo ./configure $* + ./configure $* ${EXTRA_ECONF} || die 'configure failed' +} + +src_configure() { + local IPT_VERSION="$($(tc-getPKG_CONFIG) --modversion xtables)" + # this configure script is not based on autotools + # ipt-src need to be defined, see bug #455984 + do_conf \ + --disable-dkms \ + --enable-aggregation \ + --enable-direction \ + --enable-macaddress \ + --enable-vlan \ + --ipt-lib="${IPT_LIB}" \ + --ipt-src="/usr/" \ + --ipt-ver="${IPT_VERSION}" \ + --kdir="${KV_DIR}" \ + --kver="${KV_FULL}" \ + $(use natevents && echo '--enable-natevents') \ + $(use snmp && echo '--enable-snmp-rules' || echo '--disable-snmp-agent') +} + +src_compile() { + local modlist=( ipt_NETFLOW=ipt_netflow ) + linux-mod-r1_src_compile + emake ARCH="$(tc-arch-kernel)" CC="$(tc-getCC)" LD="$(tc-getLD)" OBJDUMP="$(tc-getOBJDUMP)" all +} + +src_install() { + linux-mod-r1_src_install + + use snmp && emake DESTDIR="${D}" SNMPTGSO="/usr/$(get_libdir)/snmp/dlmod/snmp_NETFLOW.so" sinstall + + exeinto "${IPT_LIB}" + doexe libip{,6}t_NETFLOW.so + + doheader ipt_NETFLOW.h +}
