diff --git a/autodie-2.34.tar.gz b/autodie-2.34.tar.gz deleted file mode 100644 index c1b8f9e07f46ab3d55a0c8bc9db5353c0bdf08bf..0000000000000000000000000000000000000000 Binary files a/autodie-2.34.tar.gz and /dev/null differ diff --git a/autodie-2.36.tar.gz b/autodie-2.36.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2f472052c7de2a9380864730689a697a9b3a9234 Binary files /dev/null and b/autodie-2.36.tar.gz differ diff --git a/perl-autodie.spec b/perl-autodie.spec index 55a82a9d97be4f9f8e0588fe6d0d3b37a00174a9..4f1c2e4bb09475dc30044b89cbc4ae382a56632d 100644 --- a/perl-autodie.spec +++ b/perl-autodie.spec @@ -1,13 +1,11 @@ -%define anolis_release 3 -# Run optional test -%bcond_without perl_autodie_enables_optional_test +%define anolis_release 1 Name: perl-autodie -Version: 2.34 Epoch: 1 +Version: 2.36 Release: %{anolis_release}%{?dist} Summary: Replace functions with ones that succeed or die -License: GPL+ or Artistic +License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/autodie Source0: https://cpan.metacpan.org/authors/id/T/TO/TODDR/autodie-%{version}.tar.gz BuildArch: noarch @@ -47,14 +45,6 @@ BuildRequires: perl(lib) BuildRequires: perl(open) BuildRequires: perl(Socket) BuildRequires: perl(Test::More) -# Test::Perl::Critic not used -# Test::Pod 1.41 not used -# Test::Pod::Coverage 1.08 not used -# Optional tests: -%if %{with perl_autodie_enables_optional_test} && !%{defined perl_bootstrap} -BuildRequires: perl(BSD::Resource) -BuildRequires: perl(Import::Into) >= 1.002004 -%endif Requires: perl(B) Requires: perl(Fcntl) Requires: perl(POSIX) @@ -67,6 +57,35 @@ Requires: perl(IPC::System::Simple) >= 0.12 # Remove falsely detected perl(lib) %global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(lib\\)$ +# Filter modules bundled for tests +%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir} +%global __requires_exclude %{__requires_exclude}|^perl\\(autodie::test.*\\) +%global __requires_exclude %{__requires_exclude}|^perl\\(autodie_.*\\) +%global __requires_exclude %{__requires_exclude}|^perl\\(Caller_helper\\) +%global __requires_exclude %{__requires_exclude}|^perl\\(Hints_.*\\) +%global __requires_exclude %{__requires_exclude}|^perl\\(lethal\\) +%global __requires_exclude %{__requires_exclude}|^perl\\(my::.*\\) +%global __requires_exclude %{__requires_exclude}|^perl\\(pujHa::ghach\\) +%global __requires_exclude %{__requires_exclude}|^perl\\(Some::Module\\) + +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{EVR} +Requires: perl-Test-Harness +Requires: perl(lib) + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + +%package doc +Summary: Doc files for %{name} +Requires: %{name} = %{EVR} +BuildArch: noarch + +%description doc +Doc files for %{name} + %description The "autodie" and "Fatal" pragma provides a convenient way to replace functions that normally return false on failure with equivalents that throw an @@ -79,25 +98,58 @@ autodie in preference to "Fatal". %setup -q -n autodie-%{version} find -type f -exec chmod -x {} + +# 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} %install %{make_install} -%{_fixperms} $RPM_BUILD_ROOT/* +%{_fixperms} %{buildroot}/* + +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t %{buildroot}%{_libexecdir}/%{name} +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/bash +set -e +unset AUTHOR_TESTING AUTOMATED_TESTING PERL_CORE RELEASE_TESTING +# Some tests write into temporary files/directories. The 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 %check unset AUTHOR_TESTING AUTOMATED_TESTING PERL_CORE RELEASE_TESTING +export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') make test %files %license LICENSE -%doc AUTHORS Changes README.md %{perl_vendorlib}/* %{_mandir}/man3/* +%files tests +%{_libexecdir}/%{name} + +%files doc +%doc AUTHORS Changes README.md + %changelog +* Tue Feb 07 2023 Chunmei Xu - 1:2.36-1 +- update to 2.36 + * Fri Feb 03 2023 mgb01105731 - 1:2.34-3 - remove versioned MODULE_COMPAT_ requires