109 lines
3.6 KiB
RPMSpec
109 lines
3.6 KiB
RPMSpec
%{bcond_with whois_enables_mkpasswd}
|
|
%{bcond_without whois_enables_idn}
|
|
%{bcond_without whois_enables_libidn2}
|
|
Name: whois
|
|
Version: 5.5.10
|
|
Release: 1
|
|
Summary: Improved WHOIS client
|
|
License: GPLv2+
|
|
URL: https://github.com/rfc1036/whois
|
|
Source0: https://github.com/rfc1036/whois/archive/refs/tags/v%{version}.tar.gz
|
|
BuildRequires: coreutils gcc gettext
|
|
%if %{with whois_enables_idn}
|
|
%if %{with whois_enables_libidn2}
|
|
BuildRequires: pkgconfig(libidn2) >= 2.0.3
|
|
%else
|
|
BuildRequires: pkgconfig(libidn)
|
|
BuildConflicts: pkgconfig(libidn2)
|
|
%endif
|
|
%else
|
|
BuildConflicts: pkgconfig(libidn)
|
|
BuildConflicts: pkgconfig(libidn2)
|
|
%endif
|
|
%if %{with whois_enables_mkpasswd}
|
|
BuildRequires: pkgconfig(libcrypt) pkgconfig(libxcrypt) >= 4.1
|
|
%endif
|
|
BuildRequires: make perl-interpreter perl(autodie) perl(strict) perl(warnings)
|
|
Requires(post): %{_sbindir}/update-alternatives
|
|
Requires(postun): %{_sbindir}/update-alternatives
|
|
Requires: whois-nls = %{version}-%{release}
|
|
%global genname whois
|
|
%global alternative md
|
|
%global cfgfile %{name}.conf
|
|
%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
|
|
Requires: whois-nls = %{version}-%{release}
|
|
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
|
|
|
|
%package nls
|
|
Summary: Gettext catalogs for whois tools
|
|
BuildArch: noarch
|
|
%description nls
|
|
whois tools messages translated into different natural languages.
|
|
|
|
%prep
|
|
%autosetup -n %{name}-%{version}
|
|
|
|
%build
|
|
%{make_build} CONFIG_FILE="%{_sysconfdir}/%{cfgfile}" \
|
|
HAVE_ICONV=1 \
|
|
CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="%{__global_ldflags}"
|
|
|
|
%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
|
|
install -p -m644 -D %{cfgfile} $RPM_BUILD_ROOT%{_sysconfdir}/%{cfgfile}
|
|
%find_lang %{name}
|
|
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
|
|
%license COPYING debian/copyright
|
|
%doc README debian/changelog
|
|
%config(noreplace) %{_sysconfdir}/%{cfgfile}
|
|
%{_bindir}/%{name}.%{alternative}
|
|
%ghost %{_bindir}/%{name}
|
|
%{_mandir}/man1/%{name}.%{alternative}.*
|
|
%ghost %{_mandir}/man1/%{name}.1.gz
|
|
%{_mandir}/man5/%{cfgfile}.5.*
|
|
|
|
%files nls -f %{name}.lang
|
|
%if %{with whois_enables_mkpasswd}
|
|
|
|
%files -n mkpasswd
|
|
%license COPYING debian/copyright
|
|
%doc README debian/changelog
|
|
%{_bindir}/mkpasswd
|
|
%{_mandir}/man1/mkpasswd.*
|
|
%endif
|
|
|
|
%changelog
|
|
* Tue Sep 7 2021 zhengyaohui <zhengyaohui1@huawei.com> - 5.5.10-1
|
|
- package init
|