commit:     7d53382788c01a83443fad67473898c478cdd4c4
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  6 20:06:16 2020 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sun Sep  6 20:07:43 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d533827

net-libs/libnids: Strip libdir from linker flags

Package-Manager: Portage-3.0.5, Repoman-3.0.1
Closes: https://bugs.gentoo.org/740708
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 net-libs/libnids/files/libnids-1.24-libdir.patch | 44 ++++++++++++++++++
 net-libs/libnids/libnids-1.24-r7.ebuild          | 58 ++++++++++++++++++++++++
 2 files changed, 102 insertions(+)

diff --git a/net-libs/libnids/files/libnids-1.24-libdir.patch 
b/net-libs/libnids/files/libnids-1.24-libdir.patch
new file mode 100644
index 00000000000..578d9001d16
--- /dev/null
+++ b/net-libs/libnids/files/libnids-1.24-libdir.patch
@@ -0,0 +1,44 @@
+--- a/configure.in
++++ b/configure.in
+@@ -69,7 +69,7 @@
+         owd=`pwd`
+         if cd $withval; then withval=`pwd`; cd $owd; fi
+       PCAP_CFLAGS="-I$withval -I$withval/bpf"
+-      PCAPLIB="-L$withval -lpcap"
++      PCAPLIB="-lpcap"
+      else
+         AC_ERROR(pcap.h or libpcap.a not found in $withval)
+      fi
+@@ -77,7 +77,7 @@
+   esac ],
+ [ if test -f ${prefix}/include/pcap.h; then
+      PCAP_CFLAGS="-I${prefix}/include"
+-     PCAPLIB="-L${exec_prefix}/lib -lpcap"
++     PCAPLIB="-lpcap"
+   elif test -f /usr/include/pcap/pcap.h; then
+      PCAP_CFLAGS="-I/usr/include/pcap"
+      PCAPLIB="-lpcap"
+@@ -146,12 +146,12 @@
+         owd=`pwd`
+         if cd $withval; then withval=`pwd`; cd $owd; fi
+       LNET_CFLAGS="-I$withval/include `$withval/libnet-config --defines`"
+-      LNETLIB="-L$withval/lib -lnet"
++      LNETLIB="-lnet"
+      elif test -f $withval/include/libnet.h -a -f $withval/src/libnet.a; then
+         owd=`pwd`
+         if cd $withval; then withval=`pwd`; cd $owd; fi
+       LNET_CFLAGS="-I$withval/include"
+-      LNETLIB="-L$withval/src -lnet"
++      LNETLIB="-lnet"
+      else
+       echo "A working combination of libnet.h, libnet.a and libnet-config not 
found in $withval; get libnet from www.packetfactory.net/projects/libnet and 
reinstall"
+         AC_ERROR(libnet)
+@@ -163,7 +163,7 @@
+   else
+       if test -f ${prefix}/include/libnet.h -a ${exec_prefix}/lib/libnet.a ; 
then
+            LNET_CFLAGS="-I${prefix}/include `${exec_prefix}/bin/libnet-config 
--defines 2>/dev/null`"
+-           LNETLIB="-L${exec_prefix}/lib -lnet"
++           LNETLIB="-lnet"
+       else
+            LNET_CFLAGS="`libnet-config --defines 2>/dev/null`"
+            LNETLIB="-lnet"

diff --git a/net-libs/libnids/libnids-1.24-r7.ebuild 
b/net-libs/libnids/libnids-1.24-r7.ebuild
new file mode 100644
index 00000000000..09d5cfe6dc0
--- /dev/null
+++ b/net-libs/libnids/libnids-1.24-r7.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools flag-o-matic toolchain-funcs
+
+DESCRIPTION="an implementation of an E-component of Network Intrusion 
Detection System"
+HOMEPAGE="http://libnids.sourceforge.net/";
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="1.2"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="+glib +libnet static-libs"
+
+RDEPEND="
+       !net-libs/libnids:1.1
+       net-libs/libpcap
+       glib? ( dev-libs/glib:2 )
+       libnet? ( >=net-libs/libnet-1.1.0-r3 )
+"
+DEPEND="
+       ${RDEPEND}
+       glib? ( virtual/pkgconfig )
+"
+PATCHES=(
+       "${FILESDIR}"/${P}-ldflags.patch
+       "${FILESDIR}"/${P}-libdir.patch
+       "${FILESDIR}"/${P}-static-libs.patch
+)
+
+src_prepare() {
+       default
+       eautoconf
+}
+
+src_configure() {
+       tc-export AR
+       append-flags -fno-strict-aliasing
+
+       econf \
+               --enable-shared \
+               $(usex glib '' --disable-libglib) \
+               $(use_enable libnet)
+}
+
+src_compile() {
+       emake shared $(usex static-libs static '')
+}
+
+src_install() {
+       local tgt
+       for tgt in _installshared $(usex static-libs _install ''); do
+               emake install_prefix="${D}" ${tgt}
+       done
+
+       dodoc CHANGES CREDITS MISC README doc/*
+}

Reply via email to