From 99562fb04131026e08157babeb7623e60394ce84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 29 Jun 2017 23:45:30 +0200 Subject: [PATCH] Simplify variables a bit --- ldns.spec | 70 +++++++++++++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/ldns.spec b/ldns.spec index bd93d7f..fbb27cf 100644 --- a/ldns.spec +++ b/ldns.spec @@ -1,9 +1,10 @@ %global _hardened_build 1 %{?!with_python: %global with_python 1} %{?!with_perl: %global with_perl 1} -%{?!with_ecdsa: %global with_ecdsa 1} +%{?!with_ecdsa: %global with_ecdsa 1} # GOST is not allowed in Fedora/RHEL due to legal reasons (not NIST ECC) %{?!with_gost: %global with_gost 0} +%{?!disable_dane: %global disable_dane 0} %if %{with_python} %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} @@ -42,7 +43,11 @@ Group: System Environment/Libraries # BuildRequires: automake BuildRequires: libpcap-devel +%if %{disable_dane} +BuildRequires: openssl-devel >= 1.0.2k +%else BuildRequires: openssl-devel >= 1.1.0 +%endif BuildRequires: gcc-c++ BuildRequires: doxygen @@ -132,62 +137,45 @@ CFLAGS="%{optflags} -fPIC" CXXFLAGS="%{optflags} -fPIC" LDFLAGS="-Wl,-z,relro,-z,now -pie" export CFLAGS CXXFLAGS LDFLAGS -%configure \ - --disable-rpath \ - --disable-static \ + + %if %{with_gost} - --enable-gost \ + %global enable_gost --enable-gost %else - --disable-gost \ + %global enable_gost --disable-gost %endif + %if %{with_ecdsa} - --enable-ecdsa \ + %global enable_ecdsa --enable-ecdsa %else - --disable-ecdsa \ + %global enable_ecdsa --disable-ecdsa %endif + +%global common_args \\\ + --disable-rpath \\\ + %{enable_gost} %{enable_ecdsa} \\\ + --with-ca-file=/etc/pki/tls/certs/ca-bundle.trust.crt \\\ + --with-ca-path=/etc/pki/tls/certs/ \\\ + --with-trust-anchor=%{_sharedstatedir}/unbound/root.key + +%configure \ + %{common_args} \ + --disable-static \ %if %{with_python} --with-pyldns \ %endif - --with-ca-file=/etc/pki/tls/certs/ca-bundle.trust.crt \ - --with-ca-path=/etc/pki/tls/certs/ \ - --with-trust-anchor=%{_sharedstatedir}/unbound/root.key \ --enable-rrtype-cds --enable-rrtype-uri \ +%if %{disable_dane} + --disable-dane-ta-usage \ +%endif pushd drill -%configure \ - --disable-rpath \ -%if %{with_gost} - --enable-gost \ -%else - --disable-gost \ -%endif -%if %{with_ecdsa} - --enable-ecdsa \ -%else - --disable-ecdsa \ -%endif - --with-ca-file=/etc/pki/tls/certs/ca-bundle.trust.crt \ - --with-ca-path=/etc/pki/tls/certs/ \ - --with-trust-anchor=%{_sharedstatedir}/unbound/root.key +%configure %{common_args} popd pushd examples -%configure \ - --disable-rpath \ -%if %{with_gost} - --enable-gost \ -%else - --disable-gost \ -%endif -%if %{with_ecdsa} - --enable-ecdsa \ -%else - --disable-ecdsa \ -%endif - --with-ca-file=/etc/pki/tls/certs/ca-bundle.trust.crt \ - --with-ca-path=/etc/pki/tls/certs/ \ - --with-trust-anchor=%{_sharedstatedir}/unbound/root.key +%configure %{common_args} popd make %{?_smp_mflags}