[libvirt] [PATCH] rpm: create libvirt-wireshark sub-package

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-part 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> --- I was tempted to push this as a build-breaker fix for 'make rpm', but rpms are close enough to black magic that I decided a review is safer, after all. Tested with both F20 (not built) and F21 (new subpackage built just fine), using normal build of all subpackages and also a build with '%client_only 1' in ~/.rpmmacros to ensure that it indeed works in a client-only setup. configure.ac | 4 ++-- libvirt.spec.in | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 884e0e4..23e2201 100644 --- a/configure.ac +++ b/configure.ac @@ -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' '` diff --git a/libvirt.spec.in b/libvirt.spec.in index 5229ece..e006f2b 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -129,6 +129,7 @@ %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} @@ -269,6 +270,11 @@ %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 -- 1.8.5.3

On Tue, Feb 04, 2014 at 03:15:56PM -0700, Eric Blake wrote:
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-part 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> ---
I was tempted to push this as a build-breaker fix for 'make rpm', but rpms are close enough to black magic that I decided a review is safer, after all. Tested with both F20 (not built) and F21 (new subpackage built just fine), using normal build of all subpackages and also a build with '%client_only 1' in ~/.rpmmacros to ensure that it indeed works in a client-only setup.
configure.ac | 4 ++-- libvirt.spec.in | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-)
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 02/05/2014 02:51 AM, Daniel P. Berrange wrote:
On Tue, Feb 04, 2014 at 03:15:56PM -0700, Eric Blake wrote:
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-part 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> ---
I was tempted to push this as a build-breaker fix for 'make rpm', but rpms are close enough to black magic that I decided a review is safer, after all. Tested with both F20 (not built) and F21 (new subpackage built just fine), using normal build of all subpackages and also a build with '%client_only 1' in ~/.rpmmacros to ensure that it indeed works in a client-only setup.
configure.ac | 4 ++-- libvirt.spec.in | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-)
ACK
Thanks; pushed. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 02/05/2014 02:51 AM, Daniel P. Berrange wrote:
On Tue, Feb 04, 2014 at 03:15:56PM -0700, Eric Blake wrote:
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-part 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> ---
I was tempted to push this as a build-breaker fix for 'make rpm', but rpms are close enough to black magic that I decided a review is safer, after all. Tested with both F20 (not built) and F21 (new subpackage built just fine), using normal build of all subpackages and also a build with '%client_only 1' in ~/.rpmmacros to ensure that it indeed works in a client-only setup.
configure.ac | 4 ++-- libvirt.spec.in | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-)
ACK
Hmm, should the generic 'libvirt' metapackage also Require: the libvirt-wireshark subpackage, so that we keep the status quo that installing just libvirt pulls in all subpackages? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 12.02.2014 21:15, Eric Blake wrote:
On 02/05/2014 02:51 AM, Daniel P. Berrange wrote:
On Tue, Feb 04, 2014 at 03:15:56PM -0700, Eric Blake wrote:
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-part 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> ---
I was tempted to push this as a build-breaker fix for 'make rpm', but rpms are close enough to black magic that I decided a review is safer, after all. Tested with both F20 (not built) and F21 (new subpackage built just fine), using normal build of all subpackages and also a build with '%client_only 1' in ~/.rpmmacros to ensure that it indeed works in a client-only setup.
configure.ac | 4 ++-- libvirt.spec.in | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-)
ACK
Hmm, should the generic 'libvirt' metapackage also Require: the libvirt-wireshark subpackage, so that we keep the status quo that installing just libvirt pulls in all subpackages?
Well, I think we should intentionally break that rule here. Otherwise: yum install libvirt drags in wireshark as a dependency. There wouldn't be anything bad about it, except the wireshark plugin is expected to be used by developers, not an ordinary users. If I were an ordinary user I'd be very curious why I need to install wireshark to run libvirt. Michal

On Thu, Feb 13, 2014 at 09:38:53AM +0100, Michal Privoznik wrote:
On 12.02.2014 21:15, Eric Blake wrote:
On 02/05/2014 02:51 AM, Daniel P. Berrange wrote:
On Tue, Feb 04, 2014 at 03:15:56PM -0700, Eric Blake wrote:
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-part 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> ---
I was tempted to push this as a build-breaker fix for 'make rpm', but rpms are close enough to black magic that I decided a review is safer, after all. Tested with both F20 (not built) and F21 (new subpackage built just fine), using normal build of all subpackages and also a build with '%client_only 1' in ~/.rpmmacros to ensure that it indeed works in a client-only setup.
configure.ac | 4 ++-- libvirt.spec.in | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-)
ACK
Hmm, should the generic 'libvirt' metapackage also Require: the libvirt-wireshark subpackage, so that we keep the status quo that installing just libvirt pulls in all subpackages?
Well, I think we should intentionally break that rule here. Otherwise:
yum install libvirt
drags in wireshark as a dependency. There wouldn't be anything bad about it, except the wireshark plugin is expected to be used by developers, not an ordinary users. If I were an ordinary user I'd be very curious why I need to install wireshark to run libvirt.
I agree, we should *not* have 'libvirt' depend on the wireshark plugin. We should treat 'libvirt' as pulling in everything that it would have done in the past before we split the RPMs. So by that rationale new functionality is out of scope. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 02/13/2014 03:52 AM, Daniel P. Berrange wrote:
yum install libvirt
drags in wireshark as a dependency. There wouldn't be anything bad about it, except the wireshark plugin is expected to be used by developers, not an ordinary users. If I were an ordinary user I'd be very curious why I need to install wireshark to run libvirt.
I agree, we should *not* have 'libvirt' depend on the wireshark plugin. We should treat 'libvirt' as pulling in everything that it would have done in the past before we split the RPMs. So by that rationale new functionality is out of scope.
Then I'll revert the patch that I already pushed (sorry for not waiting for this conversation to come to a conclusion). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 02/13/2014 06:30 AM, Eric Blake wrote:
On 02/13/2014 03:52 AM, Daniel P. Berrange wrote:
yum install libvirt
drags in wireshark as a dependency. There wouldn't be anything bad about it, except the wireshark plugin is expected to be used by developers, not an ordinary users. If I were an ordinary user I'd be very curious why I need to install wireshark to run libvirt.
I agree, we should *not* have 'libvirt' depend on the wireshark plugin. We should treat 'libvirt' as pulling in everything that it would have done in the past before we split the RPMs. So by that rationale new functionality is out of scope.
Then I'll revert the patch that I already pushed (sorry for not waiting for this conversation to come to a conclusion).
A further argument in favor of reverting: 'libvirt' does not depend on 'libvirt-devel', so it already does not pull in EVERY subpackage, just subpackages related to FULL features of libvirtd. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Michal Privoznik