[sshmenu] Minor enhancements to the spec.
Matthias Saou
thias at fedoraproject.org
Tue Jul 12 14:43:00 UTC 2011
commit 04fbf1a9791fd4a292852b60de99dae415329f8a
Author: Matthias Saou <thias at marmotte.net>
Date: Tue Jul 12 16:42:28 2011 +0200
Minor enhancements to the spec.
sshmenu.spec | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
---
diff --git a/sshmenu.spec b/sshmenu.spec
index 02d4a78..0aff950 100644
--- a/sshmenu.spec
+++ b/sshmenu.spec
@@ -1,9 +1,17 @@
-%{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]')}
+%{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]')}
+
+# On RHEL we are missing libs to get the gnome applet working (#463022)
+# On Fedora 15, no more ruby-panelapplet2 because of GNOME3
+%if 0%{?rhel:1} || 0%{?fedora} >= 15
+%bcond_with applet
+%else
+%bcond_without applet
+%endif
Summary: Application to organize SSH connection information in a menu
Name: sshmenu
Version: 3.18
-Release: 6%{?dist}
+Release: 7%{?dist}
License: BSD
Group: User Interface/Desktops
URL: http://sshmenu.sourceforge.net/
@@ -30,15 +38,19 @@ keeps all your regular SSH connections within a single menu. If you wish to
have the full GNOME applet version of the menu, install gnome-applet-sshmenu.
+%if %{with applet}
%package -n gnome-applet-sshmenu
Summary: GNOME panel applet to organize SSH connection information in a menu
Group: User Interface/Desktops
Requires: %{name} = %{version}-%{release}
Requires: ruby(panelapplet2)
+# No a build requirement, but it's best to fail building if not available
+BuildRequires: ruby(panelapplet2)
%description -n gnome-applet-sshmenu
SSHMenu is a GNOME panel applet (which can also be used outside of GNOME) that
keeps all your regular SSH connections within a single panel menu.
+%endif
%prep
@@ -55,9 +67,7 @@ keeps all your regular SSH connections within a single panel menu.
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}
-# On RHEL we are missing libs to get the gnome applet working (#463022)
-# On Fedora 15, no more ruby-panelapplet2 because of GNOME3
-%if 0%{?fedora}%{?rhel:15} >= 15
+%if %{without applet}
%{__rm} -rf %{buildroot}%{_prefix}/lib/bonobo/
%{__rm} -rf %{buildroot}%{_libexecdir}/sshmenu-applet
%{__rm} -rf %{buildroot}%{_datadir}/icons/
@@ -68,6 +78,7 @@ keeps all your regular SSH connections within a single panel menu.
%{__rm} -rf %{buildroot}
+%if %{with applet}
%post -n gnome-applet-sshmenu
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
@@ -79,6 +90,7 @@ touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
+%endif
%files
@@ -92,9 +104,7 @@ fi
%{_mandir}/man1/sshmenu.1*
-# On RHEL we are missing libs to get the gnome applet working (#463022)
-# On Fedora 15, no more ruby-panelapplet2 because of GNOME3
-%if 0%{?fedora}%{?rhel:15} < 15
+%if %{with applet}
%files -n gnome-applet-sshmenu
%{_prefix}/lib/bonobo/servers/sshmenu-applet.server
%{_libexecdir}/sshmenu-applet
@@ -103,6 +113,12 @@ fi
%changelog
+* Tue Jul 12 2011 Matthias Saou <http://freshrpms.net/> 3.18-7
+- Use bcond for the applet, it makes the spec easier to understand.
+- Use %%global for ruby_sitelib, as it fails with bcond otherwise...
+- BuildRequire ruby(panelapplet2) for gnome-applet-sshmenu in order to fail
+ building if it's not available, instead of creating a broken package.
+
* Sun Jul 10 2011 Matthias Saou <http://freshrpms.net/> 3.18-6
- Obsolete gnome-applet-sshmenu up to the last built version on F15+.
More information about the scm-commits
mailing list