From 7e649483ea9146240164edb5a29d3bfa8ccc5eeb Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 7 May 2019 08:03:45 -0400 Subject: [PATCH] import perl-NNTPClient-0.37-5.el8 --- .gitignore | 1 + .perl-NNTPClient.metadata | 1 + ...ork-tests-only-if-EXTENDED_TESTING-1.patch | 96 +++++++++++++++++++ ...-Skip-tests-with-unportable-commands.patch | 72 ++++++++++++++ SPECS/perl-NNTPClient.spec | 72 ++++++++++++++ 5 files changed, 242 insertions(+) create mode 100644 .gitignore create mode 100644 .perl-NNTPClient.metadata create mode 100644 SOURCES/NNTPClient-0.37-Perform-network-tests-only-if-EXTENDED_TESTING-1.patch create mode 100644 SOURCES/NNTPClient-0.37-Skip-tests-with-unportable-commands.patch create mode 100644 SPECS/perl-NNTPClient.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8326755 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/NNTPClient-0.37.tar.gz diff --git a/.perl-NNTPClient.metadata b/.perl-NNTPClient.metadata new file mode 100644 index 0000000..f796a84 --- /dev/null +++ b/.perl-NNTPClient.metadata @@ -0,0 +1 @@ +0340afb1dd6eba853a3f6b537e5c92ee2d9376c0 SOURCES/NNTPClient-0.37.tar.gz diff --git a/SOURCES/NNTPClient-0.37-Perform-network-tests-only-if-EXTENDED_TESTING-1.patch b/SOURCES/NNTPClient-0.37-Perform-network-tests-only-if-EXTENDED_TESTING-1.patch new file mode 100644 index 0000000..9d290b5 --- /dev/null +++ b/SOURCES/NNTPClient-0.37-Perform-network-tests-only-if-EXTENDED_TESTING-1.patch @@ -0,0 +1,96 @@ +From 56ff427e14145772485cf04f174e436298d55836 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 16 Nov 2016 18:09:48 +0100 +Subject: [PATCH] Perform network tests only if EXTENDED_TESTING=1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Many tests require configured NNTP server. This is not true for many +cases. This patch skips them if EXTENDED_TESTING environment variable +is not true. The variable name is defined by +. + +Signed-off-by: Petr Písař +--- + test.pl | 46 ++++++++++++++++++++++++++++++---------------- + 1 file changed, 30 insertions(+), 16 deletions(-) + +diff --git a/test.pl b/test.pl +index 26a100c..d8e5e12 100644 +--- a/test.pl ++++ b/test.pl +@@ -6,7 +6,11 @@ + # Change 1..1 below to 1..last_test_to_print . + # (It may become useful if the test is moved to ./t subdirectory.) + +-BEGIN {print "1..37\n";} ++BEGIN { ++ my $test_plan = 7; ++ $test_plan += 30 if $ENV{EXTENDED_TESTING}; ++ print "1..$test_plan\n"; ++} + END {print "not ok 1\n" unless $loaded;} + use News::NNTPClient; + $loaded = 1; +@@ -18,19 +22,6 @@ print "ok 1\n"; + # (correspondingly "not ok 13") depending on the success of chunk 13 + # of the test code): + +-print <gmt(1); + $c->fourdigityear(1); + +-for $f (qw(version debug eol gmt fourdigityear message code +- ok okprint postok mode_reader list help)) { ++for $f (qw(version debug eol gmt fourdigityear message)) { ++ print "not " unless $c->$f(); ++ print "ok ", $i++, " ($f)\n"; ++} ++ ++# All test since here require an existing NNTP server ++if (!$ENV{EXTENDED_TESTING}) { ++ exit 0; ++} ++ ++print <$f(); + print "ok ", $i++, " ($f)\n"; + } + ++ + # slave not supported by inn + skip_500_ok(\$i, $c, 'slave'); + +-- +2.7.4 + diff --git a/SOURCES/NNTPClient-0.37-Skip-tests-with-unportable-commands.patch b/SOURCES/NNTPClient-0.37-Skip-tests-with-unportable-commands.patch new file mode 100644 index 0000000..5a327f9 --- /dev/null +++ b/SOURCES/NNTPClient-0.37-Skip-tests-with-unportable-commands.patch @@ -0,0 +1,72 @@ +From 3f53b5fe72fe888ab953bea2eac49ec9def7c6ad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 16 Nov 2016 13:28:26 +0100 +Subject: [PATCH] Skip tests with unportable commands +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch skips unportable tests whose return code is 500. It usually +mean the server does not suport it. + +Signed-off-by: Petr Písař +--- + test.pl | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +diff --git a/test.pl b/test.pl +index 4f21575..26a100c 100644 +--- a/test.pl ++++ b/test.pl +@@ -33,17 +33,32 @@ EOF + + $i = 2; + ++sub skip_500_ok { ++ my ($counter, $client, $function, @arguments) = @_; ++ my $status = $client->$function(@arguments); ++ my $code = $client->code(); ++ if ($code != 500) { ++ print "not " unless $status; ++ print "ok ", ${$counter}++, " ($f)\n"; ++ } else { ++ print "ok ", ${$counter}++, " # skip ($f is unsupported by the server)\n"; ++ } ++} ++ + $c = new News::NNTPClient; + + $c->gmt(1); + $c->fourdigityear(1); + + for $f (qw(version debug eol gmt fourdigityear message code +- ok okprint postok mode_reader list help slave)) { ++ ok okprint postok mode_reader list help)) { + print "not " unless $c->$f(); + print "ok ", $i++, " ($f)\n"; + } + ++# slave not supported by inn ++skip_500_ok(\$i, $c, 'slave'); ++ + print <xpath($msgid); +-print "ok ", $i++, " (xpath $msgid)\n"; ++skip_500_ok(\$i, $c, 'xpath', $msgid); + + for $f (qw(xgtitle xhdr xpat xover xmotd xthread xindex xsearch)) { +- print "not " unless $c->$f(); +- print "ok ", $i++, " ($f)\n"; ++ skip_500_ok(\$i, $c, $f); + } + + print <= 5.2.0 +BuildRequires: perl(Carp) +BuildRequires: perl(Socket) +BuildRequires: perl(strict) +BuildRequires: perl(vars) +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) + +# Do not scan documentation for dependencies +%{?perl_default_filter} + +%description +This module implements a client interface to NNTP, enabling a Perl 5 +application to talk to NNTP servers. It uses the Object Oriented +Programming interface. + +%prep +%setup -q -n NNTPClient-%{version} +%patch0 -p1 +%patch1 -p1 + +%build +perl Makefile.PL INSTALLDIRS=vendor +make %{?_smp_mflags} + +%install +make pure_install DESTDIR=$RPM_BUILD_ROOT +find $RPM_BUILD_ROOT -type f -name .packlist -delete +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +make test + +%files +%doc demos README +%{perl_vendorlib}/* +%{_mandir}/man3/* + +%changelog +* Thu Feb 08 2018 Fedora Release Engineering - 0.37-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.37-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sun Jun 04 2017 Jitka Plesnikova - 0.37-3 +- Perl 5.26 rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 0.37-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Nov 11 2016 Petr Pisar 0.37-1 +- Specfile autogenerated by cpanspec 1.78.