Use build conditions to support optional features

This commit is contained in:
Petr Písař 2017-12-12 11:33:34 +01:00
parent 761f0a537d
commit 40b38cdf26

View File

@ -1,3 +1,10 @@
# Run optional test
%bcond_without perl_libnet_enables_optional_test
# SASL support
%bcond_without perl_libnet_enables_sasl
# SSL support
%bcond_without perl_libnet_enables_ssl
Name: perl-libnet
Version: 3.11
Release: 1%{?dist}
@ -50,7 +57,7 @@ BuildRequires: perl(Time::Local)
# Optional run-time:
# Authen::SASL not used at tests
# Digest::MD5 not used at tests
%if !%{defined perl_bootstrap}
%if %{with perl_libnet_enables_ssl} && !%{defined perl_bootstrap}
# Core modules must be built without non-core dependencies
BuildRequires: perl(IO::Socket::SSL) >= 2.007
%endif
@ -62,8 +69,9 @@ BuildRequires: perl(Cwd)
BuildRequires: perl(File::Temp)
BuildRequires: perl(IO::File)
BuildRequires: perl(Test::More)
%if %{with perl_libnet_enables_optional_test}
# Optional tests:
%if !%{defined perl_bootstrap}
%if %{with perl_libnet_enables_ssl} && !%{defined perl_bootstrap}
# Core modules must be built without non-core dependencies
BuildRequires: perl(IO::Socket::SSL::Utils)
%endif
@ -71,6 +79,7 @@ BuildRequires: perl(IO::Socket::SSL::Utils)
# Test::Perl::Critic not used
# Test::Pod 1.00 not used
# Test::Pod::Coverage 0.08 not used
%endif
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Requires: perl(File::Basename)
Requires: perl(IO::Socket) >= 1.05
@ -80,14 +89,14 @@ Requires: perl(POSIX)
Requires: perl(Socket) >= 2.016
# Optional run-time:
# Core modules must be built without non-core dependencies
%if !%{defined perl_bootstrap}
%if %{with perl_libnet_enables_sasl} && !%{defined perl_bootstrap}
Suggests: perl(Authen::SASL)
Suggests: perl(MIME::Base64)
%endif
Suggests: perl(Digest::MD5)
%if !%{defined perl_bootstrap}
%if %{with perl_libnet_enables_ssl} && !%{defined perl_bootstrap}
Suggests: perl(IO::Socket::SSL) >= 2.007
%endif
Suggests: perl(MIME::Base64)
Conflicts: perl < 4:5.22.0-347
# Filter under-specified dependencies