Gentoo Archives: gentoo-commits

From: Sergey Popov <pinkbyte@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/
Date: Thu, 27 May 2021 10:04:27
Message-Id: 1622109711.490a3ecbbc4e4e43a7e1b4d2253490f1ca169212.pinkbyte@gentoo
1 commit: 490a3ecbbc4e4e43a7e1b4d2253490f1ca169212
2 Author: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 27 10:01:51 2021 +0000
4 Commit: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
5 CommitDate: Thu May 27 10:01:51 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=490a3ecb
7
8 net-firewall/ipt_netflow: version bump
9
10 Package-Manager: Portage-3.0.18, Repoman-3.0.2
11 Signed-off-by: Sergey Popov <pinkbyte <AT> gentoo.org>
12
13 net-firewall/ipt_netflow/Manifest | 1 +
14 .../ipt_netflow/files/ipt_netflow-2.6-gentoo.patch | 61 ++++++++++++
15 net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild | 110 +++++++++++++++++++++
16 3 files changed, 172 insertions(+)
17
18 diff --git a/net-firewall/ipt_netflow/Manifest b/net-firewall/ipt_netflow/Manifest
19 index 595c50a16e3..a779559db91 100644
20 --- a/net-firewall/ipt_netflow/Manifest
21 +++ b/net-firewall/ipt_netflow/Manifest
22 @@ -1 +1,2 @@
23 DIST ipt_netflow-2.5.1.tar.gz 94627 BLAKE2B 440daed1f0c02e4700c6d4a97da08abc7bf51c73cd824a67fd2b7b9394b47d493ca7acfea34467d93cdce6dded2c5b24b4a2600b9f717aa54561d1f88a123dbc SHA512 dd0bde358f788f2d62ace6a0b1529128f0a686f9b776deeae3502d45d06d13971e8ea249d2647d00b00e73625c515bc12a4b7bd8d34fafd5f3b32f290d48cdce
24 +DIST ipt_netflow-2.6.tar.gz 95752 BLAKE2B 088c7030addd34d9d889cfa705aa060d0793e33be957deb3b703daea4229afc24f7268285ce336e425a024dc9d8139633a5206ff9d769c95cf71c156acbd4f25 SHA512 0ccea556e25dc6bc2d8c7648ed1b4ab366097baf5b06f167ccd19d2adb0a195ad652635181573785f9e9fa208d163f22b6527310eb939455d7ee3bc141cbeed5
25
26 diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.6-gentoo.patch b/net-firewall/ipt_netflow/files/ipt_netflow-2.6-gentoo.patch
27 new file mode 100644
28 index 00000000000..44dcfdec6d7
29 --- /dev/null
30 +++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.6-gentoo.patch
31 @@ -0,0 +1,61 @@
32 +--- a/Makefile.in 2021-05-27 12:57:29.600377496 +0300
33 ++++ b/Makefile.in 2021-05-27 12:58:55.111381725 +0300
34 +@@ -13,7 +13,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 +@@ -24,31 +24,31 @@
44 +
45 + ipt_NETFLOW.ko: version.h ipt_NETFLOW.c ipt_NETFLOW.h compat_def.h compat.h Makefile
46 + @echo Compiling $(shell ./version.sh) for kernel $(KVERSION)
47 +- make -C $(KDIR) M=$(CURDIR) modules
48 ++ $(MAKE) -C $(KDIR) M=$(CURDIR) modules
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 +@@ -68,10 +68,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.6.ebuild b/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
95 new file mode 100644
96 index 00000000000..97fce443ce9
97 --- /dev/null
98 +++ b/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
99 @@ -0,0 +1,110 @@
100 +# Copyright 1999-2021 Gentoo Authors
101 +# Distributed under the terms of the GNU General Public License v2
102 +
103 +EAPI=7
104 +
105 +inherit linux-info linux-mod toolchain-funcs
106 +
107 +DESCRIPTION="Netflow iptables module"
108 +HOMEPAGE="
109 + https://sourceforge.net/projects/ipt-netflow
110 + https://github.com/aabc/ipt-netflow
111 +"
112 +SRC_URI="https://github.com/aabc/ipt-netflow/archive/v${PV}.tar.gz -> ${P}.tar.gz"
113 +
114 +LICENSE="GPL-2"
115 +SLOT="0"
116 +KEYWORDS="~amd64 ~x86"
117 +
118 +IUSE="debug natevents snmp"
119 +
120 +RDEPEND="
121 + net-firewall/iptables:0=
122 + snmp? ( net-analyzer/net-snmp )
123 +"
124 +DEPEND="${RDEPEND}"
125 +BDEPEND="
126 + virtual/linux-sources
127 + virtual/pkgconfig
128 +"
129 +
130 +PATCHES=(
131 + "${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
132 + "${FILESDIR}/${PN}-2.6-gentoo.patch"
133 +)
134 +
135 +pkg_setup() {
136 + linux-info_pkg_setup
137 +
138 + local CONFIG_CHECK="BRIDGE_NETFILTER ~IP_NF_IPTABLES VLAN_8021Q"
139 + use debug && CONFIG_CHECK+=" ~DEBUG_FS"
140 + if use natevents; then
141 + CONFIG_CHECK+=" NF_CONNTRACK_EVENTS"
142 + if kernel_is lt 5 2; then
143 + CONFIG_CHECK+=" NF_NAT_NEEDED"
144 + else
145 + CONFIG_CHECK+=" NF_NAT"
146 + fi
147 + fi
148 +
149 + BUILD_TARGETS="all"
150 + MODULE_NAMES="ipt_NETFLOW(ipt_netflow:${S})"
151 + IPT_LIB="/usr/$(get_libdir)/xtables"
152 +
153 + linux-mod_pkg_setup
154 +}
155 +
156 +src_unpack() {
157 + default
158 +
159 + mv "${WORKDIR}"/${PN/_/-}-* "${WORKDIR}"/${P} || die
160 +}
161 +
162 +src_prepare() {
163 + default
164 +
165 + # Checking for directory is enough
166 + sed -i -e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' configure || die
167 +}
168 +
169 +do_conf() {
170 + tc-export CC
171 + echo ./configure $*
172 + ./configure $* ${EXTRA_ECONF} || die 'configure failed'
173 +}
174 +
175 +src_configure() {
176 + local IPT_VERSION="$($(tc-getPKG_CONFIG) --modversion xtables)"
177 + # this configure script is not based on autotools
178 + # ipt-src need to be defined, see bug #455984
179 + do_conf \
180 + --disable-dkms \
181 + --enable-aggregation \
182 + --enable-direction \
183 + --enable-macaddress \
184 + --enable-vlan \
185 + --ipt-lib="${IPT_LIB}" \
186 + --ipt-src="/usr/" \
187 + --ipt-ver="${IPT_VERSION}" \
188 + --kdir="${KV_DIR}" \
189 + --kver="${KV_FULL}" \
190 + $(use debug && echo '--enable-debugfs') \
191 + $(use natevents && echo '--enable-natevents') \
192 + $(use snmp && echo '--enable-snmp-rules' || echo '--disable-snmp-agent')
193 +}
194 +
195 +src_compile() {
196 + emake ARCH="$(tc-arch-kernel)" CC="$(tc-getCC)" LD="$(tc-getLD)" OBJDUMP="$(tc-getOBJDUMP)" all
197 +}
198 +
199 +src_install() {
200 + linux-mod_src_install
201 +
202 + use snmp && emake DESTDIR="${D}" SNMPTGSO="/usr/$(get_libdir)/snmp/dlmod/snmp_NETFLOW.so" sinstall
203 +
204 + exeinto "${IPT_LIB}"
205 + doexe libip{,6}t_NETFLOW.so
206 +
207 + doheader ipt_NETFLOW.h
208 + dodoc README*
209 +}