net-analyzer/pmacct: Fix building against >=nDPI-3.0
authorJeroen Roovers <jer@gentoo.org>
Sat, 28 Dec 2019 11:34:26 +0000 (12:34 +0100)
committerJeroen Roovers <jer@gentoo.org>
Sat, 28 Dec 2019 11:45:38 +0000 (12:45 +0100)
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Closes: https://bugs.gentoo.org/704072
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
net-analyzer/pmacct/files/pmacct-1.7.3-nDPI-3.0.patch [new file with mode: 0644]
net-analyzer/pmacct/pmacct-1.7.3-r1.ebuild [moved from net-analyzer/pmacct/pmacct-1.7.3.ebuild with 92% similarity]

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 (file)
index 0000000..3cffef2
--- /dev/null
@@ -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) {
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 5887b587804df86ec847586ba26f45f8e4580352..33e50e3e8313c8cc116b86ce44a7259286effde4 100644 (file)
@@ -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