Introduce build-conditions for IDN and libidn2

This commit is contained in:
Petr Písař 2017-04-26 10:45:13 +02:00
parent b526d6a661
commit 231243bbf0

View File

@ -1,3 +1,9 @@
# Add IDN support
%{bcond_without whois_enables_idn}
# Use libidn2 instead of libidn1,
# libidn2 support is broken <https://github.com/rfc1036/whois/issues/50>
%{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 <https://github.com/rfc1036/whois/issues/50>
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