#1 Modernize spec; Package tests
Merged a year ago by jplesnik. Opened a year ago by jplesnik.
Unknown source rawhide  into  rawhide

file added
+1
@@ -0,0 +1,1 @@

+ 1

file added
+7
@@ -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}

file modified
+39 -8
@@ -2,18 +2,18 @@

  # Epoch to compete with perl.spec

  Epoch:          1

  Version:        0.38

- Release:        490%{?dist}

+ Release:        491%{?dist}

  Summary:        Generic input parsing/checking mechanism

  License:        GPL-1.0-or-later OR Artistic-1.0-Perl

  URL:            https://metacpan.org/release/Params-Check

  Source0:        https://cpan.metacpan.org/modules/by-module/Params/Params-Check-%{version}.tar.gz

  BuildArch:      noarch

  BuildRequires:  coreutils

- BuildRequires:  findutils

  BuildRequires:  make

  BuildRequires:  perl-generators

  BuildRequires:  perl-interpreter

- BuildRequires:  perl(ExtUtils::MakeMaker)

+ BuildRequires:  perl(Config)

+ BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.76

  BuildRequires:  perl(strict)

  # Run-time:

  BuildRequires:  perl(Carp)
@@ -29,19 +29,43 @@

  validate input via a template. The only requirement is that the arguments

  must be named.

  

+ %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 Params-Check-%{version}

  

+ # 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

- make %{?_smp_mflags}

+ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1

+ %{make_build}

  

  %install

- make pure_install DESTDIR=$RPM_BUILD_ROOT

- find $RPM_BUILD_ROOT -type f -name .packlist -delete

- %{_fixperms} -c $RPM_BUILD_ROOT

+ %{make_install}

+ %{_fixperms} -c %{buildroot}

+ 

+ # 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

  

  %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
@@ -49,7 +73,14 @@

  %{perl_vendorlib}/Params/

  %{_mandir}/man3/Params::Check.3*

  

+ %files tests

+ %{_libexecdir}/%{name}

+ 

  %changelog

+ * Tue May 23 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1:0.38-491

+ - Modernize spec

+ - Package tests

+ 

  * Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.38-490

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

  

file added
+5
@@ -0,0 +1,5 @@

+ summary: Sanity tests

+ discover:

+     how: fmf

+ execute:

+     how: tmt

@@ -0,0 +1,4 @@

+ summary: Upstream tests

+ component: perl-Params-Check

+ require: perl-Params-Check-tests

+ test: /usr/libexec/perl-Params-Check/test

no initial comment

Pull-Request has been merged by jplesnik

a year ago