[ovs-dev] [PATCH] rhel: create ovsdbmonitor subpackage

Flavio Leitner fbl at redhat.com
Wed Jan 8 01:12:41 UTC 2014


The fedora's rpm policy doesn't allow unpackaged files, so
currently the build fails when python-twisted-conch is installed.

Since the installation of python-twisted-conch is optional, and
that not everyone needs ovsdbmonitor installed on the system, this
patch splits it into a separate rpm subpackage.

You can decide whether to build ovsdbmonitor by passing either
--with ovsdbmonitor or --without ovsdbmonitor to rpmbuild.

Signed-off-by: Flavio Leitner <fbl at redhat.com>
---
 rhel/openvswitch-fedora.spec.in | 47 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 5cec1ff..df7e276 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -9,6 +9,18 @@
 
 #%define kernel 2.6.40.4-5.fc15.x86_64
 
+# This provides a way for distros that doesn't provide
+# python-twisted-conch to disable building of ovsdbmonitor
+# by default. You can override by passing --with ovsdbmonitor
+# or --without ovsdbmonitor while building the RPM.
+%define _pkg_ovsdbmonitor 1
+
+%if %{?_with_ovsdbmonitor: 1}%{!?_with_ovsdbmonitor: 0}
+%define with_ovsdbmonitor 1
+%else
+%define with_ovsdbmonitor %{?_without_ovsdbmonitor: 0}%{!?_without_ovsdbmonitor: %{_pkg_ovsdbmonitor}}
+%endif
+
 Name: openvswitch
 Summary: Open vSwitch
 Group: System Environment/Daemons
@@ -25,12 +37,31 @@ Buildroot: /tmp/openvswitch-fedora-rpm
 Requires(post):  systemd-units
 Requires(preun): systemd-units
 Requires(postun): systemd-units
+%if %{with_ovsdbmonitor}
+BuildRequires:  python-twisted-conch
+%endif
+
 
 %description
 Open vSwitch provides standard network bridging functions augmented with
 support for the OpenFlow protocol for remote per-flow control of
 traffic.
 
+%if %{with_ovsdbmonitor}
+%package -n ovsdbmonitor
+Summary: Open vSwitch graphical monitoring tool
+License: ASL 2.0
+BuildArch: noarch
+Requires: openvswitch = %{version}-%{release}
+Requires: python python-twisted-core python-twisted-conch python-zope-interface PyQt4
+
+%description -n ovsdbmonitor
+A GUI tool for monitoring and troubleshooting local or remote Open
+vSwitch installations.  It presents GUI tables that graphically represent
+an Open vSwitch kernel flow table (similar to "ovs-dpctl dump-flows")
+and Open vSwitch database contents (similar to "ovs-vsctl list <table>").
+%endif
+
 %prep
 %setup -q -n openvswitch-%{version}
 
@@ -71,6 +102,13 @@ install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
 
 # Get rid of stuff we don't want to make RPM happy.
 (cd "$RPM_BUILD_ROOT" && rm -f usr/lib/lib*)
+%if ! %{with_ovsdbmonitor}
+rm -f $RPM_BUILD_ROOT%{_bindir}/ovsdbmonitor
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/ovsdbmonitor.1*
+rm -rf $RPM_BUILD_ROOT%{_datadir}/ovsdbmonitor
+rm -f $RPM_BUILD_ROOT%{_datadir}/applications/ovsdbmonitor.desktop
+rm -rf $RPM_BUILD_ROOT%{_docdir}/ovsdbmonitor
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -199,6 +237,15 @@ systemctl start openvswitch.service
 %exclude /usr/share/man/man8/ovs-vlan-test.8.gz
 %exclude /usr/share/openvswitch/scripts/ovs-save
 
+%if %{with_ovsdbmonitor}
+%files -n ovsdbmonitor
+%{_bindir}/ovsdbmonitor
+%{_mandir}/man1/ovsdbmonitor.1*
+%{_datadir}/ovsdbmonitor
+%{_datadir}/applications/ovsdbmonitor.desktop
+%doc ovsdb/ovsdbmonitor/COPYING
+%endif
+
 %changelog
 * Wed Jan 12 2011 Ralf Spenneberg <ralf at os-s.net>
 - First build on F14
-- 
1.8.4.2




More information about the dev mailing list