| |
@@ -2,10 +2,12 @@
|
| |
|
| |
# Do not perform tests that need the Internet
|
| |
%bcond_with perl_CPAN_FindDependencies_enables_network
|
| |
+ # Perform optional tests
|
| |
+ %bcond_without perl_CPAN_FindDependencies_enables_optional_test
|
| |
|
| |
Name: perl-CPAN-FindDependencies
|
| |
- Version: 3.04
|
| |
- Release: 2%{?dist}
|
| |
+ Version: 3.05
|
| |
+ Release: 1%{?dist}
|
| |
Summary: Find dependencies for modules on CPAN
|
| |
License: GPLv2+ or Artistic
|
| |
URL: https://metacpan.org/release/CPAN-FindDependencies
|
| |
@@ -18,6 +20,7 @@
|
| |
BuildRequires: perl(Config)
|
| |
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
|
| |
# Run-time
|
| |
+ BuildRequires: bzip2
|
| |
BuildRequires: perl(Archive::Tar)
|
| |
BuildRequires: perl(Archive::Zip)
|
| |
BuildRequires: perl(Capture::Tiny)
|
| |
@@ -42,13 +45,18 @@
|
| |
BuildRequires: perl(warnings)
|
| |
# Tests
|
| |
BuildRequires: perl(Devel::CheckOS)
|
| |
+ %if %{with perl_CPAN_FindDependencies_enables_network}
|
| |
BuildRequires: perl(File::Path)
|
| |
+ %endif
|
| |
BuildRequires: perl(Test::Differences)
|
| |
BuildRequires: perl(Test::More)
|
| |
BuildRequires: perl(Test::Time)
|
| |
+ %if %{with perl_CPAN_FindDependencies_enables_optional_test}
|
| |
# Optional tests
|
| |
BuildRequires: perl(Test::Pod) >= 1.00
|
| |
BuildRequires: perl(Test::Pod::Coverage) >= 1.00
|
| |
+ %endif
|
| |
+ Requires: bzip2
|
| |
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
| |
Requires: perl(LWP::Protocol::https)
|
| |
Requires: perl(Pod::Perldoc)
|
| |
@@ -58,8 +66,37 @@
|
| |
dependencies, and so on) without having to download the modules in
|
| |
their entirety.
|
| |
|
| |
+ %package tests
|
| |
+ Summary: Tests for %{name}
|
| |
+ Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
|
| |
+ Requires: coreutils
|
| |
+ Requires: perl-Test-Harness
|
| |
+ # t/cpandeps-script.t executes t/cache/Tie-Scalar-Decay-1.1.1/Tie-Scalar-Decay-1.1.1.MakefilePL
|
| |
+ Requires: perl(ExtUtils::MakeMaker)
|
| |
+
|
| |
+ %description tests
|
| |
+ Tests from %{name}. Execute them
|
| |
+ with "%{_libexecdir}/%{name}/test".
|
| |
+
|
| |
%prep
|
| |
%setup -qn %{pkgname}-%{version}
|
| |
+ for F in \
|
| |
+ %if !%{with perl_CPAN_FindDependencies_enables_network}
|
| |
+ t/cpandeps-diff-script.t \
|
| |
+ %endif
|
| |
+ %if !%{with perl_CPAN_FindDependencies_enables_optional_test}
|
| |
+ t/pod.t t/pod-coverage.t \
|
| |
+ %endif
|
| |
+ ; do
|
| |
+ rm "$F"
|
| |
+ perl -i -ne 'print $_ unless m{\A\Q'"$F"'\E}' MANIFEST
|
| |
+ done
|
| |
+ # Help generators to recognize 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 NO_PERLLOCAL=1
|
| |
@@ -68,11 +105,29 @@
|
| |
%install
|
| |
%{make_install}
|
| |
%{_fixperms} %{buildroot}/*
|
| |
+ # Install tests
|
| |
+ mkdir -p %{buildroot}%{_libexecdir}/%{name}
|
| |
+ cp -a t %{buildroot}%{_libexecdir}/%{name}
|
| |
+ %if %{with perl_CPAN_FindDependencies_enables_optional_test}
|
| |
+ rm %{buildroot}%{_libexecdir}/%{name}/t/pod{,-coverage}.t
|
| |
+ %endif
|
| |
+ mkdir %{buildroot}%{_libexecdir}/%{name}/blib
|
| |
+ ln -s %{_bindir} %{buildroot}%{_libexecdir}/%{name}/blib/script
|
| |
+ cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
|
| |
+ #!/bin/bash
|
| |
+ set -e
|
| |
+ # t/multi.t writes into CWD
|
| |
+ DIR=$(mktemp -d)
|
| |
+ cp -a %{_libexecdir}/%{name}/* "$DIR"
|
| |
+ pushd "$DIR"
|
| |
+ prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
|
| |
+ popd
|
| |
+ rm -r "$DIR"
|
| |
+ EOF
|
| |
+ chmod +x %{buildroot}%{_libexecdir}/%{name}/test
|
| |
|
| |
%check
|
| |
- %if !%{with perl_CPAN_FindDependencies_enables_network}
|
| |
- rm t/cpandeps-diff-script.t
|
| |
- %endif
|
| |
+ export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
|
| |
make test
|
| |
|
| |
%files
|
| |
@@ -84,7 +139,14 @@
|
| |
%{_mandir}/man1/*
|
| |
%{_mandir}/man3/*
|
| |
|
| |
+ %files tests
|
| |
+ %{_libexecdir}/%{name}
|
| |
+
|
| |
%changelog
|
| |
+ * Thu Feb 25 2021 Petr Pisar <ppisar@redhat.com> - 3.05-1
|
| |
+ - 3.05 bump
|
| |
+ - Package tests
|
| |
+
|
| |
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.04-2
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
| |
|
| |