perl-Future-AsyncAwait/perl-Future-AsyncAwait.spec

256 lines
8.8 KiB
RPMSpec
Raw Normal View History

2020-07-28 13:24:24 +00:00
# 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
# A build cycle: perl-Syntax-Keyword-Try → perl-Future-AsyncAwait
%if %{with perl_Future_AsyncAwait_enables_optional_test} && !%{defined perl_bootstrap}
%global optional_tests 1
%else
%global optional_tests 0
%endif
2020-07-28 13:24:24 +00:00
Name: perl-Future-AsyncAwait
2021-06-01 07:31:49 +00:00
Version: 0.51
Release: 2%{?dist}
2020-07-28 13:24:24 +00:00
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)
2021-06-01 07:31:49 +00:00
BuildRequires: perl(XS::Parse::Keyword::Builder) >= 0.05
2020-07-28 13:24:24 +00:00
BuildRequires: perl(XS::Parse::Sublike::Builder) >= 0.10
# Run-time:
BuildRequires: perl(:VERSION) >= 5.14
BuildRequires: perl(Carp)
BuildRequires: perl(Exporter)
2020-11-09 16:37:54 +00:00
BuildRequires: perl(Future) >= 0.43
2020-07-28 13:24:24 +00:00
BuildRequires: perl(Test::More) >= 0.88
2021-04-30 14:40:26 +00:00
# lib/Future/AsyncAwait.xs includes XSParseKeyword.h generated by
# XS::Parse::Keyword::Builder which loads XS::Parse::Keyword of version
# specified by boot_xs_parse_keyword() argument in AsyncAwait.xs
2021-06-01 07:31:49 +00:00
BuildRequires: perl(XS::Parse::Keyword) >= 0.05
# lib/Future/AsyncAwait.xs includes XSParseSublike.h generated by
# XS::Parse::Sublike::Builder which loads XS::Parse::Sublike of version
# specified by boot_xs_parse_sublike() argument in AsyncAwait.xs
BuildRequires: perl(XS::Parse::Sublike) >= 0.10
2020-07-28 13:24:24 +00:00
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(experimental)
2020-07-28 13:24:24 +00:00
BuildRequires: perl(feature)
BuildRequires: perl(List::Util)
%if %{with perl_Future_AsyncAwait_enables_role}
BuildRequires: perl(Role::Tiny::With)
%endif
2020-11-30 09:57:57 +00:00
BuildRequires: perl(Test::Future::Deferred)
2020-07-28 13:24:24 +00:00
BuildRequires: perl(Test::Refcount) >= 0.09
%if %{optional_tests}
2020-07-28 13:24:24 +00:00
# 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::Defer) >= 0.02
2020-07-28 13:24:24 +00:00
BuildRequires: perl(Syntax::Keyword::Dynamically) >= 0.04
2021-04-30 14:40:26 +00:00
BuildRequires: perl(Syntax::Keyword::Try) >= 0.22
2020-07-28 13:24:24 +00:00
BuildRequires: perl(Test::MemoryGrowth)
2021-02-25 07:49:14 +00:00
BuildRequires: perl(Test::Pod) >= 1.00
2020-07-28 13:24:24 +00:00
%endif
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
2020-11-09 16:37:54 +00:00
Requires: perl(Future) >= 0.43
2020-07-28 13:24:24 +00:00
%if %{with perl_Future_AsyncAwait_enables_role}
Recommends: perl(Role::Tiny)
%endif
2021-04-30 14:40:26 +00:00
# lib/Future/AsyncAwait.xs includes XSParseKeyword.h generated by
# XS::Parse::Keyword::Builder which loads XS::Parse::Keyword of version
# specified by boot_xs_parse_keyword() argument in AsyncAwait.xs
2021-06-01 07:31:49 +00:00
Requires: perl(XS::Parse::Keyword) >= 0.05
# lib/Future/AsyncAwait.xs includes XSParseSublike.h generated by
# XS::Parse::Sublike::Builder which loads XS::Parse::Sublike of version
# specified by boot_xs_parse_sublike() argument in AsyncAwait.xs
Requires: perl(XS::Parse::Sublike) >= 0.10
2020-07-28 13:24:24 +00:00
# Remove under-specified dependencies
2021-02-25 07:57:14 +00:00
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Future|Syntax::Keyword::Try|Test::More)\\)$
2020-07-28 13:24:24 +00:00
%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.
2021-02-25 07:57:14 +00:00
%package tests
Summary: Tests for %{name}
BuildArch: noarch
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}-Test = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
Requires: perl(experimental)
2021-02-25 07:57:14 +00:00
Requires: perl(Future) >= 0.43
%if %{with perl_Future_AsyncAwait_enables_role}
Requires: perl(Role::Tiny)
Requires: perl(Role::Tiny::With)
%endif
Requires: perl(Test::More) >= 0.88
%if %{optional_tests}
2021-02-25 07:57:14 +00:00
%if %{with perl_Future_AsyncAwait_enables_Devel_MAT}
Requires: perl(Devel::MAT)
Requires: perl(Devel::MAT::Dumper)
%endif
Requires: perl(IO::Async::Loop)
Requires: perl(Object::Pad) >= 0.15
Requires: perl(Syntax::Keyword::Defer) >= 0.02
2021-02-25 07:57:14 +00:00
Requires: perl(Syntax::Keyword::Dynamically) >= 0.04
2021-04-30 14:40:26 +00:00
Requires: perl(Syntax::Keyword::Try) >= 0.22
2021-02-25 07:57:14 +00:00
Requires: perl(Test::Pod) >= 1.00
%endif
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
2020-07-28 13:24:24 +00:00
%prep
%setup -q -n Future-AsyncAwait-%{version}
for F in \
%if !%{optional_tests} || !%{with perl_Future_AsyncAwait_enables_Devel_MAT}
2020-07-28 13:24:24 +00:00
t/82devel-mat-dumper-helper.t \
%endif
%if !%{optional_tests}
2021-04-30 14:40:26 +00:00
t/80await+defer.t t/80await+dynamically.t t/80await+SKT.t t/80async-method.t \
t/81async-method+dynamically.t t/81memory-growth.t t/99pod.t \
2020-07-28 13:24:24 +00:00
%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
2021-02-25 07:57:14 +00:00
chmod +x t/*.t
2020-07-28 13:24:24 +00:00
%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}
2021-02-25 07:57:14 +00:00
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
%if %{optional_tests}
2021-02-25 07:57:14 +00:00
rm %{buildroot}%{_libexecdir}/%{name}/t/99pod.t
%endif
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
2020-07-28 13:24:24 +00:00
%check
2021-02-25 07:57:14 +00:00
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
2020-07-28 13:24:24 +00:00
./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::*
2021-02-25 07:57:14 +00:00
%files tests
%{_libexecdir}/%{name}
2020-07-28 13:24:24 +00:00
%changelog
* Tue Jun 01 2021 Petr Pisar <ppisar@redhat.com> - 0.51-2
- Build-require Syntax::Keyword::Defer for optional tests
2021-06-01 07:31:49 +00:00
* Tue Jun 01 2021 Petr Pisar <ppisar@redhat.com> - 0.51-1
- 0.51 bump
* Mon May 24 2021 Jitka Plesnikova <jplesnik@redhat.com> - 0.50-3
- Perl 5.34 re-rebuild of bootstrapped packages
2021-05-21 22:01:03 +00:00
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 0.50-2
- Perl 5.34 rebuild
2021-04-30 14:40:26 +00:00
* Fri Apr 30 2021 Petr Pisar <ppisar@redhat.com> - 0.50-1
- 0.50 bump
* Thu Apr 29 2021 Petr Pisar <ppisar@redhat.com> - 0.49-3
- Build-require perl(experimental) for the tests (bug #1955172)
* Fri Mar 26 2021 Petr Pisar <ppisar@redhat.com> - 0.49-2
- Add a missing dependency on XS::Parse::Sublike
2021-02-25 07:49:14 +00:00
* Thu Feb 25 2021 Petr Pisar <ppisar@redhat.com> - 0.49-1
- 0.49 bump
2021-02-25 07:57:14 +00:00
- Package tests
2021-02-25 07:49:14 +00:00
2021-02-03 13:57:54 +00:00
* Wed Feb 03 2021 Petr Pisar <ppisar@redhat.com> - 0.48-1
- 0.48 bump
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.47-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
2020-11-30 09:57:57 +00:00
* Mon Nov 30 2020 Jitka Plesnikova <jplesnik@redhat.com> - 0.47-1
- 0.47 bump
2020-11-09 16:37:54 +00:00
* Mon Nov 09 2020 Petr Pisar <ppisar@redhat.com> - 0.46-1
- 0.46 bump
2020-10-23 08:31:13 +00:00
* Fri Oct 23 2020 Petr Pisar <ppisar@redhat.com> - 0.45-1
- 0.45 bump
2020-10-12 07:01:31 +00:00
* Mon Oct 12 2020 Petr Pisar <ppisar@redhat.com> - 0.44-1
- 0.44 bump
2020-07-28 13:24:24 +00:00
* Wed Jul 15 2020 Petr Pisar <ppisar@redhat.com> 0.43-1
- Specfile autogenerated by cpanspec 1.78.