diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index 63257e8..07948d3 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ libwww-perl-5.834.tar.gz /libwww-perl-6.50.tar.gz /libwww-perl-6.51.tar.gz /libwww-perl-6.52.tar.gz +/libwww-perl-6.53.tar.gz diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..282e16b --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} diff --git a/perl-libwww-perl.rpmlintrc b/perl-libwww-perl.rpmlintrc new file mode 100644 index 0000000..3c67f8c --- /dev/null +++ b/perl-libwww-perl.rpmlintrc @@ -0,0 +1,2 @@ +from Config import * +addFilter("-tests.noarch: W: no-documentation"); diff --git a/perl-libwww-perl.spec b/perl-libwww-perl.spec index 01e87a8..05d53b3 100644 --- a/perl-libwww-perl.spec +++ b/perl-libwww-perl.spec @@ -4,7 +4,7 @@ %bcond_with perl_libwww_perl_enables_internet_test Name: perl-libwww-perl -Version: 6.52 +Version: 6.53 Release: 2%{?dist} Summary: A Perl interface to the World-Wide Web License: GPL+ or Artistic @@ -14,6 +14,7 @@ Source0: https://cpan.metacpan.org/authors/id/O/OA/OALDERS/libwww-perl-%{ Patch0: libwww-perl-6.39-Normalize-shebangs-in-examples.patch BuildArch: noarch BuildRequires: coreutils +BuildRequires: findutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter @@ -77,7 +78,7 @@ BuildRequires: perl(Config) BuildRequires: perl(File::Spec) BuildRequires: perl(File::Temp) BuildRequires: perl(FindBin) -BuildRequires: perl(HTTP::Daemon) >= 6 +BuildRequires: perl(HTTP::Daemon) >= 6.01 BuildRequires: perl(Test::Fatal) BuildRequires: perl(Test::More) >= 0.96 %if %{with perl_libwww_perl_enables_internet_test} @@ -128,6 +129,9 @@ Provides: perl(LWP::Debug::TraceHTTP::Socket) = %{version} Provides: perl(LWP::Protocol::http::Socket) = %{version} Provides: perl(LWP::Protocol::http::SocketMethods) = %{version} +# Remove underspecified dependencies +%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Authen::NTLM|Encode|File::Listing|HTTP::Cookies|HTTP::Daemon|HTTP::Date|HTTP::Negotiate|HTTP::Request|HTTP::Response|HTTP::Status|LWP::MediaTypes|MIME::Base64|Net::FTP|Net::HTTP|Test::More|URI|WWW::RobotRules)\\)$ + %description The libwww-perl collection is a set of Perl modules which provides a simple and consistent application programming interface to the World-Wide Web. The main @@ -135,16 +139,38 @@ focus of the library is to provide classes and functions that allow you to write WWW clients. The library also contain modules that are of more general use and even classes that help you implement simple HTTP servers. -# Remove underspecified dependencies -%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Authen::NTLM|Encode|File::Listing|HTTP::Date|HTTP::Negotiate|HTTP::Request|HTTP::Response|HTTP::Status|LWP::MediaTypes|MIME::Base64|Net::FTP|Net::HTTP|URI|WWW::RobotRules)\\)$ +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: coreutils +Requires: perl-Test-Harness +Requires: perl(HTTP::Cookies) >= 6 +Requires: perl(HTTP::Daemon) >= 6.01 +Requires: perl(HTTP::Request) >= 6 +Requires: perl(HTTP::Response) >= 6 +Requires: perl(Net::HTTP) >= 6.18 +Requires: perl(Test::More) >= 0.96 +%if %{with perl_libwww_perl_enables_internet_test} && %{with perl_libwww_perl_enables_optional_test} +Requires: perl(Test::LeakTrace) +%endif +Requires: perl(URI) >= 1.10 + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". %prep %setup -q -n libwww-perl-%{version} %patch0 -p1 %if !%{with perl_libwww_perl_enables_internet_test} -rm t/leak/no_leak.t t/redirect.t -perl -i -ne 'print $_ unless m{^(?:t/leak/no_leak\.t|t/redirect\.t)}' MANIFEST +rm t/base/protocols/nntp.t t/leak/no_leak.t t/redirect.t +perl -i -ne 'print $_ unless m{^(?:t/base/protocols/nntp\.t|t/leak/no_leak\.t|t/redirect\.t)}' MANIFEST %endif +# Help generators to recognize a Perl code +for F in $(find t -name '*.t') talk-to-ourself; do + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*\bperl}{$Config{startperl}}' "$F" + chmod +x "$F" +done %build # Install the aliases by default @@ -154,6 +180,22 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 --aliases < /de %install %{make_install} %{_fixperms} $RPM_BUILD_ROOT/* +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t talk-to-ourself %{buildroot}%{_libexecdir}/%{name} +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/bash +set -e +# t/local/http.t writes to CWD +DIR=$(mktemp -d) +cp -a %{_libexecdir}/%{name}/* "$DIR" +pushd "$DIR" +unset COVERAGE PERL_LWP_ENV_HTTP_TEST_SERVER_TIMEOUT PERL_LWP_ENV_HTTP_TEST_URL +prove -I . -j "$(getconf _NPROCESSORS_ONLN)" -r +popd +rm -r "$DIR" +EOF +chmod +x %{buildroot}%{_libexecdir}/%{name}/test %check unset COVERAGE PERL_LWP_ENV_HTTP_TEST_SERVER_TIMEOUT PERL_LWP_ENV_HTTP_TEST_URL @@ -169,7 +211,17 @@ make test %{_mandir}/man1/*.1* %{_mandir}/man3/*.3* +%files tests +%{_libexecdir}/%{name} + %changelog +* Tue Mar 09 2021 Petr Pisar - 6.53-2 +- Package talk-to-ourself script with the tests + +* Mon Mar 08 2021 Petr Pisar - 6.53-1 +- 6.53 bump +- Package tests + * Wed Jan 27 2021 Fedora Release Engineering - 6.52-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/plans/sanity.fmf b/plans/sanity.fmf new file mode 100644 index 0000000..a72ded4 --- /dev/null +++ b/plans/sanity.fmf @@ -0,0 +1,5 @@ +summary: Sanity tests +discover: + how: fmf +execute: + how: tmt diff --git a/sources b/sources index 5dd90d5..68e8e50 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libwww-perl-6.52.tar.gz) = e4b62a6b816d0231c69a83cf5243b3f3551200f10fb0e319ab062b17f3373576c75d4950588b1374f463a8e956f84220737b5187bfe056b2b194077023e9e7b9 +SHA512 (libwww-perl-6.53.tar.gz) = d45bba79bf2f3d49cf6b14591a58d04f551e0f6666e6bac32ec31018091590d5efe4313781605287dab22693bafa547dc916b010aafcc677a35a7c3a1154c8ff diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..3a6ec22 --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,4 @@ +summary: Upstream tests +component: perl-libwww-perl +require: perl-libwww-perl-tests +test: /usr/libexec/perl-libwww-perl/test