Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/libnids/files/, net-libs/libnids/
Date: Sun, 06 Sep 2020 20:07:49
Message-Id: 1599422863.7d53382788c01a83443fad67473898c478cdd4c4.jer@gentoo
1 commit: 7d53382788c01a83443fad67473898c478cdd4c4
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 6 20:06:16 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 6 20:07:43 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d533827
7
8 net-libs/libnids: Strip libdir from linker flags
9
10 Package-Manager: Portage-3.0.5, Repoman-3.0.1
11 Closes: https://bugs.gentoo.org/740708
12 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
13
14 net-libs/libnids/files/libnids-1.24-libdir.patch | 44 ++++++++++++++++++
15 net-libs/libnids/libnids-1.24-r7.ebuild | 58 ++++++++++++++++++++++++
16 2 files changed, 102 insertions(+)
17
18 diff --git a/net-libs/libnids/files/libnids-1.24-libdir.patch b/net-libs/libnids/files/libnids-1.24-libdir.patch
19 new file mode 100644
20 index 00000000000..578d9001d16
21 --- /dev/null
22 +++ b/net-libs/libnids/files/libnids-1.24-libdir.patch
23 @@ -0,0 +1,44 @@
24 +--- a/configure.in
25 ++++ b/configure.in
26 +@@ -69,7 +69,7 @@
27 + owd=`pwd`
28 + if cd $withval; then withval=`pwd`; cd $owd; fi
29 + PCAP_CFLAGS="-I$withval -I$withval/bpf"
30 +- PCAPLIB="-L$withval -lpcap"
31 ++ PCAPLIB="-lpcap"
32 + else
33 + AC_ERROR(pcap.h or libpcap.a not found in $withval)
34 + fi
35 +@@ -77,7 +77,7 @@
36 + esac ],
37 + [ if test -f ${prefix}/include/pcap.h; then
38 + PCAP_CFLAGS="-I${prefix}/include"
39 +- PCAPLIB="-L${exec_prefix}/lib -lpcap"
40 ++ PCAPLIB="-lpcap"
41 + elif test -f /usr/include/pcap/pcap.h; then
42 + PCAP_CFLAGS="-I/usr/include/pcap"
43 + PCAPLIB="-lpcap"
44 +@@ -146,12 +146,12 @@
45 + owd=`pwd`
46 + if cd $withval; then withval=`pwd`; cd $owd; fi
47 + LNET_CFLAGS="-I$withval/include `$withval/libnet-config --defines`"
48 +- LNETLIB="-L$withval/lib -lnet"
49 ++ LNETLIB="-lnet"
50 + elif test -f $withval/include/libnet.h -a -f $withval/src/libnet.a; then
51 + owd=`pwd`
52 + if cd $withval; then withval=`pwd`; cd $owd; fi
53 + LNET_CFLAGS="-I$withval/include"
54 +- LNETLIB="-L$withval/src -lnet"
55 ++ LNETLIB="-lnet"
56 + else
57 + 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"
58 + AC_ERROR(libnet)
59 +@@ -163,7 +163,7 @@
60 + else
61 + if test -f ${prefix}/include/libnet.h -a ${exec_prefix}/lib/libnet.a ; then
62 + LNET_CFLAGS="-I${prefix}/include `${exec_prefix}/bin/libnet-config --defines 2>/dev/null`"
63 +- LNETLIB="-L${exec_prefix}/lib -lnet"
64 ++ LNETLIB="-lnet"
65 + else
66 + LNET_CFLAGS="`libnet-config --defines 2>/dev/null`"
67 + LNETLIB="-lnet"
68
69 diff --git a/net-libs/libnids/libnids-1.24-r7.ebuild b/net-libs/libnids/libnids-1.24-r7.ebuild
70 new file mode 100644
71 index 00000000000..09d5cfe6dc0
72 --- /dev/null
73 +++ b/net-libs/libnids/libnids-1.24-r7.ebuild
74 @@ -0,0 +1,58 @@
75 +# Copyright 1999-2020 Gentoo Authors
76 +# Distributed under the terms of the GNU General Public License v2
77 +
78 +EAPI=7
79 +inherit autotools flag-o-matic toolchain-funcs
80 +
81 +DESCRIPTION="an implementation of an E-component of Network Intrusion Detection System"
82 +HOMEPAGE="http://libnids.sourceforge.net/"
83 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
84 +
85 +LICENSE="GPL-2"
86 +SLOT="1.2"
87 +KEYWORDS="~amd64 ~ppc ~x86"
88 +IUSE="+glib +libnet static-libs"
89 +
90 +RDEPEND="
91 + !net-libs/libnids:1.1
92 + net-libs/libpcap
93 + glib? ( dev-libs/glib:2 )
94 + libnet? ( >=net-libs/libnet-1.1.0-r3 )
95 +"
96 +DEPEND="
97 + ${RDEPEND}
98 + glib? ( virtual/pkgconfig )
99 +"
100 +PATCHES=(
101 + "${FILESDIR}"/${P}-ldflags.patch
102 + "${FILESDIR}"/${P}-libdir.patch
103 + "${FILESDIR}"/${P}-static-libs.patch
104 +)
105 +
106 +src_prepare() {
107 + default
108 + eautoconf
109 +}
110 +
111 +src_configure() {
112 + tc-export AR
113 + append-flags -fno-strict-aliasing
114 +
115 + econf \
116 + --enable-shared \
117 + $(usex glib '' --disable-libglib) \
118 + $(use_enable libnet)
119 +}
120 +
121 +src_compile() {
122 + emake shared $(usex static-libs static '')
123 +}
124 +
125 +src_install() {
126 + local tgt
127 + for tgt in _installshared $(usex static-libs _install ''); do
128 + emake install_prefix="${D}" ${tgt}
129 + done
130 +
131 + dodoc CHANGES CREDITS MISC README doc/*
132 +}