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 3381b58..3587ec0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ HTML-Parser-3.66.tar.gz /HTML-Parser-3.72.tar.gz /HTML-Parser-3.73.tar.gz /HTML-Parser-3.75.tar.gz +/HTML-Parser-3.76.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-HTML-Parser.spec b/perl-HTML-Parser.spec index f364366..bf3da76 100644 --- a/perl-HTML-Parser.spec +++ b/perl-HTML-Parser.spec @@ -1,9 +1,9 @@ Name: perl-HTML-Parser Summary: Perl module for parsing HTML -Version: 3.75 -Release: 3%{?dist} +Version: 3.76 +Release: 1%{?dist} License: GPL+ or Artistic -Source0: https://cpan.metacpan.org/authors/id/C/CA/CAPOEIRAB/HTML-Parser-%{version}.tar.gz +Source0: https://cpan.metacpan.org/authors/id/O/OA/OALDERS/HTML-Parser-%{version}.tar.gz URL: https://metacpan.org/release/HTML-Parser BuildRequires: coreutils BuildRequires: findutils @@ -23,7 +23,6 @@ BuildRequires: perl(HTML::Tagset) >= 3 BuildRequires: perl(HTTP::Headers) BuildRequires: perl(IO::File) BuildRequires: perl(URI) -BuildRequires: perl(vars) BuildRequires: perl(XSLoader) # Tests BuildRequires: perl(Config) @@ -47,10 +46,29 @@ The HTML-Parser module for perl to parse and extract information from HTML documents, including the HTML::Entities, HTML::HeadParser, HTML::LinkExtor, HTML::PullParser, and HTML::TokeParser modules. +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + %prep %setup -q -n HTML-Parser-%{version} chmod -c a-x eg/* +# Help file to recognise the Perl scripts and normalize shebangs +for F in t/*.t; do + if head -1 "$F" | grep -q -e '^#!.*perl\b' ; then + perl -MConfig -pi -e 's|^#!.*perl\b|$Config{startperl}|' "$F" + else + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1' "$F" + fi + chmod +x "$F" +done + %build perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" NO_PACKLIST=1 NO_PERLLOCAL=1 %{make_build} @@ -62,9 +80,28 @@ iconv -f iso-8859-1 -t utf-8 <"$file" > "${file}_" && \ touch -r ${file} ${file}_ && \ mv -f "${file}_" "$file" find %{buildroot} -type f -name '*.bs' -empty -delete + +# Install tests +mkdir -p %{buildroot}/%{_libexecdir}/%{name} +cp -a t %{buildroot}/%{_libexecdir}/%{name} +cat > %{buildroot}/%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/bash +set -e +# Some tests write into temporary files/directories. The easiest solution +# is to copy the tests into a writable directory and execute them from there. +DIR=$(mktemp -d) +pushd "$DIR" +cp -a %{_libexecdir}/%{name}/* ./ +prove -I . -j "$(getconf _NPROCESSORS_ONLN)" +popd +rm -rf "$DIR" +EOF +chmod +x %{buildroot}/%{_libexecdir}/%{name}/test + %{_fixperms} %{buildroot}/* %check +export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') make test %files @@ -74,7 +111,14 @@ make test %{perl_vendorarch}/auto/HTML/ %{_mandir}/man3/*.3pm* +%files tests +%{_libexecdir}/%{name} + %changelog +* Fri Mar 05 2021 Jitka Plesnikova - 3.76-1 +- 3.76 bump +- Package tests + * Wed Jan 27 2021 Fedora Release Engineering - 3.75-3 - 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 a6d28ee..efbd47d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (HTML-Parser-3.75.tar.gz) = a694723c0e85dfa834f60b995032e1db25357b07f0f7e244cc765dfb3005e70176c9f018d1d1ff66592324678a791030f4002f995edcd3de9096bcd359c0ee6f +SHA512 (HTML-Parser-3.76.tar.gz) = 50f9dc01997afdef33b58b48bfabd596b09cc11086773dcb4707086b7d7f54d2234d508e11a0b17e5d62849bf6acbc16aa8cd53080329ad3dacdbbe877c2c88b diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..70ef5f7 --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,4 @@ +summary: Upstream tests +component: perl-HTML-Parser +require: perl-HTML-Parser-tests +test: /usr/libexec/perl-HTML-Parser/test