| |
@@ -1,22 +1,22 @@
|
| |
Name: perl-Scope-Upper
|
| |
Summary: Act on upper scopes
|
| |
- Version: 0.32
|
| |
- Release: 8%{?dist}
|
| |
+ Version: 0.33
|
| |
+ Release: 1%{?dist}
|
| |
License: GPL+ or Artistic
|
| |
Source0: https://cpan.metacpan.org/authors/id/V/VP/VPIT/Scope-Upper-%{version}.tar.gz
|
| |
URL: https://metacpan.org/release/Scope-Upper
|
| |
# Build
|
| |
+ BuildRequires: coreutils
|
| |
BuildRequires: findutils
|
| |
BuildRequires: gcc
|
| |
BuildRequires: make
|
| |
- BuildRequires: perl-interpreter
|
| |
BuildRequires: perl-devel
|
| |
BuildRequires: perl-generators
|
| |
+ BuildRequires: perl-interpreter
|
| |
BuildRequires: perl(Config)
|
| |
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
|
| |
BuildRequires: perl(strict)
|
| |
BuildRequires: perl(warnings)
|
| |
- BuildRequires: sed
|
| |
# Runtime
|
| |
BuildRequires: perl(base)
|
| |
BuildRequires: perl(Exporter)
|
| |
@@ -34,11 +34,17 @@
|
| |
# Optional tests only
|
| |
BuildRequires: perl(Time::HiRes)
|
| |
Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version))
|
| |
- Requires: perl(Exporter)
|
| |
Requires: perl(XSLoader)
|
| |
|
| |
%{?perl_default_filter}
|
| |
|
| |
+ # Filter modules bundled for tests
|
| |
+ %global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
|
| |
+ %global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(Scope::Upper::TestGenerator\\)
|
| |
+ %global __requires_exclude %{__requires_exclude}|^perl\\(Test::Leaner\\)
|
| |
+ %global __requires_exclude %{__requires_exclude}|^perl\\(VPIT::TestHelpers\\)
|
| |
+
|
| |
+
|
| |
%description
|
| |
This module lets you defer actions that will take place when the control
|
| |
flow returns into an upper scope. Currently, you can hook an upper scope
|
| |
@@ -46,21 +52,46 @@
|
| |
in higher contexts. You can also return to an upper level and know which
|
| |
context was in use then.
|
| |
|
| |
+ %package tests
|
| |
+ Summary: Tests for %{name}
|
| |
+ Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
|
| |
+ Requires: perl-Test-Harness
|
| |
+ Requires: perl(Time::HiRes)
|
| |
+
|
| |
+ %description tests
|
| |
+ Tests from %{name}. Execute them
|
| |
+ with "%{_libexecdir}/%{name}/test".
|
| |
+
|
| |
%prep
|
| |
%setup -q -n Scope-Upper-%{version}
|
| |
- sed -i -e '1s,^#!.*perl,%(perl -MConfig -e 'print $Config{startperl}'),' \
|
| |
- samples/*
|
| |
+ perl -MConfig -pi -e 's|^#!.*perl|$Config{startperl}|' samples/*
|
| |
+
|
| |
+ # 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 OPTIMIZE="%{optflags}" NO_PACKLIST=1
|
| |
- make %{?_smp_mflags}
|
| |
+ perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" NO_PACKLIST=1 NO_PERLLOCAL=1
|
| |
+ %{make_build}
|
| |
|
| |
%install
|
| |
- make pure_install DESTDIR=%{buildroot}
|
| |
+ %{make_install}
|
| |
find %{buildroot} -type f -name '*.bs' -a -size 0 -delete
|
| |
%{_fixperms} %{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 . -r -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
|
| |
@@ -69,7 +100,14 @@
|
| |
%exclude %dir %{perl_vendorarch}/auto
|
| |
%{_mandir}/man3/*.3*
|
| |
|
| |
+ %files tests
|
| |
+ %{_libexecdir}/%{name}
|
| |
+
|
| |
%changelog
|
| |
+ * Tue Dec 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 0.33-1
|
| |
+ - 0.33 bump
|
| |
+ - Package tests
|
| |
+
|
| |
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.32-8
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
| |
|
| |