commit:     11112a2abcc28eba84d3eb9a09b5b111e8d84980
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  7 07:15:54 2020 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Tue Jul  7 07:47:11 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11112a2a

net-analyzer/fragroute: Fix library checks again

- Remove library checks from configure
- Completely override *LIB definitions
- Set BDEPEND

Package-Manager: Portage-2.3.103, Repoman-2.3.23
Closes: https://bugs.gentoo.org/show_bug.cgi?id=731174
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 .../fragroute/files/fragroute-1.2.6-libdir.patch   | 160 +++++++++++++++++++++
 ...e-1.2.6-r2.ebuild => fragroute-1.2.6-r3.ebuild} |  19 ++-
 2 files changed, 174 insertions(+), 5 deletions(-)

diff --git a/net-analyzer/fragroute/files/fragroute-1.2.6-libdir.patch 
b/net-analyzer/fragroute/files/fragroute-1.2.6-libdir.patch
new file mode 100644
index 00000000000..69fa067859a
--- /dev/null
+++ b/net-analyzer/fragroute/files/fragroute-1.2.6-libdir.patch
@@ -0,0 +1,160 @@
+--- a/configure.in
++++ b/configure.in
+@@ -22,157 +22,12 @@
+ AC_PROG_LN_S
+ AC_PROG_RANLIB
+ 
+-dnl XXX - we need MingW32 under Cygwin for win32
+-AC_CYGWIN
+-if test "$CYGWIN" = yes ; then
+-   if test -d /usr/include/mingw; then
+-      CPPFLAGS="$CPPFLAGS -mno-cygwin"
+-      CFLAGS="$CFLAGS -mno-cygwin"
+-      AC_DEFINE(WIN32_LEAN_AND_MEAN, 1, 
+-          [Define for faster code generation.])
+-      AC_DEFINE(snprintf, _snprintf, [Use MingW32's internal snprintf])
+-      AC_DEFINE(vsnprintf, _vsnprintf, [Use MingW32's internal vsnprintf])
+-   else
+-      AC_MSG_ERROR([need MingW32 package to build under Cygwin])
+-   fi
+-   dnl XXX - use our internal event-win32 hack
+-   EVENTINC="-I${srcdir}/win32"
+-   AC_LIBOBJ([event-win32])
+-   AC_SUBST(EVENTINC)
+-
+-else
+-dnl XXX - BEGIN !CYGWIN
+-
+-
+-dnl Checks for libevent
+-AC_MSG_CHECKING(for libevent)
+-AC_ARG_WITH(libevent,
+-[  --with-libevent=DIR     use libevent in DIR],
+-[ case "$withval" in
+-  yes|no)
+-     AC_MSG_RESULT(no)
+-     ;;
+-  *)
+-     AC_MSG_RESULT($withval)
+-     if test -f $withval/include/event.h -a -f $withval/lib/libevent.so; then
+-        owd=`pwd`
+-        if cd $withval; then withval=`pwd`; cd $owd; fi
+-        EVENTINC="-I$withval/include"
+-        EVENTLIB="-L$withval/lib -levent"
+-     elif test -f $withval/include/event.h -a -f $withval/lib64/libevent.so; 
then
+-        owd=`pwd`
+-        if cd $withval; then withval=`pwd`; cd $owd; fi
+-        EVENTINC="-I$withval/include"
+-        EVENTLIB="-L$withval/lib64 -levent"
+-     elif test -f $withval/event.h -a -f $withval/libevent.so; then
+-        owd=`pwd`
+-        if cd $withval; then withval=`pwd`; cd $owd; fi
+-        EVENTINC="-I$withval"
+-        EVENTLIB="-L$withval -levent"
+-     else
+-        AC_ERROR(event.h or libevent.so not found in $withval)
+-     fi
+-     ;;
+-  esac ],
+-[ if test -f ${prefix}/include/event.h -a -f ${prefix}/lib/libevent.so; then
+-     EVENTINC="-I${prefix}/include"
+-     EVENTLIB="-L${prefix}/lib -levent"
+-  elif test -f ${prefix}/include/event.h -a -f ${prefix}/lib64/libevent.so; 
then
+-     EVENTINC="-I${prefix}/include"
+-     EVENTLIB="-L${prefix}/lib64 -levent"
+-  else
+-     AC_MSG_RESULT(no)
+-     AC_ERROR(libevent not found)
+-  fi
+-  AC_MSG_RESULT(yes) ]
+-)
+ AC_SUBST(EVENTINC)
+ AC_SUBST(EVENTLIB)
+ 
+-dnl XXX - END !CYGWIN
+-fi
+-
+-dnl Checks for libpcap
+-AC_MSG_CHECKING(for libpcap)
+-AC_ARG_WITH(libpcap,
+-[  --with-libpcap=DIR      use libpcap in DIR],
+-[ case "$withval" in
+-  yes|no)
+-     AC_MSG_RESULT(no)
+-     ;;
+-  *)
+-     AC_MSG_RESULT($withval)
+-     if test -f $withval/pcap.h -a -f $withval/libpcap.so; then
+-        owd=`pwd`
+-        if cd $withval; then withval=`pwd`; cd $owd; fi
+-      PCAPINC="-I$withval -I$withval/bpf"
+-      PCAPLIB="-L$withval -lpcap"
+-     elif test -f $withval/include/pcap.h -a \
+-             -f $withval/include/pcap-bpf.h; then
+-      owd=`pwd`
+-      if cd $withval; then withval=`pwd`; cd $owd; fi
+-      PCAPINC="-I$withval/include"
+-      if test -f $withval/lib/libwpcap.a; then
+-         PCAPLIB="-L$withval/lib -lwpcap"
+-      else
+-         PCAPLIB="-L$withval/lib -lpcap"
+-        fi
+-     else
+-        AC_ERROR(pcap.h, pcap-bpf.h, or libpcap.so not found in $withval)
+-     fi
+-     ;;
+-  esac ],
+-[ if test -f ${prefix}/include/pcap.h; then
+-     PCAPINC="-I${prefix}/include"
+-     if test -f ${prefix}/lib/libwpcap.a; then
+-      PCAPLIB="-L${prefix}/lib -lwpcap"
+-     else
+-        PCAPLIB="-L${prefix}/lib -lpcap"
+-     fi
+-  elif test -f /usr/include/pcap/pcap.h; then
+-     PCAPINC="-I/usr/include/pcap"
+-     PCAPLIB="-lpcap"
+-  elif test -f /usr/include/pcap.h; then
+-     PCAPLIB="-lpcap"
+-  else
+-     AC_MSG_RESULT(no)
+-     AC_ERROR(libpcap not found)
+-  fi
+-  AC_MSG_RESULT(yes) ]
+-)
+ AC_SUBST(PCAPINC)
+ AC_SUBST(PCAPLIB)
+ 
+-dnl Checks for (installed) libdnet
+-AC_MSG_CHECKING(for libdnet)
+-AC_ARG_WITH(libdnet,
+-[  --with-libdnet=DIR      use libdnet in DIR],
+-[ case "$withval" in
+-  yes|no)
+-     AC_MSG_RESULT(no)
+-     ;;
+-  *)
+-     AC_MSG_RESULT($withval)
+-     if test -f $withval/src/libdnet.so; then
+-      DNETINC="-I$withval/include"
+-      DNETLIB="-L$withval/src -ldnet `$withval/dnet-config --libs`"
+-     elif test -x $withval/bin/dnet-config; then
+-      DNETINC="`$withval/bin/dnet-config --cflags`"
+-      DNETLIB="`$withval/bin/dnet-config --libs`"
+-     else
+-        AC_ERROR(dnet-config not found in $withval/bin)
+-     fi
+-     ;;
+-  esac ],
+-[ if test -x ${prefix}/bin/dnet-config; then
+-     DNETINC="`${prefix}/bin/dnet-config --cflags`"
+-     DNETLIB="`${prefix}/bin/dnet-config --libs`"
+-  else
+-     AC_MSG_RESULT(no)
+-     AC_ERROR(libdnet not found)
+-  fi
+-  AC_MSG_RESULT(yes) ]
+-)
+ AC_SUBST(DNETINC)
+ AC_SUBST(DNETLIB)
+ 

diff --git a/net-analyzer/fragroute/fragroute-1.2.6-r2.ebuild 
b/net-analyzer/fragroute/fragroute-1.2.6-r3.ebuild
similarity index 82%
rename from net-analyzer/fragroute/fragroute-1.2.6-r2.ebuild
rename to net-analyzer/fragroute/fragroute-1.2.6-r3.ebuild
index 1043d0fd987..60b3c08bfca 100644
--- a/net-analyzer/fragroute/fragroute-1.2.6-r2.ebuild
+++ b/net-analyzer/fragroute/fragroute-1.2.6-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -16,32 +16,41 @@ SLOT="0"
 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
 
 RDEPEND="
+       >=dev-libs/libdnet-1.12[ipv6]
        dev-libs/libevent:=
        net-libs/libpcap
-       >=dev-libs/libdnet-1.12[ipv6]
 "
 DEPEND="
        ${RDEPEND}
+"
+BDEPEND="
        virtual/awk
 "
 DOCS=( INSTALL README TODO )
 PATCHES=(
+       "${FILESDIR}"/${P}-libdir.patch
        "${FILESDIR}"/${P}-pcap_open.patch
 )
 S="${WORKDIR}/${MY_P}"
 
 src_prepare() {
        default
+
        # Remove broken and old files, autotools will regen needed files
        rm *.m4 acconfig.h missing Makefile.in || die
+
        # Add missing includes
        sed -i -e "/#define IPUTIL_H/a#include <stdio.h>\n#include <stdint.h>" 
iputil.h || die
+
        eautoreconf
 }
 
 src_configure() {
        econf \
-               --with-libdnet="${EPREFIX}"/usr \
-               --with-libevent="${EPREFIX}"/usr \
-               --with-libpcap="${EPREFIX}"/usr
+               DNETINC='' \
+               DNETLIB=-ldnet \
+               EVENTINC='' \
+               EVENTLIB=-levent \
+               PCAPINC='' \
+               PCAPLIB=-lpcap
 }

Reply via email to