From 279adbeeec72611d631ceb9d24de1675c93bcef4 Mon Sep 17 00:00:00 2001 From: Jeroen Roovers Date: Sat, 28 Dec 2019 12:34:26 +0100 Subject: [PATCH] net-analyzer/pmacct: Fix building against >=nDPI-3.0 Package-Manager: Portage-2.3.84, Repoman-2.3.20 Closes: https://bugs.gentoo.org/704072 Signed-off-by: Jeroen Roovers --- .../pmacct/files/pmacct-1.7.3-nDPI-3.0.patch | 28 +++++++++++++++++++ ...ct-1.7.3.ebuild => pmacct-1.7.3-r1.ebuild} | 12 ++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 net-analyzer/pmacct/files/pmacct-1.7.3-nDPI-3.0.patch rename net-analyzer/pmacct/{pmacct-1.7.3.ebuild => pmacct-1.7.3-r1.ebuild} (92%) diff --git a/net-analyzer/pmacct/files/pmacct-1.7.3-nDPI-3.0.patch b/net-analyzer/pmacct/files/pmacct-1.7.3-nDPI-3.0.patch new file mode 100644 index 000000000000..3cffef25862f --- /dev/null +++ b/net-analyzer/pmacct/files/pmacct-1.7.3-nDPI-3.0.patch @@ -0,0 +1,28 @@ +--- a/./configure.ac ++++ b/./configure.ac +@@ -955,6 +955,7 @@ + CFLAGS="$_save_CFLAGS" + ]) + PKG_CHECK_MODULES([NDPI26], [libndpi >= 2.6], [AC_DEFINE(WITH_NDPI26, 1)], [AC_DEFINE(WITH_NDPI, 1)]) ++ PKG_CHECK_MODULES([NDPI30], [libndpi >= 3.0], [AC_DEFINE(WITH_NDPI30, 1)], [AC_DEFINE(WITH_NDPI, 1)]) + ;; + no) + AC_MSG_RESULT(no) +--- a/./src/ndpi/ndpi.c ++++ b/./src/ndpi/ndpi.c +@@ -374,10 +374,14 @@ + if (flow->detection_completed || flow->tcp_finished) { + if (flow->detected_protocol.app_protocol == NDPI_PROTOCOL_UNKNOWN) + #ifdef WITH_NDPI26 ++#ifdef WITH_NDPI30 ++ flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct, flow->ndpi_flow, 1, workflow->prefs.protocol_guess); ++#else + flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct, flow->ndpi_flow, workflow->prefs.protocol_guess); ++#endif /* WITH_NDPI30 */ + #else + flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct, flow->ndpi_flow); +-#endif ++#endif /* WITH_NDPI26 */ + + if (workflow->prefs.protocol_guess) { + if (flow->detected_protocol.app_protocol == NDPI_PROTOCOL_UNKNOWN && !flow->guess_completed) { diff --git a/net-analyzer/pmacct/pmacct-1.7.3.ebuild b/net-analyzer/pmacct/pmacct-1.7.3-r1.ebuild similarity index 92% rename from net-analyzer/pmacct/pmacct-1.7.3.ebuild rename to net-analyzer/pmacct/pmacct-1.7.3-r1.ebuild index 5887b587804d..33e50e3e8313 100644 --- a/net-analyzer/pmacct/pmacct-1.7.3.ebuild +++ b/net-analyzer/pmacct/pmacct-1.7.3-r1.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit flag-o-matic toolchain-funcs +inherit autotools flag-o-matic toolchain-funcs DESCRIPTION="A network tool to gather IP traffic information" HOMEPAGE="http://www.pmacct.net/" @@ -32,7 +32,7 @@ RDEPEND="