diff --git a/perl-Syntax-Keyword-Defer.spec b/perl-Syntax-Keyword-Defer.spec index 390b3dc..c391e82 100644 --- a/perl-Syntax-Keyword-Defer.spec +++ b/perl-Syntax-Keyword-Defer.spec @@ -1,6 +1,13 @@ # Perform optional tests %bcond_without perl_Syntax_Keyword_Defer_enables_optional_test +# A build cycle: perl-Syntax-Keyword-Try → perl-Syntax-Keyword-Defer +%if %{with perl_Syntax_Keyword_Defer_enables_optional_test} && !%{defined perl_bootstrap} +%define optional_tests 1 +%else +%define optional_tests 0 +%endif + Name: perl-Syntax-Keyword-Defer Version: 0.06 Release: 1%{?dist} @@ -29,7 +36,7 @@ BuildRequires: perl(XSLoader) # feature since Perl 5.33.7 BuildRequires: perl(feature) BuildRequires: perl(Test::More) >= 0.88 -%if %{with perl_Syntax_Keyword_Defer_enables_optional_test} +%if %{optional_tests} # Optional tests: BuildRequires: perl(Future) BuildRequires: perl(Future::AsyncAwait) >= 0.50 @@ -63,7 +70,7 @@ Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} Requires: perl-Test-Harness Requires: perl(feature) Requires: perl(Test::More) >= 0.88 -%if %{with perl_Syntax_Keyword_Defer_enables_optional_test} +%if %{optional_tests} Requires: perl(Future) Requires: perl(Future::AsyncAwait) >= 0.50 Requires: perl(Syntax::Keyword::Try) >= 0.18 @@ -75,7 +82,7 @@ with "%{_libexecdir}/%{name}/test". %prep %setup -q -n Syntax-Keyword-Defer-%{version} -%if !%{with perl_Syntax_Keyword_Defer_enables_optional_test} +%if !%{optional_tests} for F in t/80await+defer.t t/80defer+SKT.t t/99pod.t; do rm "$F" perl -i -ne 'print $_ unless m{\A\Q'"$F"'\E\b}' MANIFEST @@ -94,7 +101,7 @@ find %{buildroot} -type f -name '*.bs' -size 0 -delete # Install tests mkdir -p %{buildroot}%{_libexecdir}/%{name} cp -a t %{buildroot}%{_libexecdir}/%{name} -%if %{with perl_Syntax_Keyword_Defer_enables_optional_test} +%if %{optional_tests} rm %{buildroot}%{_libexecdir}/%{name}/t/99pod.t %endif cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'