Use bcond_with* also for other features

This commit is contained in:
Petr Menšík 2018-02-21 18:19:56 +01:00
parent e1786302b6
commit d43e3ead8a

View File

@ -6,12 +6,13 @@
%else
%bcond_with python2
%endif
%{?!with_perl: %global with_perl 1}
%{?!with_ecdsa: %global with_ecdsa 1}
%bcond_without perl
%bcond_without ecdsa
# GOST is not allowed in Fedora/RHEL due to legal reasons (not NIST ECC)
%{?!with_gost: %global with_gost 0}
%bcond_with gost
# Useful to build against openssl 1.0
%{?!disable_dane: %global disable_dane 0}
%bcond_with dane
%{?!snapshot: %global snapshot 0}
%if %{with python2}%{with python3}
@ -28,7 +29,7 @@
%global __provides_exclude ^(%{_ldns_internal})$
%endif
%if %{with_perl}
%if %{with perl}
%{?perl_default_filter}
%endif
@ -53,7 +54,7 @@ BuildRequires: automake
%endif
BuildRequires: libpcap-devel
%if %{disable_dane}
%if %{with dane}
BuildRequires: openssl-devel >= 1.0.2k
%else
BuildRequires: openssl-devel >= 1.1.0
@ -69,7 +70,7 @@ BuildRequires: python2-devel, swig
%if %{with python3}
BuildRequires: python3-devel, swig
%endif
%if %{with_perl}
%if %{with perl}
BuildRequires: perl-devel
BuildRequires: perl-ExtUtils-MakeMaker
BuildRequires: perl-generators
@ -125,7 +126,7 @@ Python3 extensions for ldns
%endif
%if %{with_perl}
%if %{with perl}
%package -n perl-ldns
Summary: Perl extensions for ldns
Group: Applications/System
@ -187,19 +188,19 @@ CXXFLAGS="%{optflags} -fPIC"
LDFLAGS="$RPM_LD_FLAGS -Wl,-z,now -pie"
export CFLAGS CXXFLAGS LDFLAGS
%if %{with_gost}
%if %{with gost}
%global enable_gost --enable-gost
%else
%global enable_gost --disable-gost
%endif
%if %{with_ecdsa}
%if %{with ecdsa}
%global enable_ecdsa --enable-ecdsa
%else
%global enable_ecdsa --disable-ecdsa
%endif
%if %{disable_dane}
%if %{with dane}
%global disable_dane_ta --disable-dane-ta-usage
%endif
@ -230,7 +231,7 @@ make %{?_smp_mflags}
make %{?_smp_mflags} doc
# We cannot use the built-in --with-p5-dns-ldns
%if %{with_perl}
%if %{with perl}
pushd contrib/DNS-LDNS
LD_LIBRARY_PATH="../../lib:$LD_LIBRARY_PATH" perl \
Makefile.PL INSTALLDIRS=vendor INC="-I. -I../.." LIBS="-L../../lib"
@ -274,7 +275,7 @@ rm -rf %{buildroot}%{python3_sitearch}/*.la
# install pkg-config file
install -D -m644 packaging/libldns.pc %{buildroot}%{_libdir}/pkgconfig/ldns.pc
%if %{with_perl}
%if %{with perl}
make -C contrib/DNS-LDNS DESTDIR=%{buildroot} pure_install
chmod 755 %{buildroot}%{perl_vendorarch}/auto/DNS/LDNS/LDNS.so
rm -f %{buildroot}%{perl_vendorarch}/auto/DNS/LDNS/{.packlist,LDNS.bs}
@ -335,7 +336,7 @@ rm -rf doc/man
%{python3_sitearch}/*
%endif
%if %{with_perl}
%if %{with perl}
%files -n perl-ldns
%{perl_vendorarch}/*
%exclude %dir %{perl_vendorarch}/auto/