]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
rpm: create libvirt-wireshark sub-package
authorEric Blake <eblake@redhat.com>
Tue, 4 Feb 2014 19:37:15 +0000 (12:37 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 5 Feb 2014 13:46:00 +0000 (06:46 -0700)
On Fedora 20, with wireshark-devel installed, 'make rpm' failed
due to installed but unpackaged files related to wireshark.  As
F20 is already released without wireshark, I chose to add a new
sub-package that is enabled only for F21 and later.  Furthermore,
all existing wireshark plugins belong to the wireshark package,
so I got to invent behavior of how the first third-party wireshark
module will behave.

* libvirt.spec.in (with_wireshark): Add new conditional.
* configure.ac (ws-plugindir): Improve wording.

Signed-off-by: Eric Blake <eblake@redhat.com>
configure.ac
libvirt.spec.in

index 884e0e453fbbb200787ed0799346947201e71963..23e22017f6d24f7203fded76d22e681c7c9d328c 100644 (file)
@@ -2578,8 +2578,8 @@ AM_CONDITIONAL([WITH_WIRESHARK_DISSECTOR], [test "$with_wireshark_dissector" = "
 
 AC_ARG_WITH([ws-plugindir],
   [AS_HELP_STRING([--with-ws-plugindir],
-    [wireshark plugins directory that plugin will installed])],
-  [ ws_plugindir=$withval ])
+    [wireshark plugins directory for use when installing wireshark plugin])],
+  [ws_plugindir=$withval])
 
 if test "$with_wireshark_dissector" != "no" && test -z "$ws_plugindir"; then
     ws_version=`$WIRESHARK -v | head -1 | cut -f 2 -d' '`
index 5229ece5d8c2b41c1e9f830434f13d4d22e2557a..e006f2b15894c5bbceeb763cde7d20e0f52f8ede 100644 (file)
 %define with_numad         0%{!?_without_numad:0}
 %define with_firewalld     0%{!?_without_firewalld:0}
 %define with_libssh2       0%{!?_without_libssh2:0}
+%define with_wireshark     0%{!?_without_wireshark:0}
 
 # Non-server/HV driver defaults which are always enabled
 %define with_sasl          0%{!?_without_sasl:1}
     %define with_libssh2 0%{!?_without_libssh2:1}
 %endif
 
+# Enable wireshark plugins for all distros shipping libvirt 1.2.2 or newer
+%if 0%{?fedora} >= 21
+    %define with_wireshark 0%{!?_without_wireshark:1}
+%endif
+
 # Disable some drivers when building without libvirt daemon.
 # The logic is the same as in configure.ac
 %if ! %{with_libvirtd}
@@ -631,6 +637,10 @@ BuildRequires: scrub
 BuildRequires: numad
 %endif
 
+%if %{with_wireshark}
+BuildRequires: wireshark-devel
+%endif
+
 Provides: bundled(gnulib)
 
 %description
@@ -1115,6 +1125,17 @@ Requires: cyrus-sasl-md5
 Shared libraries and client binaries needed to access to the
 virtualization capabilities of recent versions of Linux (and other OSes).
 
+%if %{with_wireshark}
+%package wireshark
+Summary: Wireshark dissector plugin for libvirt RPC transactions
+Group: Development/Libraries
+Requires: wireshark
+Requires: %{name}-client = %{version}-%{release}
+
+%description wireshark
+Wireshark dissector plugin for better analysis of libvirt RPC traffic.
+%endif
+
 %if %{with_lxc}
 %package login-shell
 Summary: Login shell for connecting users to an LXC container
@@ -1340,6 +1361,10 @@ driver
     %define _with_firewalld --with-firewalld
 %endif
 
+%if ! %{with_wireshark}
+    %define _without_wireshark --without-wireshark-dissector
+%endif
+
 %define when  %(date +"%%F-%%T")
 %define where %(hostname)
 %define who   %{?packager}%{!?packager:Unknown}
@@ -1412,6 +1437,7 @@ driver
            %{?_without_dtrace} \
            %{?_without_driver_modules} \
            %{?_with_firewalld} \
+           %{?_without_wireshark} \
            %{with_packager} \
            %{with_packager_version} \
            --with-qemu-user=%{qemu_user} \
@@ -1442,6 +1468,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.a
 rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.la
 rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.a
 %endif
+%if %{with_wireshark}
+rm -f $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/*/libvirt.la
+%endif
 
 %if %{with_network}
 install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/libvirt/dnsmasq/
@@ -2117,6 +2146,11 @@ exit 0
 %config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
 %endif
 
+%if %{with_wireshark}
+%files wireshark
+%{_libdir}/wireshark/plugins/*/libvirt.so
+%endif
+
 %if %{with_lxc}
 %files login-shell
 %attr(4750, root, virtlogin) %{_bindir}/virt-login-shell