summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Popov <pinkbyte@gentoo.org>2021-05-27 13:01:51 +0300
committerSergey Popov <pinkbyte@gentoo.org>2021-05-27 13:01:51 +0300
commit490a3ecbbc4e4e43a7e1b4d2253490f1ca169212 (patch)
tree3b5c489d29932e90d1f12ba0bc1f96ae82954d12 /net-firewall/ipt_netflow
parentnet-libs/libyang: Security cleanup (diff)
downloadgentoo-490a3ecbbc4e4e43a7e1b4d2253490f1ca169212.tar.gz
gentoo-490a3ecbbc4e4e43a7e1b4d2253490f1ca169212.tar.bz2
gentoo-490a3ecbbc4e4e43a7e1b4d2253490f1ca169212.zip
net-firewall/ipt_netflow: version bump
Package-Manager: Portage-3.0.18, Repoman-3.0.2 Signed-off-by: Sergey Popov <pinkbyte@gentoo.org>
Diffstat (limited to 'net-firewall/ipt_netflow')
-rw-r--r--net-firewall/ipt_netflow/Manifest1
-rw-r--r--net-firewall/ipt_netflow/files/ipt_netflow-2.6-gentoo.patch61
-rw-r--r--net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild110
3 files changed, 172 insertions, 0 deletions
diff --git a/net-firewall/ipt_netflow/Manifest b/net-firewall/ipt_netflow/Manifest
index 595c50a16e33..a779559db91a 100644
--- a/net-firewall/ipt_netflow/Manifest
+++ b/net-firewall/ipt_netflow/Manifest
@@ -1 +1,2 @@
DIST ipt_netflow-2.5.1.tar.gz 94627 BLAKE2B 440daed1f0c02e4700c6d4a97da08abc7bf51c73cd824a67fd2b7b9394b47d493ca7acfea34467d93cdce6dded2c5b24b4a2600b9f717aa54561d1f88a123dbc SHA512 dd0bde358f788f2d62ace6a0b1529128f0a686f9b776deeae3502d45d06d13971e8ea249d2647d00b00e73625c515bc12a4b7bd8d34fafd5f3b32f290d48cdce
+DIST ipt_netflow-2.6.tar.gz 95752 BLAKE2B 088c7030addd34d9d889cfa705aa060d0793e33be957deb3b703daea4229afc24f7268285ce336e425a024dc9d8139633a5206ff9d769c95cf71c156acbd4f25 SHA512 0ccea556e25dc6bc2d8c7648ed1b4ab366097baf5b06f167ccd19d2adb0a195ad652635181573785f9e9fa208d163f22b6527310eb939455d7ee3bc141cbeed5
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
new file mode 100644
index 000000000000..44dcfdec6d7b
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.6-gentoo.patch
@@ -0,0 +1,61 @@
+--- a/Makefile.in 2021-05-27 12:57:29.600377496 +0300
++++ b/Makefile.in 2021-05-27 12:58:55.111381725 +0300
+@@ -13,7 +13,7 @@
+ SNMPTGSO = /usr/lib/snmp/dlmod/snmp_NETFLOW.so
+ SNMPCONF = /etc/snmp/snmpd.conf
+ SNMPLINE = dlmod netflow $(SNMPTGSO)
+-CC = gcc
++CC ?= gcc
+
+ # https://www.kernel.org/doc/Documentation/kbuild/modules.txt
+ # https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt
+@@ -24,31 +24,31 @@
+
+ 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)
+- make -C $(KDIR) M=$(CURDIR) modules
++ $(MAKE) -C $(KDIR) M=$(CURDIR) modules
+ @touch $@
+ compat_def.h: gen_compat_def
+ ./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)
+- make -C $(KDIR) M=$(CURDIR) modules C=1
++ $(MAKE) -C $(KDIR) M=$(CURDIR) modules C=1
+ @touch ipt_NETFLOW.ko
+ coverity:
+ coverity-submit -v
+
+ minstall: | ipt_NETFLOW.ko
+ @echo " *"
+- make -C $(KDIR) M=$(CURDIR) modules_install INSTALL_MOD_PATH=$(DESTDIR)
++ $(MAKE) -C $(KDIR) M=$(CURDIR) modules_install INSTALL_MOD_PATH=$(DESTDIR)
+ $(DEPMOD)
+ mclean:
+- make -C $(KDIR) M=$(CURDIR) clean
++ $(MAKE) -C $(KDIR) M=$(CURDIR) clean
+ lclean:
+ -rm -f *.so *_sh.o
+ clean: mclean lclean
+ -rm -f *.so *.o modules.order version.h compat_def.h
+
+ snmp_NETFLOW.so: snmp_NETFLOW.c
+- $(CC) -fPIC -shared -o $@ $< -lnetsnmp
++ $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -shared -o $@ $< -lnetsnmp
+
+ sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my
+ @echo " *"
+@@ -68,10 +68,10 @@
+ fi
+
+ %_sh.o: libipt_NETFLOW.c
+- $(CC) $(CFLAGS) -O2 -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) $(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.ebuild b/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
new file mode 100644
index 000000000000..97fce443ce9b
--- /dev/null
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-info linux-mod toolchain-funcs
+
+DESCRIPTION="Netflow iptables module"
+HOMEPAGE="
+ https://sourceforge.net/projects/ipt-netflow
+ https://github.com/aabc/ipt-netflow
+"
+SRC_URI="https://github.com/aabc/ipt-netflow/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="debug 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}-2.6-gentoo.patch"
+)
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ local CONFIG_CHECK="BRIDGE_NETFILTER ~IP_NF_IPTABLES VLAN_8021Q"
+ use debug && CONFIG_CHECK+=" ~DEBUG_FS"
+ 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
+
+ BUILD_TARGETS="all"
+ MODULE_NAMES="ipt_NETFLOW(ipt_netflow:${S})"
+ IPT_LIB="/usr/$(get_libdir)/xtables"
+
+ linux-mod_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ mv "${WORKDIR}"/${PN/_/-}-* "${WORKDIR}"/${P} || die
+}
+
+src_prepare() {
+ default
+
+ # 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 debug && echo '--enable-debugfs') \
+ $(use natevents && echo '--enable-natevents') \
+ $(use snmp && echo '--enable-snmp-rules' || echo '--disable-snmp-agent')
+}
+
+src_compile() {
+ emake ARCH="$(tc-arch-kernel)" CC="$(tc-getCC)" LD="$(tc-getLD)" OBJDUMP="$(tc-getOBJDUMP)" all
+}
+
+src_install() {
+ linux-mod_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
+ dodoc README*
+}