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 e51429a..89ddecf 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /Net-HTTP-6.18.tar.gz /Net-HTTP-6.19.tar.gz /Net-HTTP-6.20.tar.gz +/Net-HTTP-6.21.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-Net-HTTP.rpmlintrc b/perl-Net-HTTP.rpmlintrc new file mode 100644 index 0000000..9ea2894 --- /dev/null +++ b/perl-Net-HTTP.rpmlintrc @@ -0,0 +1,2 @@ +from Config import * +addFilter("-tests\.noarch: W: no-documentatio"); diff --git a/perl-Net-HTTP.spec b/perl-Net-HTTP.spec index fddaeba..a007e40 100644 --- a/perl-Net-HTTP.spec +++ b/perl-Net-HTTP.spec @@ -6,8 +6,8 @@ %{bcond_without perl_Net_HTTP_enables_ssl} Name: perl-Net-HTTP -Version: 6.20 -Release: 2%{?dist} +Version: 6.21 +Release: 1%{?dist} Summary: Low-level HTTP connection (client) License: GPL+ or Artistic URL: https://metacpan.org/release/Net-HTTP @@ -18,6 +18,7 @@ BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(:VERSION) >= 5.6.2 +BuildRequires: perl(Config) BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 BuildRequires: perl(Getopt::Long) BuildRequires: perl(strict) @@ -32,6 +33,7 @@ BuildRequires: perl(IO::Socket::IP) BuildRequires: perl(IO::Socket) %endif %if %{with perl_Net_HTTP_enables_ssl} +# IO::Socket::SSL or Net::SSL BuildRequires: perl(IO::Socket::SSL) >= 2.012 %endif BuildRequires: perl(IO::Uncompress::Gunzip) @@ -66,8 +68,31 @@ Net::HTTP class represents a connection to an HTTP server. The HTTP protocol is described in RFC 2616. The Net::HTTP class supports HTTP/1.0 and HTTP/1.1. +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness +%if %{with perl_Net_HTTP_enables_network_test} +%if %{with perl_Net_HTTP_enables_ssl} +Requires: perl(IO::Socket::SSL) >= 2.012 +%endif +%endif + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + %prep %setup -q -n Net-HTTP-%{version} +%if %{without perl_Net_HTTP_enables_network_test} +rm t/live*.t +perl -i -ne 'print $_ unless m{^t/live.*\.t}' MANIFEST +%endif +# Help generators to recognize a Perl code +for F in t/*.t; do + perl -i -MConfig -pe 'print qq{$Config{startperl}\n} if $. == 1 && !s{\A#!.*\bperl}{$Config{startperl}}' "$F" + chmod +x "$F" +done %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 @@ -76,9 +101,18 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 %install %{make_install} %{_fixperms} $RPM_BUILD_ROOT/* +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t %{buildroot}%{_libexecdir}/%{name} +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/sh +set -e +cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)" +EOF +chmod +x %{buildroot}%{_libexecdir}/%{name}/test %check -export NO_NETWORK_TESTING=%{without perl_Net_HTTP_enables_network_test} +export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') make test %files @@ -87,7 +121,14 @@ make test %{perl_vendorlib}/* %{_mandir}/man3/* +%files tests +%{_libexecdir}/%{name} + %changelog +* Fri Mar 19 2021 Petr Pisar - 6.21-1 +- 6.21 bump +- Package tests + * Wed Jan 27 2021 Fedora Release Engineering - 6.20-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 ee3d145..beee4c9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Net-HTTP-6.20.tar.gz) = 8a33e395ec4b2b2f32ffce653f0fe7cb2854512868b39ec4d0d05be00266971529a62f417c3fdcca512df78262fa7e269e271ff78458653dae7e50eb185f2aff +SHA512 (Net-HTTP-6.21.tar.gz) = ca50e54a893e38456dc107c216c6b119cce9c30b2d1ca47607e0fed426a79d2ed660818a5d5a6ef240cae28844c2d7ca613ce81f53e890e7f15b22e4d0e2887b diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..85712d8 --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,4 @@ +summary: Upstream tests +component: perl-Net-HTTP +require: perl-Net-HTTP-tests +test: /usr/libexec/perl-Net-HTTP/test