Reviewed in bug #1859635.
This commit is contained in:
Petr Písař 2020-07-28 15:24:24 +02:00
parent b6e0e2c0c8
commit 69f2dc7ef9
3 changed files with 139 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/Future-AsyncAwait-0.43.tar.gz

137
perl-Future-AsyncAwait.spec Normal file
View File

@ -0,0 +1,137 @@
# Enable debugging with Devel::MAT
%bcond_with perl_Future_AsyncAwait_enables_Devel_MAT
# Perform optional tests
%bcond_without perl_Future_AsyncAwait_enables_optional_test
# Declare a role with Role::Tiny
%bcond_without perl_Future_AsyncAwait_enables_role
Name: perl-Future-AsyncAwait
Version: 0.43
Release: 1%{?dist}
Summary: Deferred subroutine syntax for futures
License: GPL+ or Artistic
URL: https://metacpan.org/release/Future-AsyncAwait
Source0: https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Future-AsyncAwait-%{version}.tar.gz
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: perl-devel
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(Config)
%if %{with perl_Future_AsyncAwait_enables_Devel_MAT}
BuildRequires: perl(Devel::MAT::Dumper::Helper)
%endif
BuildRequires: perl(ExtUtils::CBuilder)
BuildRequires: perl(Module::Build)
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
BuildRequires: perl(XS::Parse::Sublike::Builder) >= 0.10
# Run-time:
BuildRequires: perl(:VERSION) >= 5.14
BuildRequires: perl(Carp)
BuildRequires: perl(Exporter)
BuildRequires: perl(Future)
BuildRequires: perl(Test::More) >= 0.88
BuildRequires: perl(XSLoader)
%if %{with perl_Future_AsyncAwait_enables_role}
# Optional run-time:
BuildRequires: perl(Role::Tiny)
%endif
# Test:
BuildRequires: perl(attributes)
BuildRequires: perl(base)
BuildRequires: perl(constant)
BuildRequires: perl(feature)
BuildRequires: perl(List::Util)
%if %{with perl_Future_AsyncAwait_enables_role}
BuildRequires: perl(Role::Tiny::With)
%endif
BuildRequires: perl(Test::Refcount) >= 0.09
%if %{with perl_Future_AsyncAwait_enables_optional_test}
# Optional tests:
%if %{with perl_Future_AsyncAwait_enables_Devel_MAT}
BuildRequires: perl(Devel::MAT)
BuildRequires: perl(Devel::MAT::Dumper)
%endif
BuildRequires: perl(IO::Async::Loop)
BuildRequires: perl(Object::Pad) >= 0.15
BuildRequires: perl(Syntax::Keyword::Dynamically) >= 0.04
BuildRequires: perl(Syntax::Keyword::Try) >= 0.07
BuildRequires: perl(Test::MemoryGrowth)
%endif
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
%if %{with perl_Future_AsyncAwait_enables_role}
Recommends: perl(Role::Tiny)
%endif
# Remove under-specified dependencies
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Test::More\\)$
%description
This Perl module provides syntax for deferring and resuming subroutines while
waiting for Futures to complete. This syntax aims to make code that performs
asynchronous operations using futures look neater and more expressive than
simply using then chaining and other techniques on the futures themselves.
%package Test
Summary: Conformance tests for Future::AsyncAwait::Awaitable role
BuildArch: noarch
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Requires: perl(Test::More) >= 0.88
%description Test
This Perl module provides a single test function, which runs a suite of
subtests to check that a given class provides a usable implementation of the
Future::AsyncAwait::Awaitable role. It runs tests that simulate various ways
in which Future::AsyncAwait will try to use an instance of this class, to
check that the implementation is valid.
%prep
%setup -q -n Future-AsyncAwait-%{version}
for F in \
%if !%{with perl_Future_AsyncAwait_enables_optional_test} || !%{with perl_Future_AsyncAwait_enables_Devel_MAT}
t/82devel-mat-dumper-helper.t \
%endif
%if !%{with perl_Future_AsyncAwait_enables_optional_test}
t/80await+dynamically.t t/80await+try.t t/81async-method+dynamically.t \
t/81memory-growth.t \
%endif
%if !%{with perl_Future_AsyncAwait_enables_role}
t/51awaitable-role.t \
%endif
; do
rm "$F"
perl -i -ne 'print $_ unless m{^\Q'"$F"'\E}' MANIFEST
done
%build
perl Build.PL --installdirs=vendor --optimize="$RPM_OPT_FLAGS"
./Build
%install
./Build install --destdir=$RPM_BUILD_ROOT --create_packlist=0
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
%{_fixperms} $RPM_BUILD_ROOT/*
# Move Test subpackage content to a noarch location
install -m 0755 -d ${RPM_BUILD_ROOT}%{perl_vendorlib}
mv ${RPM_BUILD_ROOT}%{perl_vendorarch}/Test ${RPM_BUILD_ROOT}%{perl_vendorlib}
%check
./Build test
%files
%license LICENSE
%doc Changes README
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/Future*
%{_mandir}/man3/Future::*
%files Test
%license LICENSE
%doc Changes README
%{perl_vendorlib}/Test
%{_mandir}/man3/Test::*
%changelog
* Wed Jul 15 2020 Petr Pisar <ppisar@redhat.com> 0.43-1
- Specfile autogenerated by cpanspec 1.78.

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (Future-AsyncAwait-0.43.tar.gz) = 9994616139c8d5673f5c9454d0eac158c0344f55c032f39c9241d5be1c134540e85195a7444a0e4e66c78956eea0b646e17e02d49802936cbdb3e3e8f2f6831b