Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/files/, net-firewall/ipt_netflow/
Date: Fri, 24 Apr 2020 07:35:15
Message-Id: 1587713706.d7addd0edb9627481cf77288ad6edbcdbed86d1e.jer@gentoo
1 commit: d7addd0edb9627481cf77288ad6edbcdbed86d1e
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 24 07:25:07 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 24 07:35:06 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7addd0e
7
8 net-firewall/ipt_netflow: Version 2.5
9
10 Package-Manager: Portage-2.3.99, Repoman-2.3.22
11 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
12
13 net-firewall/ipt_netflow/Manifest | 1 +
14 .../ipt_netflow/files/ipt_netflow-2.5-gentoo.patch | 61 ++++++++++++
15 net-firewall/ipt_netflow/ipt_netflow-2.5.ebuild | 104 +++++++++++++++++++++
16 3 files changed, 166 insertions(+)
17
18 diff --git a/net-firewall/ipt_netflow/Manifest b/net-firewall/ipt_netflow/Manifest
19 index ee990a70dbd..79bf94164a9 100644
20 --- a/net-firewall/ipt_netflow/Manifest
21 +++ b/net-firewall/ipt_netflow/Manifest
22 @@ -1 +1,2 @@
23 DIST ipt_netflow-2.4.tar.gz 92580 BLAKE2B 0197e7e5cdd9c94c7b80b38cb4e2879343139592421922bf73aeaac70ac3af54ea25934bb1474ff455a9f58eab2368995591542f46be48b5c8491a3b6a192f56 SHA512 3c80d02cfda996fbde8d258875df8795000fd8390b5a6f8296771a992067e153eca48f7f4602421529948beaf3030e164adfc2ffe5b528042fbdc15ffb56aa74
24 +DIST ipt_netflow-2.5.tar.gz 94097 BLAKE2B 5ca8d686e08f6fb0cdb1d502572afc71f146e2633ccf5fc7cb9ad21420fb62e88a2cb393e83ee4f5646200fa964d46a16ef58831958799449a4a59e2da6c9337 SHA512 8cd1bc46ef6e975964e5ddc290ed999f7076b63a9363f1a1f31b5d8db875d4e564ed5f0d5185c29dcf8a86793fe4badf63325b79ba1abbc264088b1ca94a9dad
25
26 diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.5-gentoo.patch b/net-firewall/ipt_netflow/files/ipt_netflow-2.5-gentoo.patch
27 new file mode 100644
28 index 00000000000..508be107795
29 --- /dev/null
30 +++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.5-gentoo.patch
31 @@ -0,0 +1,61 @@
32 +--- a/Makefile.in
33 ++++ b/Makefile.in
34 +@@ -11,7 +11,7 @@
35 + SNMPTGSO = /usr/lib/snmp/dlmod/snmp_NETFLOW.so
36 + SNMPCONF = /etc/snmp/snmpd.conf
37 + SNMPLINE = dlmod netflow $(SNMPTGSO)
38 +-CC = gcc
39 ++CC ?= gcc
40 +
41 + # https://www.kernel.org/doc/Documentation/kbuild/modules.txt
42 + # https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt
43 +@@ -22,31 +22,31 @@
44 +
45 + ipt_NETFLOW.ko: version.h ipt_NETFLOW.c ipt_NETFLOW.h compat_def.h compat.h Makefile
46 + @echo Compiling for kernel $(KVERSION)
47 +- make -C $(KDIR) M=$(CURDIR) modules CONFIG_DEBUG_INFO=y
48 ++ $(MAKE) -C $(KDIR) M=$(CURDIR) modules CONFIG_DEBUG_INFO=y
49 + @touch $@
50 + compat_def.h: gen_compat_def
51 + ./gen_compat_def > $@
52 + sparse: | version.h ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
53 + @rm -f ipt_NETFLOW.ko ipt_NETFLOW.o
54 + @echo Compiling for kernel $(KVERSION)
55 +- make -C $(KDIR) M=$(CURDIR) modules C=1
56 ++ $(MAKE) -C $(KDIR) M=$(CURDIR) modules C=1
57 + @touch ipt_NETFLOW.ko
58 + coverity:
59 + coverity-submit -v
60 +
61 + minstall: | ipt_NETFLOW.ko
62 + @echo " *"
63 +- make -C $(KDIR) M=$(CURDIR) modules_install INSTALL_MOD_PATH=$(DESTDIR)
64 ++ $(MAKE) -C $(KDIR) M=$(CURDIR) modules_install INSTALL_MOD_PATH=$(DESTDIR)
65 + $(DEPMOD)
66 + mclean:
67 +- make -C $(KDIR) M=$(CURDIR) clean
68 ++ $(MAKE) -C $(KDIR) M=$(CURDIR) clean
69 + lclean:
70 + -rm -f *.so *_sh.o
71 + clean: mclean lclean
72 + -rm -f *.so *.o modules.order version.h compat_def.h
73 +
74 + snmp_NETFLOW.so: snmp_NETFLOW.c
75 +- $(CC) -fPIC -shared -o $@ $< -lnetsnmp
76 ++ $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -shared -o $@ $< -lnetsnmp
77 +
78 + sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my
79 + @echo " *"
80 +@@ -66,10 +66,10 @@
81 + fi
82 +
83 + %_sh.o: libipt_NETFLOW.c
84 +- $(CC) $(CFLAGS) -O2 -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c libipt_NETFLOW.c
85 ++ $(CC) $(CFLAGS) -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c libipt_NETFLOW.c
86 +
87 + %.so: %_sh.o
88 +- $(CC) -shared -o $@ $<
89 ++ $(CC) $(LDFLAGS) -shared -o $@ $<
90 +
91 + version.h: ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
92 + @./version.sh --define > version.h
93
94 diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.5.ebuild b/net-firewall/ipt_netflow/ipt_netflow-2.5.ebuild
95 new file mode 100644
96 index 00000000000..d5ba624302b
97 --- /dev/null
98 +++ b/net-firewall/ipt_netflow/ipt_netflow-2.5.ebuild
99 @@ -0,0 +1,104 @@
100 +# Copyright 1999-2020 Gentoo Authors
101 +# Distributed under the terms of the GNU General Public License v2
102 +
103 +EAPI=7
104 +inherit linux-info linux-mod toolchain-funcs
105 +
106 +DESCRIPTION="Netflow iptables module"
107 +HOMEPAGE="
108 + https://sourceforge.net/projects/ipt-netflow
109 + https://github.com/aabc/ipt-netflow
110 +"
111 +SRC_URI="https://github.com/aabc/ipt-netflow/archive/v${PV}.tar.gz -> ${P}.tar.gz"
112 +
113 +LICENSE="GPL-2"
114 +SLOT="0"
115 +KEYWORDS="~amd64 ~x86"
116 +
117 +IUSE="debug natevents snmp"
118 +
119 +RDEPEND="
120 + net-firewall/iptables:0=
121 + snmp? ( net-analyzer/net-snmp )
122 +"
123 +DEPEND="${RDEPEND}
124 + virtual/linux-sources
125 + virtual/pkgconfig
126 +"
127 +PATCHES=(
128 + "${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
129 + "${FILESDIR}/${PN}-2.5-gentoo.patch"
130 +)
131 +
132 +pkg_setup() {
133 + linux-info_pkg_setup
134 +
135 + local CONFIG_CHECK="~IP_NF_IPTABLES VLAN_8021Q"
136 + use debug && CONFIG_CHECK+=" ~DEBUG_FS"
137 + if use natevents; then
138 + CONFIG_CHECK+=" NF_CONNTRACK_EVENTS"
139 + if kernel_is lt 5 2; then
140 + CONFIG_CHECK+=" NF_NAT_NEEDED"
141 + else
142 + CONFIG_CHECK+=" NF_NAT"
143 + fi
144 + fi
145 +
146 + BUILD_TARGETS="all"
147 + MODULE_NAMES="ipt_NETFLOW(ipt_netflow:${S})"
148 + IPT_LIB="/usr/$(get_libdir)/xtables"
149 +
150 + linux-mod_pkg_setup
151 +}
152 +
153 +src_unpack() {
154 + default
155 +
156 + mv "${WORKDIR}"/${PN/_/-}-* "${WORKDIR}"/${P} || die
157 +}
158 +
159 +src_prepare() {
160 + default
161 +
162 + # Checking for directory is enough
163 + sed -i -e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' configure || die
164 +}
165 +
166 +do_conf() {
167 + tc-export CC
168 + echo ./configure $*
169 + ./configure $* ${EXTRA_ECONF} || die 'configure failed'
170 +}
171 +
172 +src_configure() {
173 + local IPT_VERSION="$($(tc-getPKG_CONFIG) --modversion xtables)"
174 + # this configure script is not based on autotools
175 + # ipt-src need to be defined, see bug #455984
176 + do_conf \
177 + --disable-dkms \
178 + --enable-aggregation \
179 + --enable-direction \
180 + --enable-macaddress \
181 + --enable-vlan \
182 + --ipt-lib="${IPT_LIB}" \
183 + --ipt-src="/usr/" \
184 + --ipt-ver="${IPT_VERSION}" \
185 + --kdir="${KV_DIR}" \
186 + --kver="${KV_FULL}" \
187 + $(use debug && echo '--enable-debugfs') \
188 + $(use natevents && echo '--enable-natevents') \
189 + $(use snmp && echo '--enable-snmp-rules' || echo '--disable-snmp-agent')
190 +}
191 +
192 +src_compile() {
193 + emake ARCH="$(tc-arch-kernel)" CC="$(tc-getCC)" all
194 +}
195 +
196 +src_install() {
197 + linux-mod_src_install
198 + exeinto "${IPT_LIB}"
199 + doexe libipt_NETFLOW.so
200 + use snmp && emake DESTDIR="${D}" SNMPTGSO="/usr/$(get_libdir)/snmp/dlmod/snmp_NETFLOW.so" sinstall
201 + doheader ipt_NETFLOW.h
202 + dodoc README*
203 +}