commit: dce4676e2a72b19764edcc5cc7054325585d3937 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> AuthorDate: Wed Jul 15 05:42:00 2020 +0000 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> CommitDate: Wed Jul 15 06:50:30 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dce4676e
net-libs/libcrafter: Version 0.3_p20171019 Package-Manager: Portage-2.3.103, Repoman-2.3.23 Closes: https://bugs.gentoo.org/show_bug.cgi?id=731194 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org> net-libs/libcrafter/Manifest | 1 + .../files/libcrafter-0.3_p20171019-libpcap.patch | 59 ++++++++++++++++++++++ .../libcrafter/libcrafter-0.3_p20171019.ebuild | 40 +++++++++++++++ 3 files changed, 100 insertions(+) diff --git a/net-libs/libcrafter/Manifest b/net-libs/libcrafter/Manifest index 25c940facf9..df8d69a25ea 100644 --- a/net-libs/libcrafter/Manifest +++ b/net-libs/libcrafter/Manifest @@ -1 +1,2 @@ DIST libcrafter-0.3.tar.gz 104051 BLAKE2B 6349c260d32ab6f270c05c156dbcf7cf20e85808ce7b8df8747fa9d6e1d413f96c12ff55b3c227952b348f2654cde81b5ca73753da61a9593c3c1699ed96bd7d SHA512 7c396ba942b304dddfaa569adb44697f75568d3ef2ed48dda758e281f3b7c172439309033bbf5498069a4a61a952f93e41af99b129ce874ce76b5ec08da58116 +DIST libcrafter-0.3_p20171019.tar.xz 90152 BLAKE2B 4837a98a45ecdf924a63e916fd2cfdd481624c0cb5b673e0b43eaace328cbcb761ac2d09c50242602730ec2c69ceb8836b7092cbd286c887819db2095ceba749 SHA512 eb53ed641abbce3555f6b7bc3756bc9dc45068bf58320ba0f78dbcefc04cbfe669b12625c81a185fa377bf89e8453b52e0f9bef5c9e1ebfae34bc56eca090438 diff --git a/net-libs/libcrafter/files/libcrafter-0.3_p20171019-libpcap.patch b/net-libs/libcrafter/files/libcrafter-0.3_p20171019-libpcap.patch new file mode 100644 index 00000000000..252a71db47c --- /dev/null +++ b/net-libs/libcrafter/files/libcrafter-0.3_p20171019-libpcap.patch @@ -0,0 +1,59 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -12,6 +12,8 @@ + AC_PROG_CXX + LT_INIT([disable-static]) + ++PKG_PROG_PKG_CONFIG ++ + AC_CHECK_TYPE(u_int32_t, uint32_t) + AC_CHECK_TYPE(u_int64_t, uint64_t) + AC_CHECK_TYPE(u_int16_t, uint16_t) +@@ -20,46 +22,7 @@ + AC_CANONICAL_HOST + + ## 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.a; 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/net/bpf.h -a \ +- -f $withval/lib/libpcap.a; then +- owd=`pwd` +- if cd $withval; then withval=`pwd`; cd $owd; fi +- PCAPINC="-I$withval/include" +- PCAPLIB="-L$withval/lib -lpcap" +- else +- AC_ERROR(pcap.h, net/bpf.h, or libpcap.a not found in $withval) +- fi +- ;; +- esac ], +-[ if test -f ${prefix}/include/pcap.h; then +- PCAPINC="-I${prefix}/include" +- PCAPLIB="-L${prefix}/lib -lpcap" +- 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) ] +-) ++PKG_CHECK_MODULES([PCAP], [libpcap], [PCAPINC="${PCAP_CFLAGS}"; PCAPLIB="${PCAP_LIBS}"],AC_MSG_ERROR([libpcap is required])) + AC_SUBST(PCAPINC) + AC_SUBST(PCAPLIB) + AC_CHECK_LIB([pcap], [pcap_set_immediate_mode], diff --git a/net-libs/libcrafter/libcrafter-0.3_p20171019.ebuild b/net-libs/libcrafter/libcrafter-0.3_p20171019.ebuild new file mode 100644 index 00000000000..e9f0d9bec4a --- /dev/null +++ b/net-libs/libcrafter/libcrafter-0.3_p20171019.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit autotools + +DESCRIPTION="A high level C++ network packet sniffing and crafting library" +HOMEPAGE="https://github.com/pellegre/libcrafter" +SRC_URI="https://dev.gentoo.org/~jer/${P}.tar.xz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="static-libs" + +RDEPEND=" + net-libs/libpcap +" +DEPEND=" + ${RDEPEND} +" +S=${WORKDIR}/${PN} +PATCHES=( + "${FILESDIR}"/${PN}-0.3_p20171019-libpcap.patch +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + econf $(use_enable static-libs static) +} + +src_install() { + default + + find "${ED}" -name '*.la' -delete || die +}
