commit:     4b863caa2a14604924729dbb227a1949e32dbdfe
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Nov  5 13:45:03 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Nov  5 14:08:01 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4b863caa

net-libs/nDPI: fail when libpcap can't be found

Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../nDPI/files/nDPI-3.4-configure-fail-libcap.patch   | 19 +++++++++++++++++++
 net-libs/nDPI/nDPI-3.4.ebuild                         |  4 +++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/net-libs/nDPI/files/nDPI-3.4-configure-fail-libcap.patch 
b/net-libs/nDPI/files/nDPI-3.4-configure-fail-libcap.patch
new file mode 100644
index 00000000000..7ae5a04d4e8
--- /dev/null
+++ b/net-libs/nDPI/files/nDPI-3.4-configure-fail-libcap.patch
@@ -0,0 +1,19 @@
+Ensure that we fail if libpcap can't be detected, rather than exiting with a 
success return code.
+--- a/configure.seed
++++ b/configure.seed
+@@ -126,12 +126,9 @@ case "$host" in
+          AC_CHECK_LIB([dl], [dlopen, dlsym],   
[DL_LIB="-ldl"],[AC_CHECK_LIB([c], [dlopen, dlsym], 
[DL_LIB="-lc"],[AC_MSG_ERROR([unable to find the dlopen(), dlsym() functions]) 
]) ])
+       else
+          AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"])
+-       if test $ac_cv_lib_pcap_pcap_open_live = "no"; then :
+-            echo ""
+-            echo "ERROR: Missing libpcap(-dev) library required to compile 
the example application"
+-            echo "ERROR: Please install it and try again"
+-            exit
+-       fi
++         if test $ac_cv_lib_pcap_pcap_open_live = "no"; then :
++            AC_MSG_ERROR([Cannot find libpcap which is required to compile 
the example application])
++         fi
+       fi
+       ;;
+ esac

diff --git a/net-libs/nDPI/nDPI-3.4.ebuild b/net-libs/nDPI/nDPI-3.4.ebuild
index 39a1a4c8a57..cb053734cf3 100644
--- a/net-libs/nDPI/nDPI-3.4.ebuild
+++ b/net-libs/nDPI/nDPI-3.4.ebuild
@@ -19,6 +19,7 @@ RDEPEND="${DEPEND}"
 
 PATCHES=(
        "${FILESDIR}/${PN}-3.4-fix-oob-in-kerberos-dissector.patch"
+       "${FILESDIR}/${PN}-3.4-configure-fail-libcap.patch"
 )
 
 src_prepare() {
@@ -27,6 +28,8 @@ src_prepare() {
        eval $(grep '^NDPI_PATCH=' autogen.sh)
        NDPI_VERSION_SHORT="${NDPI_MAJOR}.${NDPI_MINOR}.${NDPI_PATCH}"
 
+       default
+
        sed \
                -e "s/@NDPI_MAJOR@/${NDPI_MAJOR}/g" \
                -e "s/@NDPI_MINOR@/${NDPI_MINOR}/g" \
@@ -40,7 +43,6 @@ src_prepare() {
                -e "s%^libdir\s*=\s*\${prefix}/lib\s*$%libdir     = 
\${prefix}/$(get_libdir)%" \
                src/lib/Makefile.in || die
 
-       default
        eautoreconf
 
        # Taken from autogen.sh (bug #704074):

Reply via email to