# Enable debugging with Devel::MAT %bcond_with perl_Syntax_Keyword_Dynamically_enables_Devel_MAT # Perform optional tests %bcond_without perl_Syntax_Keyword_Dynamically_enables_optional_test Name: perl-Syntax-Keyword-Dynamically Version: 0.10 Release: 1%{?dist} Summary: Dynamically change the value of a variable License: GPL+ or Artistic URL: https://metacpan.org/release/Syntax-Keyword-Dynamically Source0: https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Syntax-Keyword-Dynamically-%{version}.tar.gz BuildRequires: coreutils BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(:VERSION) >= 5 %if %{with perl_Syntax_Keyword_Dynamically_enables_Devel_MAT} BuildRequires: perl(Devel::MAT::Dumper::Helper) >= 0.44 %endif BuildRequires: perl(ExtUtils::CBuilder) BuildRequires: perl(Module::Build) BuildRequires: perl(strict) BuildRequires: perl(warnings) BuildRequires: perl(XS::Parse::Keyword::Builder) >= 0.13 # Run-time: BuildRequires: perl(:VERSION) >= 5.14 BuildRequires: perl(Carp) # lib/Syntax/Keyword/Dynamically.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 Dynamically.xs BuildRequires: perl(XS::Parse::Keyword) >= 0.13 BuildRequires: perl(XSLoader) # Tests: BuildRequires: perl(Test::More) >= 0.88 %if %{with perl_Syntax_Keyword_Dynamically_enables_optional_test} && !%{defined perl_bootstrap} # A cycle: perl-Future-AsyncAwait → perl-Syntax-Keyword-Dynamically # Optional tests: BuildRequires: perl(Future) BuildRequires: perl(Future::AsyncAwait) >= 0.31 BuildRequires: perl(Object::Pad) >= 0.15 BuildRequires: perl(Sentinel) BuildRequires: perl(Test::Pod) >= 1 %endif Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) # lib/Syntax/Keyword/Dynamically.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 Dynamically.xs Requires: perl(XS::Parse::Keyword) >= 0.13 %if %{defined perl_XS_Parse_Keyword_ABI} # XS::Parse::Keyword maintains multiple ABIs whose compatibility is checked at # run-time by S_boot_xs_parse_keyword() compiled into this package. # The ABI is defined in XSPARSEKEYWORD_ABI_VERSION of XSParseKeyword.h Requires: %{perl_XS_Parse_Keyword_ABI} %endif # Remove under-specified dependencies %global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Test::More\\)$ %description This Perl module provides a syntax plugin that implements a single keyword, dynamically, which alters the behavior of a scalar assignment operation. Syntactically and semantically it is similar to the built-in Perl keyword local, but is implemented somewhat differently to give two key advantages over regular local: You can dynamically assign to left-value functions and accessors, and you can dynamically assign to regular lexical variables. %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_Dynamically_enables_optional_test} && !%{defined perl_bootstrap} # A cycle: perl-Future-AsyncAwait → perl-Syntax-Keyword-Dynamically Requires: perl(Future) Requires: perl(Future::AsyncAwait) >= 0.31 Requires: perl(Object::Pad) >= 0.15 Requires: perl(Sentinel) %endif %description tests Tests from %{name}. Execute them with "%{_libexecdir}/%{name}/test". %prep %setup -q -n Syntax-Keyword-Dynamically-%{version} %if !%{with perl_Syntax_Keyword_Dynamically_enables_optional_test} || %{defined perl_bootstrap} for F in t/80await+dynamically.t t/80dynamically+Object-Pad.t \ t/80dynamically+Sentinel.t t/81async-method+dynamically.t t/99pod.t do rm "$F" perl -i -ne 'print $_ unless m{^\Q'"$F"'\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} %if %{with perl_Syntax_Keyword_Dynamically_enables_optional_test} && !%{defined perl_bootstrap} 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 %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 * Thu Mar 17 2022 Petr Pisar - 0.10-1 - 0.10 bump * Fri Aug 27 2021 Jitka Plesnikova - 0.09-2 - Finish bootstrap against perl-XS-Parse-Keyword-0.13 * Thu Aug 26 2021 Jitka Plesnikova - 0.09-1 - 0.09 bump; Bootstrap against perl-XS-Parse-Keyword-0.13 * Tue Aug 17 2021 Petr Pisar - 0.08-9 - Finish bootstrap against perl-XS-Parse-Keyword-0.12 (bug #1994077) * Tue Aug 17 2021 Petr Pisar - 0.08-8 - Bootstrap against perl-XS-Parse-Keyword-0.12 (bug #1994077) * Thu Jul 22 2021 Fedora Release Engineering - 0.08-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Wed Jun 02 2021 Petr Pisar - 0.08-6 - Rebuild against perl-XS-Parse-Keyword-0.06 (bug #1966787) * Tue Jun 01 2021 Petr Pisar - 0.08-5 - Finish bootstrapping against XS-Parse-Keyword-0.04 (CPAN RT#136611) * Tue Jun 01 2021 Petr Pisar - 0.08-4 - Rebuild against XS-Parse-Keyword-0.04 (CPAN RT#136611) * Mon May 24 2021 Jitka Plesnikova - 0.08-3 - Perl 5.34 re-rebuild of bootstrapped packages * Fri May 21 2021 Jitka Plesnikova - 0.08-2 - Perl 5.34 rebuild * Mon May 03 2021 Petr Pisar - 0.08-1 - 0.08 bump - Package the tests * Wed Feb 03 2021 Petr Pisar - 0.07-1 - 2.07 bump * Wed Jan 27 2021 Fedora Release Engineering - 0.06-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Tue Nov 03 2020 Petr Pisar - 0.06-1 - 0.06 bump * Tue Jul 28 2020 Petr Pisar - 0.05-2 - Finish a bootstrap * Wed Jul 22 2020 Petr Pisar 0.05-1 - Specfile autogenerated by cpanspec 1.78.