Skip to content

Commit a2b2f8d

Browse files
committed
net-firewall/ipt_netflow: add 2.6.9999.0
Snapshot version of aabc/ipt-netflow#239 I also updated the -gentoo.patch to sort out LDFLAGS not respected QA error. Signed-off-by: Jaco Kroon <jaco@uls.co.za> Bug: https://bugs.gentoo.org/950506 Bug: https://bugs.gentoo.org/831306
1 parent 9896335 commit a2b2f8d

File tree

3 files changed

+118
-5
lines changed

3 files changed

+118
-5
lines changed

net-firewall/ipt_netflow/Manifest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
DIST ipt_netflow-2.6.9999.0.tar.gz 96793 BLAKE2B 8d397b79574b472a806da6c5a4aa2e9922765c046682266904f3d291594420f884131c24e45affa989f56c335a10d5e64540a235dffdc8368d78581181ae7192 SHA512 2569b372a24ac3c05505313a0dae2846055d265fcddc7c2f8112145960f857f1eb6b68e33bba7d888f253c34d1f9c1486d0bfaa3881c1c26dd8a83257631048e
12
DIST ipt_netflow-2.6.tar.gz 95752 BLAKE2B 088c7030addd34d9d889cfa705aa060d0793e33be957deb3b703daea4229afc24f7268285ce336e425a024dc9d8139633a5206ff9d769c95cf71c156acbd4f25 SHA512 0ccea556e25dc6bc2d8c7648ed1b4ab366097baf5b06f167ccd19d2adb0a195ad652635181573785f9e9fa208d163f22b6527310eb939455d7ee3bc141cbeed5

net-firewall/ipt_netflow/files/ipt_netflow-9999-gentoo.patch

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
diff --git a/Makefile.in b/Makefile.in
2+
index 65edf4c..7d6ccc8 100644
13
--- a/Makefile.in
24
+++ b/Makefile.in
35
@@ -13,7 +13,7 @@ CARGS = @CARGS@
@@ -9,7 +11,7 @@
911

1012
# https://www.kernel.org/doc/Documentation/kbuild/modules.txt
1113
# https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt
12-
@@ -24,7 +24,7 @@
14+
@@ -24,7 +24,7 @@ all: ipt_NETFLOW.ko libipt_NETFLOW.so libip6t_NETFLOW.so @SNMPTARGET@
1315

1416
ipt_NETFLOW.ko: version.h ipt_NETFLOW.c ipt_NETFLOW.h compat_def.h compat.h Makefile
1517
@echo Compiling $(shell ./version.sh) for kernel $(KVERSION)
@@ -18,7 +20,7 @@
1820
@touch $@
1921
compat_def.h: gen_compat_def
2022
./gen_compat_def > $@-
21-
@@ -32,24 +32,24 @@
23+
@@ -32,24 +32,24 @@ compat_def.h: gen_compat_def
2224
sparse: | version.h ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
2325
@rm -f ipt_NETFLOW.ko ipt_NETFLOW.o
2426
@echo Compiling for kernel $(KVERSION)
@@ -47,12 +49,16 @@
4749

4850
sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my
4951
@echo " *"
50-
@@ -69,7 +69,7 @@
52+
@@ -69,10 +69,10 @@ sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my
5153
fi
5254

5355
%_sh.o: libipt_NETFLOW.c
5456
- $(CC) $(CFLAGS) -O2 -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c libipt_NETFLOW.c
55-
+ $(CC) $(CFLAGS) $(LDFLAGS) -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c libipt_NETFLOW.c
57+
+ $(CC) $(CFLAGS) -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c libipt_NETFLOW.c
5658

5759
%.so: %_sh.o
58-
$(CC) -shared -o $@ $<
60+
- $(CC) -shared -o $@ $<
61+
+ $(CC) $(LDFLAGS) -shared -o $@ $<
62+
63+
version.h: ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
64+
@./version.sh --define > version.h
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Copyright 1999-2025 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
6+
inherit linux-mod-r1 toolchain-funcs
7+
8+
# Hash of commit point.
9+
SNAPSHOT=0c5759d002131ac3ae161713f4ce0d515037c1de
10+
11+
DESCRIPTION="Netflow iptables module"
12+
HOMEPAGE="https://github.com/aabc/ipt-netflow"
13+
SRC_URI="https://github.com/aabc/ipt-netflow/archive/${SNAPSHOT}.tar.gz -> ${P}.tar.gz"
14+
15+
S="${WORKDIR}/ipt-netflow-${SNAPSHOT}"
16+
17+
LICENSE="GPL-2"
18+
SLOT="0"
19+
KEYWORDS="~amd64 ~x86"
20+
IUSE="natevents snmp"
21+
22+
RDEPEND="
23+
net-firewall/iptables:0=
24+
snmp? ( net-analyzer/net-snmp )
25+
"
26+
DEPEND="${RDEPEND}"
27+
BDEPEND="
28+
virtual/linux-sources
29+
virtual/pkgconfig
30+
"
31+
32+
PATCHES=(
33+
"${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
34+
"${FILESDIR}/${PN}-9999-gentoo.patch"
35+
)
36+
37+
pkg_setup() {
38+
local CONFIG_CHECK="BRIDGE_NETFILTER ~IP_NF_IPTABLES VLAN_8021Q"
39+
if use natevents; then
40+
CONFIG_CHECK+=" NF_CONNTRACK_EVENTS"
41+
if kernel_is lt 5 2; then
42+
CONFIG_CHECK+=" NF_NAT_NEEDED"
43+
else
44+
CONFIG_CHECK+=" NF_NAT"
45+
fi
46+
fi
47+
48+
IPT_LIB="/usr/$(get_libdir)/xtables"
49+
linux-mod-r1_pkg_setup
50+
}
51+
52+
src_prepare() {
53+
default
54+
55+
# Fix incorrect module version in sources
56+
sed -i \
57+
-e '/IPT_NETFLOW_VERSION/s#"[0-9.]*"#"'${PV}'"#' \
58+
ipt_NETFLOW.c || die
59+
60+
# Checking for directory is enough
61+
sed -i \
62+
-e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' \
63+
configure || die
64+
}
65+
66+
do_conf() {
67+
tc-export CC
68+
echo ./configure $*
69+
./configure $* ${EXTRA_ECONF} || die 'configure failed'
70+
}
71+
72+
src_configure() {
73+
local IPT_VERSION="$($(tc-getPKG_CONFIG) --modversion xtables)"
74+
# this configure script is not based on autotools
75+
# ipt-src need to be defined, see bug #455984
76+
do_conf \
77+
--disable-dkms \
78+
--enable-aggregation \
79+
--enable-direction \
80+
--enable-macaddress \
81+
--enable-vlan \
82+
--ipt-lib="${IPT_LIB}" \
83+
--ipt-src="/usr/" \
84+
--ipt-ver="${IPT_VERSION}" \
85+
--kdir="${KV_DIR}" \
86+
--kver="${KV_FULL}" \
87+
$(use natevents && echo '--enable-natevents') \
88+
$(use snmp && echo '--enable-snmp-rules' || echo '--disable-snmp-agent')
89+
}
90+
91+
src_compile() {
92+
local modlist=( ipt_NETFLOW=ipt_netflow )
93+
linux-mod-r1_src_compile
94+
emake ARCH="$(tc-arch-kernel)" CC="$(tc-getCC)" LD="$(tc-getLD)" OBJDUMP="$(tc-getOBJDUMP)" all
95+
}
96+
97+
src_install() {
98+
linux-mod-r1_src_install
99+
100+
use snmp && emake DESTDIR="${D}" SNMPTGSO="/usr/$(get_libdir)/snmp/dlmod/snmp_NETFLOW.so" sinstall
101+
102+
exeinto "${IPT_LIB}"
103+
doexe libip{,6}t_NETFLOW.so
104+
105+
doheader ipt_NETFLOW.h
106+
}

0 commit comments

Comments
 (0)