Control optional features with build conditions

This commit is contained in:
Petr Písař 2017-12-08 13:11:24 +01:00
parent 65f27ed7dc
commit 5a1afdf618

View File

@ -1,3 +1,8 @@
# Recognize terminal size
%bcond_without perl_Term_Table_enables_terminal
# Respect Unicode rules when breaking lines
%bcond_without perl_Term_Table_enables_unicode
Name: perl-Term-Table
Version: 0.012
Release: 1%{?dist}
@ -20,10 +25,14 @@ BuildRequires: perl(Importer) >= 0.024
BuildRequires: perl(List::Util)
BuildRequires: perl(Scalar::Util)
# Optional run-time:
%if %{with perl_Term_Table_enables_terminal}
# Term::ReadKey 2.32 not used if Term::Size::Any is available
# Prefer Term::Size::Any over Term::ReadKey
BuildRequires: perl(Term::Size::Any) >= 0.002
%endif
%if %{with perl_Term_Table_enables_unicode}
BuildRequires: perl(Unicode::GCString) >= 2013.10
%endif
# Tests:
BuildRequires: perl(base)
BuildRequires: perl(Test2::API)
@ -32,10 +41,14 @@ BuildRequires: perl(Test::More)
BuildRequires: perl(utf8)
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Requires: perl(Importer) >= 0.024
%if %{with perl_Term_Table_enables_terminal}
Suggests: perl(Term::ReadKey) >= 2.32
# Prefer Term::Size::Any over Term::ReadKey
Recommends: perl(Term::Size::Any) >= 0.002
%endif
%if %{with perl_Term_Table_enables_unicode}
Recommends: perl(Unicode::GCString) >= 2013.10
%endif
# Remove under-specified dependencies
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Importer\\)$