[jwhois] Alternate jwhois as whois, Disable cache (it was accidentally enabled by default)

vcrhonek vcrhonek at fedoraproject.org
Tue Nov 9 13:32:54 UTC 2010


commit cde9578838c7f64b3f307c27172771778ce9d494
Author: Vitezslav Crhonek <vcrhonek at redhat.com>
Date:   Tue Nov 9 14:32:50 2010 +0100

    Alternate jwhois as whois, Disable cache (it was accidentally enabled by default)

 jwhois.spec |   38 +++++++++++++++++++++++++++++---------
 1 files changed, 29 insertions(+), 9 deletions(-)
---
diff --git a/jwhois.spec b/jwhois.spec
index 0a6fdcb..4061de7 100644
--- a/jwhois.spec
+++ b/jwhois.spec
@@ -1,8 +1,8 @@
-%{?!with_cache: %define with_cache 1}
+%{?!with_cache: %define with_cache 0}
 
 Name: jwhois
 Version: 4.0
-Release: 22%{?dist}
+Release: 23%{?dist}
 URL: http://www.gnu.org/software/jwhois/
 Source0: ftp://ftp.gnu.org/gnu/jwhois/jwhois-%{version}.tar.gz
 Patch0: jwhois-4.0-connect.patch
@@ -19,8 +19,11 @@ BuildRequires: libidn-devel
 %if %{with_cache}
 BuildRequires: gdbm-devel
 %endif
-Requires(post): /sbin/install-info
-Requires(preun): /sbin/install-info
+Requires(post): /sbin/install-info, %{_sbindir}/update-alternatives
+Requires(preun): /sbin/install-info, %{_sbindir}/update-alternatives
+
+%define genname whois
+%define alternative jwhois
 
 %description
 A whois client that accepts both traditional and finger-style queries.
@@ -58,9 +61,13 @@ touch $RPM_BUILD_ROOT/%{_localstatedir}/cache/jwhois/jwhois.db
 rm -f "$RPM_BUILD_ROOT"%{_infodir}/dir
 %find_lang jwhois
 
-# Make "whois" jwhois.
-ln -sf jwhois $RPM_BUILD_ROOT/%{_bindir}/whois
-echo .so man1/jwhois.1 > $RPM_BUILD_ROOT/%{_mandir}/man1/whois.1
+# Make "whois.{%alternative}" jwhois (because of localized manual pages).
+echo .so man1/jwhois.1 > $RPM_BUILD_ROOT/%{_mandir}/man1/whois.%{alternative}.1
+
+# Rename to alternative names
+touch $RPM_BUILD_ROOT%{_bindir}/whois
+chmod 755 $RPM_BUILD_ROOT%{_bindir}/whois
+touch $RPM_BUILD_ROOT%{_mandir}/man1/whois.1
 
 %files -f %{name}.lang
 %defattr(-,root,root,-)
@@ -71,9 +78,11 @@ echo .so man1/jwhois.1 > $RPM_BUILD_ROOT/%{_mandir}/man1/whois.1
 %else
 %attr(0775,root,root) %{_bindir}/jwhois
 %endif
-%{_bindir}/whois
-%{_mandir}/man1/*
+%ghost %verify(not md5 size mtime) %{_bindir}/whois
+%{_mandir}/man1/jwhois.1*
 %lang(sv) %{_mandir}/sv/man1/jwhois.1*
+%{_mandir}/man1/whois.%{alternative}.*
+%ghost %verify(not md5 size mtime) %{_mandir}/man1/whois.1.gz
 %{_infodir}/jwhois.info.gz
 %config(noreplace) %{_sysconfdir}/jwhois.conf
 
@@ -86,18 +95,29 @@ getent group jwhois >/dev/null || groupadd -r jwhois || :
 if [ -f %{_infodir}/jwhois.info ]; then # --excludedocs?
     /sbin/install-info %{_infodir}/jwhois.info %{_infodir}/dir || :
 fi
+%{_sbindir}/update-alternatives \
+    --install %{_bindir}/whois \
+        %{genname} %{_bindir}/jwhois 60 \
+    --slave %{_mandir}/man1/whois.1.gz \
+        %{genname}-man %{_mandir}/man1/whois.%{alternative}.1.gz
 
 %preun
 if [ $1 = 0 ]; then
     if [ -f %{_infodir}/jwhois.info ]; then # --excludedocs?
         /sbin/install-info --delete %{_infodir}/jwhois.info %{_infodir}/dir || :
     fi
+    %{_sbindir}/update-alternatives --remove \
+            %{genname} %{_bindir}/jwhois
 fi
 
 %clean
 rm -fr $RPM_BUILD_ROOT
 
 %changelog
+* Tue Nov  9 2010 Petr Pisar <ppisar at redhat.com> - 4.0-23
+- Alternate jwhois as whois
+- Disable cache (it was accidentally enabled by default)
+
 * Wed Sep 29 2010 Vitezslav Crhonek <vcrhonek at redhat.com> - 4.0-22
 - Fix jwhois does not handle multi-homed server
   Resolves: #624608


More information about the scm-commits mailing list