whois/whois.spec

154 lines
4.7 KiB
RPMSpec
Raw Normal View History

2018-11-13 18:01:24 +00:00
# Package mkpasswd tool
%{bcond_without whois_enables_mkpasswd}
# Enable IDN, use libidn2 instead of libidn
2017-04-26 09:57:36 +00:00
%{bcond_without whois_enables_libidn2}
# Add libidn support
%{bcond_with whois_enables_idn}
%global forgeurl https://github.com/rfc1036/whois
2011-03-07 10:23:59 +00:00
Name: whois
2023-07-30 17:13:28 +00:00
Version: 5.5.18
Release: %autorelease
2011-03-07 10:23:59 +00:00
Summary: Improved WHOIS client
2023-06-29 13:32:15 +00:00
License: GPL-2.0-or-later
URL: https://www.linux.it/~md/software/
VCS: git:%{forgeurl}
Source0: https://ftp.debian.org/debian/pool/main/w/%{name}/%{name}_%{version}.tar.xz
Source1: https://ftp.debian.org/debian/pool/main/w/%{name}/%{name}_%{version}.dsc
# This keyring needs to be processed at prep time, dscverify is not able to use it as it is
Source2: https://www.linux.it/~md/md-pgp.asc
2015-06-09 07:05:36 +00:00
BuildRequires: coreutils
BuildRequires: gcc
2013-04-18 11:30:53 +00:00
BuildRequires: gettext
%if %{with whois_enables_libidn2}
2017-08-23 09:55:02 +00:00
BuildRequires: pkgconfig(libidn2) >= 2.0.3
%elif %{with whois_enables_idn}
2017-08-23 09:55:02 +00:00
BuildRequires: pkgconfig(libidn)
BuildConflicts: pkgconfig(libidn2)
%else
BuildConflicts: pkgconfig(libidn)
BuildConflicts: pkgconfig(libidn2)
%endif
%if %{with whois_enables_mkpasswd}
2018-11-14 08:04:21 +00:00
BuildRequires: pkgconfig(libxcrypt) >= 4.1
%endif
2015-06-09 07:05:36 +00:00
BuildRequires: make
BuildRequires: perl-interpreter
BuildRequires: perl(autodie)
2013-04-18 11:30:53 +00:00
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
%if 0%{?fedora}
# Extra source verification. devscripts are not in rhel
BuildRequires: devscripts
BuildRequires: gnupg2
%endif
2011-03-07 10:23:59 +00:00
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
Requires: whois-nls = %{version}-%{release}
2011-03-07 10:23:59 +00:00
2017-02-27 12:54:47 +00:00
%global genname whois
%global alternative md
%global cfgfile %{name}.conf
2011-03-07 10:23:59 +00:00
%description
Searches for an object in a RFC 3912 database.
This version of the WHOIS client tries to guess the right server to ask for
the specified object. If no guess can be made it will connect to
whois.networksolutions.com for NIC handles or whois.arin.net for IPv4
addresses and network names.
%if %{with whois_enables_mkpasswd}
%package -n mkpasswd
Summary: Encrypt a password with crypt(3) function using a salt
# /usr/bin/mkpasswd was provided by "expect" package, bug #1649426
Conflicts: expect < 5.45.4-8.fc30
Requires: whois-nls = %{version}-%{release}
# whois-mkpasswd package renamed to mkpasswd in 5.4.0-2.fc30, bug #1649426
Obsoletes: whois-mkpasswd <= 5.4.0-1.fc30
2020-01-03 07:58:55 +00:00
# but we continued upgrading whois in Fedoras < 30 without the rename
2019-11-18 13:07:12 +00:00
Obsoletes: whois-mkpasswd <= 5.5.3-1.fc29
Provides: whois-mkpasswd = %{version}-%{release}
%description -n mkpasswd
mkpasswd tool encrypts a given password with the crypt(3) libc function
using a given salt.
%endif
# The same gettext catalogs are used by whois tool and mkpasswd tool. But we
# want to have the tools installable independently.
%package nls
Summary: Gettext catalogs for whois tools
Conflicts: whois < 5.3.2-2
BuildArch: noarch
%description nls
whois tools messages translated into different natural languages.
2011-03-07 10:23:59 +00:00
%prep
%if 0%{?fedora}
export GNUPGHOME="$(mktemp --tmpdir -d %{name}-XXXXXXX)"
TMPKEY="$GNUPGHOME/keyring.key"
gpg --no-default-keyring --keyring "${TMPKEY}" --trust-model always --import %{SOURCE2}
dscverify --keyring "${TMPKEY}" %{SOURCE1}
rm -rf "$GNUPGHOME"
%endif
2023-04-14 13:49:40 +00:00
%autosetup -p1
2011-03-07 10:23:59 +00:00
%build
2019-06-13 06:20:20 +00:00
%{make_build} CONFIG_FILE="%{_sysconfdir}/%{cfgfile}" \
HAVE_ICONV=1 \
CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="%{__global_ldflags}" INSTALL="install -p"
2011-03-07 10:23:59 +00:00
%install
%if %{with whois_enables_mkpasswd}
make install-mkpasswd install-pos BASEDIR=$RPM_BUILD_ROOT
%endif
make install-whois install-pos BASEDIR=$RPM_BUILD_ROOT
2011-03-07 10:23:59 +00:00
install -p -m644 -D %{cfgfile} $RPM_BUILD_ROOT%{_sysconfdir}/%{cfgfile}
%find_lang %{name}
# Rename to alternative names
mv $RPM_BUILD_ROOT%{_bindir}/%{name}{,.%{alternative}}
touch $RPM_BUILD_ROOT%{_bindir}/%{name}
chmod 755 $RPM_BUILD_ROOT%{_bindir}/%{name}
mv $RPM_BUILD_ROOT%{_mandir}/man1/%{name}{,.%{alternative}}.1
touch $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
%post
%{_sbindir}/update-alternatives \
--install %{_bindir}/%{name} \
%{genname} %{_bindir}/%{name}.%{alternative} 30 \
--slave %{_mandir}/man1/%{name}.1.gz \
%{genname}-man %{_mandir}/man1/%{name}.%{alternative}.1.gz
%postun
if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove \
%{genname} %{_bindir}/%{name}.%{alternative}
fi
%files
2015-02-02 13:47:09 +00:00
%license COPYING debian/copyright
%doc README debian/changelog
2011-03-07 10:23:59 +00:00
%config(noreplace) %{_sysconfdir}/%{cfgfile}
%{_bindir}/%{name}.%{alternative}
%ghost %{_bindir}/%{name}
2011-03-07 10:23:59 +00:00
%{_mandir}/man1/%{name}.%{alternative}.*
%ghost %{_mandir}/man1/%{name}.1.gz
%{_mandir}/man5/%{cfgfile}.5.*
2011-03-07 10:23:59 +00:00
%files nls -f %{name}.lang
%if %{with whois_enables_mkpasswd}
%files -n mkpasswd
%license COPYING debian/copyright
%doc README
%{_bindir}/mkpasswd
%{_mandir}/man1/mkpasswd.*
%endif
2011-03-07 10:23:59 +00:00
%changelog
%autochangelog