From 231243bbf0d8c2cf99a286bb73b2b668a49ffaac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 26 Apr 2017 10:45:13 +0200 Subject: [PATCH] Introduce build-conditions for IDN and libidn2 --- whois.spec | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/whois.spec b/whois.spec index 301552b..5a849e4 100644 --- a/whois.spec +++ b/whois.spec @@ -1,3 +1,9 @@ +# Add IDN support +%{bcond_without whois_enables_idn} +# Use libidn2 instead of libidn1, +# libidn2 support is broken +%{bcond_with whois_enables_libidn2} + Name: whois Version: 5.2.15 Release: 1%{?dist} @@ -12,7 +18,13 @@ Patch0: whois-5.2.15-Fix-misspellings-in-IPv4-formatting-string.patch BuildRequires: coreutils BuildRequires: gcc BuildRequires: gettext +%if %{with whois_enables_idn} +%if %{with whois_enables_libidn2} +BuildRequires: libidn2-devel +%else BuildRequires: libidn-devel +%endif +%endif BuildRequires: make BuildRequires: perl BuildRequires: perl(autodie) @@ -39,7 +51,15 @@ addresses and network names. %build # libidn2 support is broken -make CONFIG_FILE="%{_sysconfdir}/%{cfgfile}" HAVE_LIBIDN=1 HAVE_ICONV=1 \ +make CONFIG_FILE="%{_sysconfdir}/%{cfgfile}" \ +%if %{with whois_enables_idn} +%if %{with whois_enables_libidn2} + HAVE_LIBIDN2=1 \ +%else + HAVE_LIBIDN=1 \ +%endif +%endif + HAVE_ICONV=1 \ CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="%{__global_ldflags}" %{?_smp_mflags} %install