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/Mail-SPF-v2.8.0-POD.patch b/Mail-SPF-v2.8.0-POD.patch deleted file mode 100644 index e477bf0..0000000 --- a/Mail-SPF-v2.8.0-POD.patch +++ /dev/null @@ -1,17 +0,0 @@ -https://rt.cpan.org/Public/Bug/Display.html?id=86060 - ---- lib/Mail/SPF/Util.pm -+++ lib/Mail/SPF/Util.pm -@@ -155,9 +155,9 @@ sub ipv6_address_is_ipv4_mapped { - throws I - - Returns the given I IPv4 or IPv6 address compactly formatted as a --I. For IPv4 addresses, this is equivalent to calling L< NetAddr::IP's --C |NetAddr::IP/addr> method. For IPv6 addresses, this is equivalent to --calling L< NetAddr::IP's C |NedAddr::IP/short> method. Throws a -+I. For IPv4 addresses, this is equivalent to calling L|NetAddr::IP/addr> method. For IPv6 addresses, this is equivalent to -+calling L|NetAddr::IP/short> method. Throws a - I exception if the specified object is not a - I IPv4 or IPv6 address object. - diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..3b56a2d --- /dev/null +++ b/gating.yaml @@ -0,0 +1,16 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_testing +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + +# Rawhide +--- !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-Mail-SPF.spec b/perl-Mail-SPF.spec index a10c196..37890be 100644 --- a/perl-Mail-SPF.spec +++ b/perl-Mail-SPF.spec @@ -12,6 +12,7 @@ BuildRequires: coreutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter +BuildRequires: perl(Config) BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 BuildRequires: perl(strict) BuildRequires: perl(warnings) @@ -31,8 +32,6 @@ BuildRequires: perl(blib) BuildRequires: perl(Net::DNS::Resolver::Programmable) >= 0.003 BuildRequires: perl(Net::DNS::RR) BuildRequires: perl(Test::More) -# Optional tests only -BuildRequires: perl(Test::Pod) >= 1.00 Requires: perl(Net::DNS) >= 0.62 Requires: perl(URI) >= 1.13 @@ -43,12 +42,27 @@ Requires(postun): %{_sbindir}/update-alternatives Mail::SPF is an object-oriented implementation of Sender Policy Framework (SPF). See http://www.openspf.org for more information about SPF. +%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 Mail-SPF-%{version} # Work around test suite failures with Net::DNS ≥ 0.68 (CPAN RT#78214) %patch -P 0 chmod -x bin/* +# Help generators to recognize Perl scripts +for F in t/*.t; do + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F" + chmod +x "$F" +done + %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 %{make_build} @@ -62,6 +76,19 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 %{__mv} -f %{buildroot}%{_mandir}/man1/spfquery.1 %{buildroot}%{_mandir}/man1/spfquery-%{name}.1 touch %{buildroot}%{_bindir}/spfquery %{buildroot}%{_bindir}/spfd %{buildroot}%{_mandir}/man1/spfquery.1.gz +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t %{buildroot}%{_libexecdir}/%{name} +rm %{buildroot}%{_libexecdir}/%{name}/t/90-author* +for F in `ls %{buildroot}%{_libexecdir}/%{name}/t/*`; do + perl -i -ne 'print $_ unless m{^use blib}' $F +done +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/sh +cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)" +EOF +chmod +x %{buildroot}%{_libexecdir}/%{name}/test + %check make test @@ -87,9 +114,13 @@ fi %{_bindir}/spfquery.%{name} %{_bindir}/spfd.%{name} +%files tests +%{_libexecdir}/%{name} + %changelog * Mon Feb 05 2024 Jitka Plesnikova - 3.20240205-1 - 3.20240205 bump (rhbz#2262786) +- Package tests * Thu Jan 25 2024 Fedora Release Engineering - 2.9.0-34 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_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/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..4b96286 --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,4 @@ +summary: Upstream tests +component: perl-Mail-SPF +require: perl-Mail-SPF-tests +test: /usr/libexec/perl-Mail-SPF/test