commit:     279adbeeec72611d631ceb9d24de1675c93bcef4
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 28 11:34:26 2019 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sat Dec 28 11:45:38 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=279adbee

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 <jer <AT> gentoo.org>

 .../pmacct/files/pmacct-1.7.3-nDPI-3.0.patch       | 28 ++++++++++++++++++++++
 ...{pmacct-1.7.3.ebuild => pmacct-1.7.3-r1.ebuild} | 12 ++++++++--
 2 files changed, 38 insertions(+), 2 deletions(-)

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 00000000000..3cffef25862
--- /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 5887b587804..33e50e3e831 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="
                <dev-libs/mongo-c-driver-0.98
        )
        mysql? ( dev-db/mysql-connector-c:0= )
-       ndpi? ( net-libs/nDPI )
+       ndpi? ( net-libs/nDPI:= )
        nflog? ( net-libs/libnetfilter_log )
        postgres? ( dev-db/postgresql:* )
        rabbitmq? ( net-libs/rabbitmq-c )
@@ -43,12 +43,20 @@ DEPEND="
        ${RDEPEND}
        virtual/pkgconfig
 "
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.7.3-nDPI-3.0.patch
+)
 
 DOCS=(
        CONFIG-KEYS ChangeLog FAQS QUICKSTART UPGRADE
        docs/INTERNALS docs/PLUGINS docs/SIGNALS
 )
 
+src_prepare() {
+       default
+       eautoreconf
+}
+
 src_configure() {
        tc-export CC AR RANLIB
        append-cppflags -DMYSQL_SERVER_VERSION=99999999

Reply via email to