net-libs/libpcap: pcap-config: Do not hardcode includedir
authorJeroen Roovers <jer@gentoo.org>
Sat, 24 Aug 2019 10:10:50 +0000 (12:10 +0200)
committerJeroen Roovers <jer@gentoo.org>
Sat, 24 Aug 2019 10:11:32 +0000 (12:11 +0200)
Package-Manager: Portage-2.3.72, Repoman-2.3.17
Bug: https://bugs.gentoo.org/692772
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
net-libs/libpcap/files/libpcap-1.9.0-pcap-config-includedir.patch [new file with mode: 0644]
net-libs/libpcap/libpcap-1.9.0-r1.ebuild [new file with mode: 0644]
net-libs/libpcap/libpcap-9999.ebuild

diff --git a/net-libs/libpcap/files/libpcap-1.9.0-pcap-config-includedir.patch b/net-libs/libpcap/files/libpcap-1.9.0-pcap-config-includedir.patch
new file mode 100644 (file)
index 0000000..cd2c9fe
--- /dev/null
@@ -0,0 +1,36 @@
+--- a/pcap-config.in
++++ b/pcap-config.in
+@@ -59,13 +59,13 @@
+       #
+       if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
+       then
+-              echo "-I$includedir -L$libdir -lpcap $LIBS"
++              echo "-L$libdir -lpcap $LIBS"
+       elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
+       then
+-              echo "-I$includedir -L$libdir $LIBS"
++              echo "-L$libdir $LIBS"
+       elif [ "$show_cflags" = 1 ]
+       then
+-              echo "-I$includedir"
++              echo ""
+       elif [ "$show_libs" = 1 ]
+       then
+               echo "-L$libdir -lpcap $LIBS"
+@@ -80,13 +80,13 @@
+       #
+       if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
+       then
+-              echo "-I$includedir -L$libdir $RPATH -l$PACKAGE_NAME"
++              echo "-L$libdir $RPATH -l$PACKAGE_NAME"
+       elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
+       then
+-              echo "-I$includedir"
++              echo ""
+       elif [ "$show_cflags" = 1 ]
+       then
+-              echo "-I$includedir"
++              echo ""
+       elif [ "$show_libs" = 1 ]
+       then
+               echo "-L$libdir $RPATH -l$PACKAGE_NAME"
diff --git a/net-libs/libpcap/libpcap-1.9.0-r1.ebuild b/net-libs/libpcap/libpcap-1.9.0-r1.ebuild
new file mode 100644 (file)
index 0000000..4d5a012
--- /dev/null
@@ -0,0 +1,78 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools multilib-minimal ltprune
+
+DESCRIPTION="A system-independent library for user-level network packet capture"
+HOMEPAGE="
+       http://www.tcpdump.org/
+       https://github.com/the-tcpdump-group/libpcap
+"
+SRC_URI="
+       https://github.com/the-tcpdump-group/${PN}/archive/${P/_}.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE="bluetooth dbus netlink static-libs usb"
+
+RDEPEND="
+       bluetooth? ( net-wireless/bluez:=[${MULTILIB_USEDEP}] )
+       dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+       netlink? ( dev-libs/libnl:3[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+       ${RDEPEND}
+       sys-devel/flex
+       virtual/yacc
+       dbus? ( virtual/pkgconfig[${MULTILIB_USEDEP}] )
+"
+
+S=${WORKDIR}/${PN}-${P/_}
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.6.1-prefix-solaris.patch
+       "${FILESDIR}"/${PN}-1.8.1-darwin.patch
+       "${FILESDIR}"/${PN}-1.8.1-usbmon.patch
+       "${FILESDIR}"/${PN}-1.9.0-pcap-config-includedir.patch
+)
+
+src_prepare() {
+       default
+
+       echo ${PV} > VERSION || die
+
+       eautoreconf
+}
+
+multilib_src_configure() {
+       ECONF_SOURCE="${S}" \
+       econf \
+               $(use_enable bluetooth) \
+               $(use_enable usb) \
+               $(use_enable dbus) \
+               $(use_with netlink libnl) \
+               --enable-ipv6
+}
+
+multilib_src_compile() {
+       emake all shared
+}
+
+multilib_src_install_all() {
+       dodoc CREDITS CHANGES VERSION TODO README.* doc/README.*
+
+       # remove static libraries (--disable-static does not work)
+       if ! use static-libs; then
+               find "${ED}" -name '*.a' -exec rm {} + || die
+       fi
+       prune_libtool_files
+
+       # We need this to build pppd on G/FBSD systems
+       if [[ "${USERLAND}" == "BSD" ]]; then
+               insinto /usr/include
+               doins pcap-int.h portability.h
+       fi
+}
index 35c308e5a2be1e572f5e8a56186cdba0cc84bcab..3e6c9db1d11518152b337b5abd50b2201d1b6134 100644 (file)
@@ -30,6 +30,7 @@ DEPEND="
 "
 
 PATCHES=(
+       "${FILESDIR}"/${PN}-1.9.0-pcap-config-includedir.patch
        "${FILESDIR}"/${PN}-9999-prefix-darwin.patch
 )