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/
Date: Mon, 25 Feb 2019 19:19:51
Message-Id: 1551122384.2c9b6f7f3d620333ebeb6cdd7f9a121715f42b76.jer@gentoo
1 commit: 2c9b6f7f3d620333ebeb6cdd7f9a121715f42b76
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 25 19:18:05 2019 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 25 19:19:44 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c9b6f7f
7
8 net-firewall/ipt_netflow: Add live ebuild
9
10 Package-Manager: Portage-2.3.62, Repoman-2.3.12
11 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
12
13 net-firewall/ipt_netflow/ipt_netflow-9999.ebuild | 96 ++++++++++++++++++++++++
14 1 file changed, 96 insertions(+)
15
16 diff --git a/net-firewall/ipt_netflow/ipt_netflow-9999.ebuild b/net-firewall/ipt_netflow/ipt_netflow-9999.ebuild
17 new file mode 100644
18 index 00000000000..a40ff34ae21
19 --- /dev/null
20 +++ b/net-firewall/ipt_netflow/ipt_netflow-9999.ebuild
21 @@ -0,0 +1,96 @@
22 +# Copyright 1999-2019 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +inherit git-r3 linux-info linux-mod toolchain-funcs
27 +
28 +DESCRIPTION="Netflow iptables module"
29 +HOMEPAGE="
30 + https://sourceforge.net/projects/ipt-netflow
31 + https://github.com/aabc/ipt-netflow
32 +"
33 +EGIT_REPO_URI="https://github.com/aabc/ipt-netflow"
34 +
35 +LICENSE="GPL-2"
36 +SLOT="0"
37 +KEYWORDS=""
38 +
39 +IUSE="debug natevents snmp"
40 +
41 +RDEPEND="
42 + net-firewall/iptables:0=
43 + snmp? ( net-analyzer/net-snmp )
44 +"
45 +DEPEND="${RDEPEND}
46 + virtual/linux-sources
47 + virtual/pkgconfig
48 +"
49 +
50 +# set S before MODULE_NAMES
51 +PATCHES=(
52 + "${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
53 +)
54 +
55 +pkg_setup() {
56 + BUILD_TARGETS="all"
57 + MODULE_NAMES="ipt_NETFLOW(ipt_netflow:${S})"
58 + IPT_LIB="/usr/$(get_libdir)/xtables"
59 + local CONFIG_CHECK="~IP_NF_IPTABLES"
60 + use debug && CONFIG_CHECK+=" ~DEBUG_FS"
61 + use natevents && CONFIG_CHECK+=" NF_CONNTRACK_EVENTS NF_NAT_NEEDED"
62 + linux-mod_pkg_setup
63 +}
64 +
65 +src_prepare() {
66 + sed -i \
67 + -e 's:make -C:$(MAKE) -C:g' \
68 + -e 's:gcc -O2:$(CC) $(CFLAGS) $(LDFLAGS):' \
69 + -e 's:gcc:$(CC) $(CFLAGS) $(LDFLAGS):' \
70 + Makefile.in || die
71 +
72 + # Fix incorrect module version in sources
73 + sed -i -e "/IPT_NETFLOW_VERSION/s/2.2/${PV}/" ipt_NETFLOW.c || die
74 +
75 + # Checking for directory is enough
76 + sed -i -e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' configure || die
77 +
78 + default
79 +}
80 +
81 +do_conf() {
82 + echo ./configure $*
83 + ./configure $* ${EXTRA_ECONF} || die 'configure failed'
84 +}
85 +
86 +src_configure() {
87 + local IPT_VERSION="$($(tc-getPKG_CONFIG) --modversion xtables)"
88 + # this configure script is not based on autotools
89 + # ipt-src need to be defined, see bug #455984
90 + do_conf \
91 + --disable-dkms \
92 + --enable-aggregation \
93 + --enable-direction \
94 + --enable-macaddress \
95 + --enable-vlan \
96 + --ipt-lib="${IPT_LIB}" \
97 + --ipt-src="/usr/" \
98 + --ipt-ver="${IPT_VERSION}" \
99 + --kdir="${KV_DIR}" \
100 + --kver="${KV_FULL}" \
101 + $(use debug && echo '--enable-debugfs') \
102 + $(use natevents && echo '--enable-natevents') \
103 + $(use snmp && echo '--enable-snmp-rules' || echo '--disable-snmp-agent')
104 +}
105 +
106 +src_compile() {
107 + emake ARCH="$(tc-arch-kernel)" CC="$(tc-getCC)" all
108 +}
109 +
110 +src_install() {
111 + linux-mod_src_install
112 + exeinto "${IPT_LIB}"
113 + doexe libipt_NETFLOW.so
114 + use snmp && emake DESTDIR="${D}" SNMPTGSO="/usr/$(get_libdir)/snmp/dlmod/snmp_NETFLOW.so" sinstall
115 + doheader ipt_NETFLOW.h
116 + dodoc README*
117 +}