File whois.spec of Package whois

%define realname whois
%define realver  5.3.2
%define srcext   tar.xz

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          %{realname}
Version:       %{realver}
Release:       %{?extraver:0.}1%{?dist}
License:       GPL-2.0+
Group:         Productivity/Networking/Other
URL:           http://github.com/rfc1036/whois
Summary:       Intelligent WHOIS client

# Install-time parameters
Provides:      ripe-whois-tools

# Build-time parameters
BuildRequires: xz pkgconfig
BuildRequires: pkgconfig(libidn2) >= 2.0.3
BuildRoot:     %{_tmppath}/%{name}-root
Source:        http://ftp.debian.org/debian/pool/main/w/whois/%{realname}_%{realver}%{?extraver}.%{srcext}

%description
This client is intelligent and can automatically select the appropriate
whois server for most queries.

The internal database is often more accurate than IANA's published one,
but please send me any information you have regarding domains and network
resources which are not correctly handled by the program.

Because of historical reasons this package also contains the mkpasswd
program, which can be used to encrypt a password with crypt(3).

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}

%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}'
%{__make} %{?_smp_mflags} \
 prefix=%{_prefix} \
 CFLAGS="$_CFLAGS" \
 LDFLAGS="$_LDFLAGS" \
 CONFIG_FILE=%{_sysconfdir}/whois.conf \
 LOCALEDIR=1 \
 HAVE_ICONV=1

%install
%{__make} install BASEDIR=%{buildroot}
%{__install} -D -m644 whois.conf %{buildroot}%{_sysconfdir}/whois.conf
%find_lang %{name}

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING README
%{_bindir}/*
%config %{_sysconfdir}/whois.conf
%doc %{_mandir}/man1/*
%doc %{_mandir}/man5/*

%changelog