[gentoo-commits] repo/gentoo:master commit in: dev-perl/Net-Pcap/, dev-perl/Net-Pcap/files/

2019-08-24 Thread Jeroen Roovers
commit: e9af315c8c78839177c0bee41ad17d7a3600d4ab
Author: Jeroen Roovers  gentoo  org>
AuthorDate: Sat Aug 24 11:49:47 2019 +
Commit: Jeroen Roovers  gentoo  org>
CommitDate: Sat Aug 24 11:53:07 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9af315c

dev-perl/Net-Pcap: Fix building against net-libs/libpcap-1.9.0

Package-Manager: Portage-2.3.72, Repoman-2.3.17
Fixes: https://bugs.gentoo.org/661726
Signed-off-by: Jeroen Roovers  gentoo.org>

 dev-perl/Net-Pcap/Net-Pcap-0.180.0-r1.ebuild   | 34 ++
 .../files/Net-Pcap-0.18-libpcap-1.9.0.patch| 41 ++
 2 files changed, 75 insertions(+)

diff --git a/dev-perl/Net-Pcap/Net-Pcap-0.180.0-r1.ebuild 
b/dev-perl/Net-Pcap/Net-Pcap-0.180.0-r1.ebuild
new file mode 100644
index 000..e3b237b2e2b
--- /dev/null
+++ b/dev-perl/Net-Pcap/Net-Pcap-0.180.0-r1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DIST_AUTHOR=SAPER
+DIST_VERSION=0.18
+DIST_EXAMPLES=( "eg/*" )
+inherit perl-module
+
+DESCRIPTION="Interface to the pcap(3) LBL packet capture library"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="net-libs/libpcap
+   dev-perl/IO-Interface"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+   "${FILESDIR}/${PN}-${DIST_VERSION}-libpcap-1.9.0.patch"
+   "${FILESDIR}/${PN}-${DIST_VERSION}-test-error.patch"
+)
+
+src_test() {
+   if [[ $EUID != 0 ]]; then
+   elog "Comprehensive testing of this module requires root 
permissions."
+   elog "For details, see:"
+   elog 
"https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/${CATEGORY}/${PN};
+   fi
+   perl_rm_files t/pod{,cover,spell}.t t/distchk.t t/portfs.t
+   perl-module_src_test
+}

diff --git a/dev-perl/Net-Pcap/files/Net-Pcap-0.18-libpcap-1.9.0.patch 
b/dev-perl/Net-Pcap/files/Net-Pcap-0.18-libpcap-1.9.0.patch
new file mode 100644
index 000..2495600e5d0
--- /dev/null
+++ b/dev-perl/Net-Pcap/files/Net-Pcap-0.18-libpcap-1.9.0.patch
@@ -0,0 +1,41 @@
+--- a/Makefile.PL
 b/Makefile.PL
+@@ -106,7 +106,7 @@ REASON
+ # We also store the list of available functions in a file for skipping the 
+ # corresponding tests. 
+ my @funcs = have_functions(find_functions());
+-$options{DEFINE} .= cpp_defines(@funcs);
++$options{DEFINE} .= cpp_defines(@funcs). "-DHAVE_PCAP_SETSAMPLING";
+ open(FUNCS, '>funcs.txt') or warn "warning: can't write 'funcs.txt': $!\n";
+ print FUNCS join("\n", @funcs), "\n";
+ close(FUNCS);
+--- a/stubs.inc
 b/stubs.inc
+@@ -354,11 +354,6 @@ int pcap_parsesrcstr(const char *source,
+ #ifdef _MSC_VER
+ #pragma message( "Warning: the function pcap_open() is not available" )
+ #endif
+-struct pcap_rmtauth {
+-int type;
+-char *username;
+-char *password;
+-};
+ 
+ pcap_t * pcap_open(const char *source, int snaplen, int flags, int 
read_timeout, struct pcap_rmtauth *auth, char *err);
+ pcap_t * pcap_open(const char *source, int snaplen, int flags, int 
read_timeout, struct pcap_rmtauth *auth, char *err) {
+@@ -511,6 +511,7 @@ HANDLE pcap_getevent(pcap_t *p) {
+ #ifdef _MSC_VER
+ #pragma message( "Warning: the function pcap_setsampling() is not available" )
+ #endif
++#if 0
+ struct pcap_samp {
+ int method;
+ int value;
+@@ -522,6 +523,7 @@ struct pcap_samp *pcap_setsampling(pcap_
+ return NULL;
+ }
+ #endif
++#endif
+ 
+ 
+ /*



[gentoo-commits] repo/gentoo:master commit in: dev-perl/Net-Pcap/, dev-perl/Net-Pcap/files/

2017-12-11 Thread Kent Fredric
commit: 71b3ea1713fe69a7ef8a0bcf820d3bf18178908f
Author: Kent Fredric  gentoo  org>
AuthorDate: Fri Dec  8 06:22:41 2017 +
Commit: Kent Fredric  gentoo  org>
CommitDate: Mon Dec 11 19:27:33 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71b3ea17

dev-perl/Net-Pcap: Bump to version 0.180.0

- EAPI6
- Add USE=examples
- Fix DESCRIPTION
- Disable silly author tests
- Fix tests against newer pcaps
- Enable tests
- Document comprehensive test notes

Upstream:
- Fix limitation of having only 1 callback function
- Add pcap_offline_filter()
- Add interop tests
- Add fixes for old Test::More's
- Append CCFLAGS instead of overriding

Package-Manager: Portage-2.3.14, Repoman-2.3.6

 dev-perl/Net-Pcap/Manifest |  1 +
 dev-perl/Net-Pcap/Net-Pcap-0.180.0.ebuild  | 33 ++
 .../Net-Pcap/files/Net-Pcap-0.18-test-error.patch  | 39 ++
 3 files changed, 73 insertions(+)

diff --git a/dev-perl/Net-Pcap/Manifest b/dev-perl/Net-Pcap/Manifest
index 390ed6867cd..01d2ffeadf2 100644
--- a/dev-perl/Net-Pcap/Manifest
+++ b/dev-perl/Net-Pcap/Manifest
@@ -1 +1,2 @@
 DIST Net-Pcap-0.17.tar.gz 92853 BLAKE2B 
147f0a11be36e7b5022f138611ad4226ea36d61902e966ab3400463aed4aecfd0022852df2589f363a6590270750b427cac9532f22a42e18d0f959a23e990ff1
 SHA512 
14747661b220b119b4182f13dbc1509cae5665e77588dbc8576f7d959f33ef6ee3785f2d9022093c1f1b808c37d04ee313f5ac39cc6eaa917962c9215c5a4de6
+DIST Net-Pcap-0.18.tar.gz 94207 BLAKE2B 
257e2b7c5bf6ad05936b64171db3ee530249f40d695ca2aba21d4bfe4796989e3a4aa955472b9c39e33aab5d67d2eebb26b43e173dbd359d01201926fa3a6b6e
 SHA512 
63cc216345eb65b1e76efa657623c9d444d20f4b54ab0c75e787483baaa4f1de7e3a9294967aa7eccbdca04c60b089194dd7e0d19838f899b332c5881a8c7f6d

diff --git a/dev-perl/Net-Pcap/Net-Pcap-0.180.0.ebuild 
b/dev-perl/Net-Pcap/Net-Pcap-0.180.0.ebuild
new file mode 100644
index 000..0c7010719f0
--- /dev/null
+++ b/dev-perl/Net-Pcap/Net-Pcap-0.180.0.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DIST_AUTHOR=SAPER
+DIST_VERSION=0.18
+DIST_EXAMPLES=( "eg/*" )
+inherit perl-module eutils
+
+DESCRIPTION="Interface to the pcap(3) LBL packet capture library"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="net-libs/libpcap
+   dev-perl/IO-Interface"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+   "${FILESDIR}/${PN}-${DIST_VERSION}-test-error.patch"
+)
+
+src_test() {
+   if [[ $EUID != 0 ]]; then
+   elog "Comprehensive testing of this module requires root 
permissions."
+   elog "For details, see:"
+   elog 
"https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/${CATEGORY}/${PN};
+   fi
+   perl_rm_files t/pod{,cover,spell}.t t/distchk.t t/portfs.t
+   perl-module_src_test
+}

diff --git a/dev-perl/Net-Pcap/files/Net-Pcap-0.18-test-error.patch 
b/dev-perl/Net-Pcap/files/Net-Pcap-0.18-test-error.patch
new file mode 100644
index 000..1bd8af5e87a
--- /dev/null
+++ b/dev-perl/Net-Pcap/files/Net-Pcap-0.18-test-error.patch
@@ -0,0 +1,39 @@
+From 7c831efcb06d6254e54423cdcd95bebbb7725270 Mon Sep 17 00:00:00 2001
+From: Kent Fredric 
+Date: Fri, 8 Dec 2017 17:52:13 +1300
+Subject: Allow error message to be a suffix
+
+Previously, the error message emitted by the native calls was of the
+form:
+
+'syntax error'
+
+However, more recently the error message takes the form:
+
+'syntax error in filter expression: syntax error'
+
+This patch pretends the part before the ":" is functionally equivalent
+to a line start, for the purposes of testing.
+
+Bug: https://github.com/maddingue/Net-Pcap/issues/8
+Bug: https://github.com/maddingue/Net-Pcap/pull/9
+---
+ t/09-error.t | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/t/09-error.t b/t/09-error.t
+index 90337b8..eee679d 100644
+--- a/t/09-error.t
 b/t/09-error.t
+@@ -22,7 +22,7 @@ is(   $@,   '', "compile() with an invalid filter string" );
+ is(   $res, -1, " - result must not be null: $res" );
+ eval { $err = Net::Pcap::geterr($pcap) };
+ is(   $@,   '', "geterr()" );
+-like( $err, '/^(?:parse|syntax) error$/', " - \$err must not be null: $err" );
++like( $err, '/(^|: )(?:parse|syntax) error$/', " - \$err must not be null: 
$err" );
+ 
+ # Testing compile() with a valid filter
+ eval { $res = Net::Pcap::compile($pcap, \$filter, "tcp", 0, $mask) };
+-- 
+2.14.3
+