Use conditions definition for optional plugins as described at https://github.com/rpm-software-management/rpm/blob/34c2ba3c/macros.in#L100-L141

This commit is contained in:
Honza Horak 2017-12-01 16:10:14 +01:00
parent df3c3b6c68
commit d7b4f7837a

View File

@ -44,10 +44,12 @@
%bcond_without oqgraph %bcond_without oqgraph
# Other plugins # Other plugins
%bcond_without cracklib # Allow to override the values outside of spec
%bcond_without gssapi # https://github.com/rpm-software-management/rpm/blob/34c2ba3c/macros.in#L100-L141
%bcond_without connect %{!?_with_cracklib: %{!?_without_cracklib: %bcond_without cracklib}}
%bcond_without sphinx %{!?_with_gssapi: %{!?_without_gssapi: %bcond_without gssapi}}
%{!?_with_connect: %{!?_without_sphinx: %bcond_without connect}}
%{!?_with_sphinx: %{!?_without_sphinx: %bcond_without sphinx}}
# For some use cases we do not need some parts of the package. Set to "...with" to exclude # For some use cases we do not need some parts of the package. Set to "...with" to exclude
%bcond_with clibrary %bcond_with clibrary
@ -211,7 +213,7 @@ BuildRequires: bison bison-devel
BuildRequires: pam-devel BuildRequires: pam-devel
# use either new enough version of pcre or provide bundles(pcre) # use either new enough version of pcre or provide bundles(pcre)
%{?with_bundled_pcre:BuildRequires: pcre-devel >= 8.35 pkgconf} %{?with_bundled_pcre:BuildRequires: pcre-devel >= 8.35 pkgconf}
%{?without_bundled_pcre:Provides: bundled(pcre) = %{pcre_bundled_version}} %{!?with_bundled_pcre:Provides: bundled(pcre) = %{pcre_bundled_version}}
# Few utilities needs Perl # Few utilities needs Perl
%if 0%{?fedora} >= 22 || 0%{?rhel} > 7 %if 0%{?fedora} >= 22 || 0%{?rhel} > 7
BuildRequires: perl-interpreter BuildRequires: perl-interpreter