Control optional test with a build condition

This commit is contained in:
Petr Písař 2017-12-12 17:17:44 +01:00
parent c976f76a20
commit d1b1c73bac

View File

@ -1,6 +1,9 @@
# Don not run gnupg1 tests by default, they need network access
# (Socket::inet_aton('pool.sks-keyservers.net')).
%bcond_with perl_CPAN_enables_gnupg_test
# Run optional test
%bcond_without perl_CPAN_enables_optional_test
%global cpan_version 2.16
Name: perl-CPAN
@ -108,6 +111,7 @@ BuildRequires: perl(FindBin)
BuildRequires: perl(Pod::Usage)
BuildRequires: perl(Test::More)
%if %{with perl_CPAN_enables_optional_test}
# Optional tests:
%if %{with perl_CPAN_enables_gnupg_test}
BuildRequires: %{_bindir}/gpg
@ -136,6 +140,7 @@ BuildRequires: perl(Test::Pod) >= 1.00
BuildRequires: perl(Test::Pod::Coverage) >= 0.18
BuildRequires: perl(YAML) >= 0.60
%endif
%endif
Requires: make
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))