File whois.spec of Package whois

#
# spec file for package whois
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           whois
Version:        5.1.1
Release:        0
Summary:        Intelligent WHOIS client
License:        GPL-2.0+
Group:          Productivity/Networking/Other
Url:            http://www.linux.it/~md/software/
Source:         http://ftp.debian.org/debian/pool/main/w/whois/%{name}_%{version}.tar.xz
Source2:        http://db.debian.org/fetchkey.cgi?fingerprint=1F2232EEE56FD048EAEFE47F1467F0D8E1EE3FB1#/%{name}.keyring
# rename .dsc to not build the package in OBS
Source3:        http://ftp.debian.org/debian/pool/main/w/whois/%{name}_%{version}.dsc#/%{name}.asc
Patch1:         whois-5.0.25-nb.patch
BuildRequires:  libidn-devel
BuildRequires:  xz
%if 0%{?suse_version} <= 1140
BuildRequires:  libxcrypt-devel
%endif
%if 0%{?suse_version} >= 1230
BuildRequires:  gpg-offline
%endif
Provides:       ripe-whois-tools
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package provides a commandline client for the WHOIS (RFC 3912)
protocol, which queries online servers for information such as contact
details for domains and IP address assignments.
It can intelligently select the appropriate WHOIS server for most queries.
 
The package also contains mkpasswd, a features-rich front end to the
password encryption function crypt(3).

%prep
%{?gpg_verify: %gpg_verify %{S:3}}
# the signature is on the Debian .dsc. Extract the checksums and verify against source
echo "`grep -A1 "Files:" %{S:3} | grep %{name}_%{version}.tar.xz | cut -d\  -f2`  %{S:0}" | md5sum -c
echo "`grep -A1 "Checksums-Sha1" %{S:3} | grep %{name}_%{version}.tar.xz | cut -d\  -f2`  %{S:0}" | sha1sum -c
echo "`grep -A1 "Checksums-Sha256" %{S:3} | grep %{name}_%{version}.tar.xz | cut -d\  -f2`  %{S:0}" | sha256sum -c

%setup -q
%patch1 -p1
rename no nb po/no.*

%build
make all mkpasswd HAVE_LIBIDN=1 HAVE_ICONV=1 \
%if 0%{?suse_version} <= 1140
	HAVE_XCRYPT=1 \
%else
	HAVE_CRYPT_GENSALT=1 \
%endif
	CFLAGS="%{optflags}"

%install
mkdir -p %{buildroot}{/usr/bin,%{_mandir}/man1}
make BASEDIR=%{buildroot} mandir=%{_mandir} prefix=/usr \
	install install-mkpasswd install-pos
%find_lang %{name}

%clean
rm -rf  %{buildroot}

%files -f %{name}.lang
%defattr(-,root,root)
%doc README debian/changelog debian/copyright
%{_bindir}/mkpasswd
%{_bindir}/whois
%{_mandir}/man1/mkpasswd.*
%{_mandir}/man?/whois.*

%changelog
openSUSE Build Service is sponsored by