Simplify ifs, install with -p

Preserve timestamps of installed files. Reduce a bit ifs support for
libidn. libidn might be removed already, keeping for a while.
This commit is contained in:
Petr Menšík 2022-02-25 19:15:19 +01:00
parent ec929ef308
commit 8153d31da4

View File

@ -1,13 +1,9 @@
# Package mkpasswd tool
%if 0%{?rhel}
%{bcond_with whois_enables_mkpasswd}
%else
%{bcond_without whois_enables_mkpasswd}
%endif
# Add IDN support
%{bcond_without whois_enables_idn}
# Use libidn2 instead of libidn
# Enable IDN, use libidn2 instead of libidn
%{bcond_without whois_enables_libidn2}
# Add libidn support
%{bcond_with whois_enables_idn}
Name: whois
Version: 5.5.12
@ -20,19 +16,16 @@ Source0: https://github.com/rfc1036/%{name}/archive/v%{version}/%{name}-%{ver
BuildRequires: coreutils
BuildRequires: gcc
BuildRequires: gettext
%if %{with whois_enables_idn}
%if %{with whois_enables_libidn2}
BuildRequires: pkgconfig(libidn2) >= 2.0.3
%else
%elif %{with whois_enables_idn}
BuildRequires: pkgconfig(libidn)
BuildConflicts: pkgconfig(libidn2)
%endif
%else
BuildConflicts: pkgconfig(libidn)
BuildConflicts: pkgconfig(libidn2)
%endif
%if %{with whois_enables_mkpasswd}
BuildRequires: pkgconfig(libcrypt)
BuildRequires: pkgconfig(libxcrypt) >= 4.1
%endif
BuildRequires: make
@ -89,7 +82,7 @@ whois tools messages translated into different natural languages.
%build
%{make_build} CONFIG_FILE="%{_sysconfdir}/%{cfgfile}" \
HAVE_ICONV=1 \
CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="%{__global_ldflags}"
CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="%{__global_ldflags}" INSTALL="install -p"
%install
%if %{with whois_enables_mkpasswd}