From c3256c3e2ff20cf88eaa72d7c79889fccf4e6cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Fri, 1 Jun 2018 11:23:31 +0200 Subject: [PATCH] Add build conditions --- perl-Test-Base.spec | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/perl-Test-Base.spec b/perl-Test-Base.spec index 21f41f3..116e56a 100644 --- a/perl-Test-Base.spec +++ b/perl-Test-Base.spec @@ -1,3 +1,10 @@ +# Report a difference on string nonequivalnce +%bcond_without perl_Test_Base_enables_diff +# Run extra test +%bcond_without perl_Test_Base_enables_extra_test +# Enable getting documents by URLs +%bcond_without perl_Test_Base_enables_network + Name: perl-Test-Base Version: 0.89 Release: 1%{?dist} @@ -14,19 +21,25 @@ BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::MakeMaker) >= 6.52 # Module Runtime +%if %{with perl_Test_Base_enables_diff} BuildRequires: perl(Algorithm::Diff) >= 1.15 +%endif BuildRequires: perl(Carp) BuildRequires: perl(Data::Dumper) BuildRequires: perl(File::Path) BuildRequires: perl(Filter::Util::Call) -BuildRequires: perl(LWP::Simple) +%if %{with perl_Test_Base_enables_network} +# LWP::Simple not used at tests +%endif BuildRequires: perl(MIME::Base64) BuildRequires: perl(Scalar::Util) >= 1.07 BuildRequires: perl(Spiffy) >= 0.40 BuildRequires: perl(strict) BuildRequires: perl(Test::Deep) BuildRequires: perl(Test::More) >= 0.88 +%if %{with perl_Test_Base_enables_diff} BuildRequires: perl(Text::Diff) >= 0.35 +%endif BuildRequires: perl(warnings) BuildRequires: perl(YAML) # Test Suite @@ -34,20 +47,28 @@ BuildRequires: perl(base) BuildRequires: perl(File::Find) BuildRequires: perl(lib) BuildRequires: perl(Test::Tester) +%if %{with perl_Test_Base_enables_extra_test} # Release Tests BuildRequires: perl(Test::Pod) >= 1.41 +%endif # Dependencies Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +%if %{with perl_Test_Base_enables_diff} Requires: perl(Algorithm::Diff) >= 1.15 +%endif Requires: perl(Data::Dumper) Requires: perl(File::Path) Requires: perl(Filter::Util::Call) +%if %{with perl_Test_Base_enables_network} Requires: perl(LWP::Simple) +%endif Requires: perl(MIME::Base64) Requires: perl(Scalar::Util) >= 1.07 Requires: perl(Test::Deep) Requires: perl(Test::More) >= 0.88 +%if %{with perl_Test_Base_enables_diff} Requires: perl(Text::Diff) >= 0.35 +%endif Requires: perl(YAML) %description @@ -73,7 +94,7 @@ find %{buildroot} -type f -name .packlist -delete %{_fixperms} -c %{buildroot} %check -make test RELEASE_TESTING=1 +make test %{?with_perl_Test_Base_enables_extra_test:RELEASE_TESTING=1} %files %license LICENSE