# Perform optional tests %bcond_without perl_Syntax_Keyword_Match_enables_optional_test Name: perl-Syntax-Keyword-Match Version: 0.09 Release: 3%{?dist} Summary: Match/case syntax for Perl License: GPL+ or Artistic URL: https://metacpan.org/release/Syntax-Keyword-Match Source0: https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Syntax-Keyword-Match-%{version}.tar.gz BuildRequires: coreutils BuildRequires: findutils BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl-interpreter # Perl version from Build.PL because of pad_add_name_pvs() used in Match.xs # is available since 5.16. BuildRequires: perl(:VERSION) >= 5.16 BuildRequires: perl(ExtUtils::CBuilder) BuildRequires: perl(Module::Build) BuildRequires: perl(strict) BuildRequires: perl(warnings) %define xs_parse_infix_minver 0 BuildRequires: perl(XS::Parse::Infix::Builder) >= %{xs_parse_infix_minver} %define xs_parse_keyword_minver 0.14 BuildRequires: perl(XS::Parse::Keyword::Builder) >= %{xs_parse_keyword_minver} # Run-time: BuildRequires: perl(Carp) # Match.xs includes XSParseInfix.h generated by # XS::Parse::Infix::Builder which loads XS::Parse::Infix of version # specified by boot_xs_parse_infix() argument in Match.xs BuildRequires: perl(XS::Parse::Infix) >= %{xs_parse_infix_minver} # Match.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 Match.xs BuildRequires: perl(XS::Parse::Keyword) >= %{xs_parse_keyword_minver} BuildRequires: perl(XSLoader) # Tests: BuildRequires: perl(overload) BuildRequires: perl(Test::More) >= 0.88 BuildRequires: perl(Time::HiRes) %if %{with perl_Syntax_Keyword_Match_enables_optional_test} # Optional tests: BuildRequires: perl(Future) BuildRequires: perl(Future::AsyncAwait) >= 0.10 BuildRequires: perl(Syntax::Operator::Divides) BuildRequires: perl(Syntax::Operator::Equ) %endif Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) # Match.xs includes XSParseInfix.h generated by # XS::Parse::Infix::Builder which loads XS::Parse::Infix of version # specified by boot_xs_parse_infix() argument in Match.xs Requires: perl(XS::Parse::Infix) >= %{xs_parse_infix_minver} %if %{defined perl_XS_Parse_Infix_ABI} # XS::Parse::Infix ABI is checked by S_boot_xs_parse_infix() compiled into # this package. Requires: %{perl_XS_Parse_Infix_ABI} %endif # Match.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 Match.xs Requires: perl(XS::Parse::Keyword) >= %{xs_parse_keyword_minver} %if %{defined perl_XS_Parse_Keyword_ABI} # XS::Parse::Keyword ABI is checked by S_boot_xs_parse_keyword() compiled into # this package. Requires: %{perl_XS_Parse_Keyword_ABI} %endif # Remove under-specified dependencies %global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Test::More\\)$ %description This module provides a syntax plugin that implements a control-flow block called match/case, which executes at most one of a choice of different blocks depending on the value of its controlling expression. %package tests Summary: Tests for %{name} BuildArch: noarch Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} Requires: perl-Test-Harness Requires: perl(Test::More) >= 0.88 %if %{with perl_Syntax_Keyword_Match_enables_optional_test} Requires: perl(Future) Requires: perl(Future::AsyncAwait) >= 0.10 Requires: perl(Syntax::Operator::Divides) Requires: perl(Syntax::Operator::Equ) %endif %description tests Tests from %{name}. Execute them with "%{_libexecdir}/%{name}/test". %prep %setup -q -n Syntax-Keyword-Match-%{version} %if !%{with perl_Syntax_Keyword_Match_enables_optional_test} for T in t/80await+matchcase.t t/80match-divides.t t/80match-equ.t; do rm "$T" perl -i -ne 'print $_ unless m{^\Q'"$T"'\E}' MANIFEST done %endif chmod +x t/*.t %build perl Build.PL --installdirs=vendor --optimize="$RPM_OPT_FLAGS" ./Build %install ./Build install --destdir=%{buildroot} --create_packlist=0 find %{buildroot} -type f -name '*.bs' -size 0 -delete %{_fixperms} %{buildroot}/* # Install tests mkdir -p %{buildroot}%{_libexecdir}/%{name} cp -a t %{buildroot}%{_libexecdir}/%{name} rm %{buildroot}%{_libexecdir}/%{name}/t/99pod.t 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 %check export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') ./Build test %files %license LICENSE %doc Changes README %{perl_vendorarch}/auto/* %{perl_vendorarch}/Syntax* %{_mandir}/man3/* %files tests %{_libexecdir}/%{name} %changelog * Fri Jul 22 2022 Fedora Release Engineering - 0.09-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue May 31 2022 Jitka Plesnikova - 0.09-2 - Perl 5.36 rebuild * Mon Feb 21 2022 Petr Pisar - 0.09-1 - 0.09 bump * Fri Jan 21 2022 Fedora Release Engineering - 0.08-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Wed Oct 27 2021 Petr Pisar 0.08-1 - Specfile autogenerated by cpanspec 1.78.