commit:     491e75c9555192102acfda589f7a73193cfaafed
Author:     Kent Fredric <kentnl <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 21 14:20:41 2020 +0000
Commit:     Kent Fredric <kentnl <AT> gentoo <DOT> org>
CommitDate: Fri Aug 21 14:22:08 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=491e75c9

dev-perl/Feed-Find: -r bump for EAPI7 and a LOT of fixes

- EAPI7
- Convert 'sed' hack to a patch
- Strip bundled deps in inc/ which got used in testing and reported
  bogus warnings that will probably become fatal in future, in favour ot
  using system dependencies.
- Inhale a modified version of a set of patches submitted upstream that
  makes the http tests not require a live internet connection to be
  tested, at the cost of *many* dependencies. But manual steps are no
  longer required to properly test this \o/

Bug: https://github.com/btrott/Feed-Find/pull/2
Package-Manager: Portage-2.3.103, Repoman-2.3.22
Signed-off-by: Kent Fredric <kentnl <AT> gentoo.org>

 dev-perl/Feed-Find/Feed-Find-0.70.0-r3.ebuild      |  61 ++++++++++++
 .../files/Feed-Find-0.07-local-network.patch       | 109 +++++++++++++++++++++
 .../files/Feed-Find-0.07-no-dot-inc.patch          |  21 ++++
 3 files changed, 191 insertions(+)

diff --git a/dev-perl/Feed-Find/Feed-Find-0.70.0-r3.ebuild 
b/dev-perl/Feed-Find/Feed-Find-0.70.0-r3.ebuild
new file mode 100644
index 00000000000..3e1c6d265b5
--- /dev/null
+++ b/dev-perl/Feed-Find/Feed-Find-0.70.0-r3.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DIST_AUTHOR=BTROTT
+DIST_VERSION=0.07
+inherit perl-module
+
+DESCRIPTION="Syndication feed auto-discovery"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       dev-perl/Class-ErrorHandler
+       dev-perl/HTML-Parser
+       dev-perl/libwww-perl
+       dev-perl/URI
+"
+BDEPEND="${RDEPEND}
+       test? (
+               dev-perl/Test-Base
+               dev-perl/CGI-Application-Server
+               dev-perl/Test-HTTP-Server-Simple
+       )
+"
+PATCHES=(
+       "${FILESDIR}/${PN}-0.07-no-dot-inc.patch"
+       "${FILESDIR}/${PN}-0.07-local-network.patch"
+)
+PERL_RM_FILES=(
+       inc/Spiffy.pm
+       inc/Test/Base.pm
+       inc/Test/Base/Filter.pm
+       inc/Test/Builder.pm
+       inc/Test/Builder/Module.pm
+       inc/Test/More.pm
+)
+src_test() {
+       local MODULES=(
+               "Feed::Find ${DIST_VERSION}"
+       )
+       local failed=()
+       for dep in "${MODULES[@]}"; do
+               ebegin "Compile testing ${dep}"
+                       perl -Mblib="${S}" -M"${dep} ()" -e1
+               eend $? || failed+=( "$dep" )
+       done
+       if [[ ${failed[@]} ]]; then
+               echo
+               eerror "One or more modules failed compile:";
+               for dep in "${failed[@]}"; do
+                       eerror "  ${dep}"
+               done
+               die "Failing due to module compilation errors";
+       fi
+       perl-module_src_test
+}

diff --git a/dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch 
b/dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch
new file mode 100644
index 00000000000..4cf8f567547
--- /dev/null
+++ b/dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch
@@ -0,0 +1,109 @@
+From bea092aae37300053b971a12b6e37b6104df41f9 Mon Sep 17 00:00:00 2001
+From: Nikolay Mishin <m...@ya.ru>
+Date: Thu, 22 Oct 2015 02:59:04 +0400
+Subject: Rework 01-find.t
+
+Rework test to not rely on external web resources by mocking the setup
+with a HTTP::Server::Simple derived webserver
+
+Bug: https://github.com/btrott/Feed-Find/pull/2
+Signed-off-by: Gary Greene <gree...@tolharadys.net>
+Signed-off-by: Kent Fredric <ken...@gentoo.org>
+---
+ t/01-find.t                | 57 ++++++++++++++++++++++++++++++++------
+ t/htdocs/anchors-only.html |  9 ++++++
+ 2 files changed, 58 insertions(+), 8 deletions(-)
+ create mode 100644 t/htdocs/anchors-only.html
+
+diff --git a/t/01-find.t b/t/01-find.t
+index 58549b5..22d0048 100644
+--- a/t/01-find.t
++++ b/t/01-find.t
+@@ -1,20 +1,61 @@
++use CGI::Application::Server;
++use Test::HTTP::Server::Simple;
++
++package My::WebServer {
++    use base qw/Test::HTTP::Server::Simple CGI::Application::Server/;
++}
++
++package main;
++
+ use strict;
+-use Test::More tests => 4;
++use Test::More tests => 5;
+ use Feed::Find;
+ use LWP::UserAgent;
+ 
+-use constant BASE => 'http://stupidfool.org/perl/feeds/';
++my $port = $ENV{CGI_APP_SERVER_TEST_PORT} || 40000 + int(rand(10000));
++
++my $s = My::WebServer->new($port);
++$s->document_root('./t/htdocs');
++
++my $url_root = $s->started_ok("start up my web server");
++
++# generate our anchors-only.html file to get the URL correct in the links
++my $anchor_html = <<"END";
++<html>
++  <head>
++    <link rel="alternate" title="my feed"
++      href="$url_root/ok.xml" type="application/xml" />
++  <head>
++  <body>
++    <a href="$url_root/ok.xml" type="application/xml">my feed</a>
++  </body>
++</html>
++END
+ 
+-my(@feeds);
++open(my $fh, ">./t/htdocs/anchors-only.html") or
++  die "Cannot open file\n";
++print $fh <<"END";
++<html>
++  <head>
++    <link rel="alternate" title="my feed"
++      href="$url_root/ok.xml" type="application/xml" />
++  <head>
++  <body>
++    <a href="$url_root/ok.xml" type="application/xml">my feed</a>
++  </body>
++</html>
++END
++close $fh;
+ 
+-@feeds = Feed::Find->find(BASE . 'anchors-only.html');
++my @feeds = ();
++@feeds = Feed::Find->find("$url_root/anchors-only.html");
+ is(scalar @feeds, 1);
+-is($feeds[0], BASE . 'ok.xml');
++is($feeds[0], "$url_root/ok.xml");
+ 
+ my $ua = LWP::UserAgent->new;
+ $ua->env_proxy;
+-my $req = HTTP::Request->new(GET => BASE . 'anchors-only.html');
++my $req = HTTP::Request->new(GET => "$url_root/anchors-only.html");
+ my $res = $ua->request($req);
+-@feeds = Feed::Find->find_in_html(\$res->content, BASE . 'anchors-only.html');
++@feeds = Feed::Find->find_in_html(\$res->content, 
"$url_root/anchors-only.html");
+ is(scalar @feeds, 1);
+-is($feeds[0], BASE . 'ok.xml');
++is($feeds[0], "$url_root/ok.xml");
+diff --git a/t/htdocs/anchors-only.html b/t/htdocs/anchors-only.html
+new file mode 100644
+index 0000000..79f1df8
+--- /dev/null
++++ b/t/htdocs/anchors-only.html
+@@ -0,0 +1,9 @@
++<html>
++  <head>
++    <link rel="alternate" title="my feed"
++      href="http://localhost:45578/ok.xml"; type="application/xml" />
++  <head>
++  <body>
++    <a href="http://localhost:45578/ok.xml"; type="application/xml">my feed</a>
++  </body>
++</html>
+-- 
+2.28.0
+

diff --git a/dev-perl/Feed-Find/files/Feed-Find-0.07-no-dot-inc.patch 
b/dev-perl/Feed-Find/files/Feed-Find-0.07-no-dot-inc.patch
new file mode 100644
index 00000000000..ae60d0f1f7b
--- /dev/null
+++ b/dev-perl/Feed-Find/files/Feed-Find-0.07-no-dot-inc.patch
@@ -0,0 +1,21 @@
+From b624dda904b26792464697a1c5e7b210be410eff Mon Sep 17 00:00:00 2001
+From: Kent Fredric <ken...@gentoo.org>
+Date: Fri, 21 Aug 2020 21:06:23 +1200
+Subject: Include '.' in @INC for perl 5.26+
+
+---
+ Makefile.PL | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index 64e091c..34b5c67 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -1,3 +1,4 @@
++use lib q[.];
+ use inc::Module::Install;
+ name 'Feed-Find';
+ all_from 'lib/Feed/Find.pm';
+-- 
+2.28.0
+

Reply via email to