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 ee06b19..abde25a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /Crypt-OpenSSL-Guess-0.11.tar.gz +/Crypt-OpenSSL-Guess-0.12.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-Crypt-OpenSSL-Guess.spec b/perl-Crypt-OpenSSL-Guess.spec index 09ccb06..727cb10 100644 --- a/perl-Crypt-OpenSSL-Guess.spec +++ b/perl-Crypt-OpenSSL-Guess.spec @@ -1,11 +1,12 @@ Name: perl-Crypt-OpenSSL-Guess -Version: 0.11 -Release: 10%{?dist} +Version: 0.12 +Release: 2%{?dist} Summary: Guess OpenSSL include path License: GPL+ or Artistic URL: https://metacpan.org/release/Crypt-OpenSSL-Guess/ Source0: https://cpan.metacpan.org/authors/id/A/AK/AKIYM/Crypt-OpenSSL-Guess-%{version}.tar.gz BuildArch: noarch +BuildRequires: coreutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter @@ -14,6 +15,7 @@ BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 BuildRequires: perl(strict) # Run-time BuildRequires: perl(Config) +BuildRequires: perl(English) BuildRequires: perl(Exporter) >= 5.57 BuildRequires: perl(ExtUtils::MM) BuildRequires: perl(File::Spec) @@ -31,18 +33,42 @@ Recommends: openssl Crypt::OpenSSL::Guess provides helpers to guess OpenSSL include path on any platforms. +%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 Crypt-OpenSSL-Guess-%{version} +# Help file to recognise the Perl scripts +for F in t/*.t; do + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1' "$F" + chmod +x "$F" +done + %build -perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 -make %{?_smp_mflags} +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 +%{make_build} %install -make pure_install DESTDIR=$RPM_BUILD_ROOT +%{make_install} +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t %{buildroot}%{_libexecdir}/%{name} +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 %{_fixperms} $RPM_BUILD_ROOT/* %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 @@ -51,7 +77,16 @@ make test %{perl_vendorlib}/* %{_mandir}/man3/* +%files tests +%{_libexecdir}/%{name} + %changelog +* Tue Mar 09 2021 Jitka Plesnikova - 0.12-2 +- Package tests + +* Mon Mar 08 2021 Jitka Plesnikova - 0.12-1 +- 0.12 bump + * Wed Jan 27 2021 Fedora Release Engineering - 0.11-10 - 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 305b642..27b7895 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Crypt-OpenSSL-Guess-0.11.tar.gz) = cdae7f20a15d24842cf117bfba4f3bc0ec7d1066251e0480cbadd8f0aa28c9c9573905726fc1333ea9fbbb3769a67dbf28043de8487dcce27dab5d14a0848b09 +SHA512 (Crypt-OpenSSL-Guess-0.12.tar.gz) = 2575abda7da800e24676b1614396f6b5ca36e1e89e1f19525689aba5dac673b9f90f26ca0f9f9046580b156645ed078f9e4ea9d77ea81ade10f404f2d004a5c4 diff --git a/tests/upstream-tests.fmf b/tests/upstream-tests.fmf new file mode 100644 index 0000000..ebec87b --- /dev/null +++ b/tests/upstream-tests.fmf @@ -0,0 +1,4 @@ +summary: Upstream tests +component: perl-Crypt-OpenSSL-Guess +require: perl-Crypt-OpenSSL-Guess-tests +test: /usr/libexec/perl-Crypt-OpenSSL-Guess/test