virt-manager/virt-manager.spec
Charles Arnold e13bfa2325 Accepting request 555034 from home:cbosdonnat:branches:Virtualization
- bsc#1070896 - virt-manager will not run on a python3 only system
  remove obsolete python-gconf dependency. This one was also pulling
  python2.

OBS-URL: https://build.opensuse.org/request/show/555034
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=385
2017-12-07 17:12:43 +00:00

428 lines
14 KiB
RPMSpec

#
# spec file for package virt-manager
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define with_guestfs 0
%define askpass_package "openssh-askpass"
%define qemu_user "qemu"
%define libvirt_kvm_packages ""
%define libvirt_xen_packages ""
%define preferred_distros "sles12sp3,opensuse42.3"
%define kvm_packages ""
%define _version 1.4.3
%define _release 0
Name: virt-manager
Version: 1.4.3
Release: 0
Summary: Virtual Machine Manager
License: GPL-2.0+
Group: System/Monitoring
Url: http://virt-manager.org/
Source0: %{name}-%{version}.tar.bz2
Source1: virt-install.rb
Source2: virt-install.desktop
Source3: virt-manager-supportconfig
# Upstream Patches
Patch1: 3b769643-dont-add-URI-into-params-for-tunneled-migration.patch
Patch2: 6dfc4de1-add-support-for-parsing-formatting-SR-IOV-VFs.patch
Patch3: 083dfcc8-Show-details-about-the-network-of-SR-IOV-VF-pool.patch
Patch4: 9a9f9ecd-ignore-comments-in-keymap-conf-files.patch
Patch5: 9617d126-systray-Use-APPLICATION_STATUS-for-appindicator.patch
Patch6: e73abe5a-diskbackend-convert-to-long-the-calculated-size.patch
Patch7: 6e6f59e7-diskbackend-get-a-proper-size-of-existing-block-device-while-cloning.patch
Patch8: 23aaf852-network-Set-bridge-name-to-None-instead-of-blank.patch
Patch9: d1e1cf64-progress-remove-trailing-white-space.patch
Patch10: 63fce081-pycodestyle-Use-isinstance-for-type-checking.patch
Patch11: 08a58d61-pycodestyle-remove-description-of-fixed-errors.patch
Patch12: bc3c9a9d-progress-remove-unused-import.patch
Patch13: 2d276ebe-progress-dont-overwrite-format.patch
Patch14: e2ad4b2f-convert-iteritems-to-items.patch
Patch15: dff00d4f-remove-deprecated-statvfs-module.patch
Patch16: 75210ed3-replace-StringIO-with-io.patch
Patch17: a2bcd6c4-dont-compare-between-None-and-int.patch
Patch18: 44de92b7-use-reload-from-imp-module.patch
Patch19: 69c84bea-import-reduce-from-functools-module.patch
Patch20: 37ea5207-replace-StandardError-with-Exception.patch
Patch21: f41aafc7-Use-enumerate-instead-of-range-and-len.patch
Patch22: 91c0669c-cli-Fix-OrderedDict-mutated-during-iteration-on-python3.patch
Patch23: b8fa0c6b-xmlnsqemu-order-XML-output-like-libvirt-does.patch
Patch24: d2648d81-virtconv-dont-implicitly-depend-on-dict-hash-order.patch
Patch25: 999dbb36-cli-Make-VirtCLIArgument-instantiation-less-crazy.patch
Patch26: 7f1b4cee-pycodestyle-fix-all-E125-warnings.patch
Patch27: d82022bd-manager-drop-python2-only-cmp-usage.patch
Patch28: 374a3779-urlfetcher-write-test-file-as-binary-content.patch
Patch29: f7c8cf9f-devicepanic-dont-return-empty-model-list.patch
Patch30: 3be78d1f-addhardware-dont-allow-panic-option-where-not-supported.patch
Patch31: 73de8285-systray-remove-redundant-variable-assignment.patch
Patch32: b9bc3b60-undefine-only-persistent-domain.patch
Patch33: 7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch
Patch34: 2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch
Patch35: f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch
# SUSE Only
Patch70: virtman-desktop.patch
Patch71: virtman-kvm.patch
Patch72: virtman-keycombo.patch
Patch73: virtman-show-suse-install-repos.patch
Patch74: virtman-libvirtd-not-running.patch
Patch75: virtman-dont-allow-grub.xen-to-be-deleted.patch
Patch76: virtinst-pvgrub2-bootloader.patch
Patch77: virtinst-nfs-install-sanitize.patch
# Features or Enhancements
Patch101: virtman-default-guest-from-host-os.patch
Patch102: virtman-default-to-xen-pv.patch
Patch103: virtman-packages.patch
Patch104: virtman-load-stored-uris.patch
Patch105: virtman-add-connect-default.patch
Patch120: virtinst-storage-ocfs2.patch
Patch121: virtinst-default-xen-to-qcow2-format.patch
Patch122: virtinst-detect-oes-distros.patch
Patch123: virtinst-modify-gui-defaults.patch
Patch124: virtinst-vol-default-nocow.patch
Patch125: virtinst-set-cache-mode-unsafe-for-install.patch
Patch126: virtinst-set-qemu-emulator.patch
Patch127: virtinst-add-ppc64-arch-support.patch
Patch128: virtinst-s390x-disable-graphics.patch
Patch129: virtinst-add-caasp-support.patch
# Bug Fixes
Patch150: virtman-prevent-double-click-starting-vm-twice.patch
Patch151: virtman-increase-setKeepAlive-count.patch
Patch152: virtman-allow-destroy-from-shutdown-menu-of-crashed-vm.patch
Patch153: virtman-check-for-valid-display.patch
Patch154: virtman-allow-creating-i686-vm.patch
Patch155: virtman-dont-specify-vte-version.patch
Patch160: virtinst-xen-drive-type.patch
Patch161: virtinst-xenbus-disk-index-fix.patch
Patch162: virtinst-refresh_before_fetch_pool.patch
Patch163: virtinst-use-xenpae-kernel-for-32bit.patch
Patch164: virtinst-use-qemu-for-cdrom-device.patch
Patch165: virtinst-fix-sle-distro-parsing.patch
Patch166: virtinst-check-date-format.patch
Patch167: virtinst-no-usb-tablet-for-xenpv.patch
Patch168: virtinst-add-sle15-detection-support.patch
Patch169: virtinst-keep-install-iso-attached.patch
# Python2 to Python3 patches
Patch200: virtmisc-python2-to-python3-conversion.patch
Patch201: virtcli-python2-to-python3-conversion.patch
Patch202: virtconv-python2-to-python3-conversion.patch
Patch203: virtinst-python2-to-python3-conversion.patch
Patch204: virtman-python2-to-python3-conversion.patch
Patch205: virttests-python2-to-python3-conversion.patch
Patch206: 0001-virtinst-python3-terminal-width-should-be-int.patch
Patch207: 0002-virtinst-python3-avoid-comparison-of-None-and-int.patch
Patch208: 0003-virtinst-python3-avoid-using-long-type.patch
Patch209: 0004-virtinst-python3-use-binary-mode-for-kernel.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define verrel %{version}-%{release}
Requires: dbus-1-x11
Requires: dconf
Requires: gtk3
Requires: python3-gobject-Gdk
# For console widget
Requires: python3-gobject-cairo
Recommends: python3-SpiceClientGtk
Requires: virt-install
Requires: virt-manager-common = %{verrel}
%if 0%{?is_opensuse} == 1
# virtman-desktop.patch changes the icon to be yast-vm-management, which is provided by yast2-branding
Requires: yast2-branding-openSUSE
%endif
%if %{with_guestfs}
Requires: python3-libguestfs
%endif
BuildRequires: glib2-devel
BuildRequires: gtk2-tools
BuildRequires: intltool
BuildRequires: perl
BuildRequires: python3
%description
Virtual Machine Manager provides a graphical tool for administering virtual
machines for KVM, Xen, and QEmu. Start, stop, add or remove virtual devices,
connect to a graphical or serial console, and see resource usage statistics
for existing VMs on local or remote machines. Uses libvirt as the backend
management API.
%package common
Summary: Common files used by the different Virtual Machine Manager interfaces
Group: System/Monitoring
# This version not strictly required: virt-manager should work with older,
# however varying amounts of functionality will not be enabled.
Requires: libosinfo >= 0.2.10
Requires: python3-ipaddr
Requires: python3-libvirt-python >= 0.7.0
Requires: python3-libxml2-python
Requires: python3-pycurl
Requires: typelib(LibvirtGLib)
Recommends: python3-virt-bootstrap
BuildRequires: gobject-introspection
# No AppIndicator package on SLE
%if 0%{?is_opensuse} == 0
%define __requires_exclude typelib\\(AppIndicator3\\)
%endif
%description common
Common files used by the different virt-manager interfaces, as well as
virt-install related tools.
%package -n virt-install
Summary: Utilities for installing virtual machines
Group: System/Monitoring
Requires: virt-manager-common = %{verrel}
Requires: python3-requests
Provides: python3-virtinst
Provides: virt-clone
Provides: virt-convert
Obsoletes: python-virtinst <= 0.600.4
Supplements: virt-manager
%description -n virt-install
Package includes several command line utilities, including virt-install
(build and install new VMs) and virt-clone (clone an existing virtual
machine).
%prep
%setup -q
# Upstream Patches
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
# SUSE Only
%patch70 -p1
%patch71 -p1
%patch72 -p1
%patch73 -p1
%patch74 -p1
%patch75 -p1
%patch76 -p1
%patch77 -p1
# Enhancements
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch120 -p1
%patch121 -p1
%patch122 -p1
%patch123 -p1
%patch124 -p1
%patch125 -p1
%patch126 -p1
%patch127 -p1
%patch128 -p1
%patch129 -p1
# Bug Fixes
%patch150 -p1
%patch151 -p1
%patch152 -p1
%patch153 -p1
%patch154 -p1
%patch155 -p1
%patch160 -p1
%patch161 -p1
%patch162 -p1
%patch163 -p1
%patch164 -p1
%patch165 -p1
%patch166 -p1
%patch167 -p1
%patch168 -p1
%patch169 -p1
# Python2 to Python3 patches
%patch200 -p1
%patch201 -p1
%patch202 -p1
%patch203 -p1
%patch204 -p1
%patch205 -p1
%patch206 -p1
%patch207 -p1
%patch208 -p1
%patch209 -p1
%build
%if %{qemu_user}
%define _qemu_user --qemu-user=%{qemu_user}
%endif
%if %{kvm_packages}
%define _kvm_packages --kvm-package-names=%{kvm_packages}
%endif
%if %{preferred_distros}
%define _preferred_distros --preferred-distros=%{preferred_distros}
%endif
%if %{libvirt_kvm_packages}
%define _libvirt_kvm_packages --libvirt-kvm-package-names=%{libvirt_kvm_packages}
%endif
%if %{libvirt_xen_packages}
%define _libvirt_xen_packages --libvirt-xen-package-names=%{libvirt_xen_packages}
%endif
%if %{askpass_package}
%define _askpass_package --askpass-package-names=%{askpass_package}
%endif
python3 setup.py configure \
--prefix=%{_prefix} \
--default-graphics="spice" \
%{?_qemu_user} \
%{?_kvm_packages} \
%{?_libvirt_kvm_packages} \
%{?_libvirt_xen_packages} \
%{?_askpass_package} \
%{?_preferred_distros} \
%{?_default_graphics}
%install
python3 setup.py \
--no-update-icon-cache \
--no-compile-schemas install \
--prefix=%{_prefix} \
-O1 --root=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/YaST2/clients/
install -m644 %SOURCE1 $RPM_BUILD_ROOT/%{_datadir}/YaST2/clients/virt-install.rb
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications/YaST2/
install -m644 %SOURCE2 $RPM_BUILD_ROOT/%{_datadir}/applications/YaST2/virt-install.desktop
# Oddly, supportconfig doesn't execute plugins with '-' in the name, so use 'virt_manager'
mkdir -p $RPM_BUILD_ROOT/usr/lib/supportconfig/plugins
install -m 755 %SOURCE3 $RPM_BUILD_ROOT/usr/lib/supportconfig/plugins/virt_manager
%find_lang %{name}
%post
/bin/touch --no-create %{_datadir}/icons/hicolor >/dev/null 2>&1 || :
/usr/bin/update-desktop-database > /dev/null 2>&1 || :
%postun
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor >/dev/null 2>&1
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor >/dev/null 2>&1 || :
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas > /dev/null 2>&1 || :
fi
/usr/bin/update-desktop-database > /dev/null 2>&1 || :
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor >/dev/null 2>&1 || :
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas > /dev/null 2>&1 || :
%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
%dir /usr/share/virt-manager/ui
%{_datadir}/%{name}/ui/*.ui
%{_datadir}/%{name}/virt-manager
%{_datadir}/%{name}/virtManager
%dir /usr/share/icons/hicolor
%dir /usr/share/icons/hicolor/*/
%dir /usr/share/icons/hicolor/*/apps
%{_datadir}/%{name}/icons
%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/YaST2/virt-install.desktop
%{_datadir}/glib-2.0/schemas/org.virt-manager.virt-manager.gschema.xml
%{_datadir}/GConf/gsettings/org.virt-manager.virt-manager.convert
%dir /usr/lib/supportconfig
%dir /usr/lib/supportconfig/plugins
/usr/lib/supportconfig/plugins/virt_manager
%files common -f %{name}.lang
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/virtcli
%{_datadir}/%{name}/virtconv
%{_datadir}/%{name}/virtinst
%files -n virt-install
%defattr(-,root,root,-)
%{_mandir}/man1/virt-install.1*
%{_mandir}/man1/virt-clone.1*
%{_mandir}/man1/virt-convert.1*
%{_mandir}/man1/virt-xml.1*
%{_datadir}/%{name}/virt-install
%{_datadir}/%{name}/virt-clone
%{_datadir}/%{name}/virt-convert
%{_datadir}/%{name}/virt-xml
%dir %{_datadir}/YaST2
%dir %{_datadir}/YaST2/clients
%dir %{_datadir}/applications/YaST2
%dir %{_datadir}/GConf
%dir %{_datadir}/GConf/gsettings
%dir %{_datadir}/appdata
%{_datadir}/YaST2/clients/virt-install.rb
%{_bindir}/virt-install
%{_bindir}/virt-clone
%{_bindir}/virt-convert
%{_bindir}/virt-xml
%changelog