2006-03-29 15:40:14 +04:00
# -*- rpm-spec -*-
2011-03-29 17:36:07 +04:00
2015-12-29 20:00:40 +03:00
%global with_guestfs 0
%global stable_defaults 0
%global askpass_package " o p e n s s h - a s k p a s s "
%global qemu_user " q e m u "
%global libvirt_packages " l i b v i r t - d a e m o n - k v m , l i b v i r t - d a e m o n - c o n f i g - n e t w o r k "
%global kvm_packages " "
%global preferred_distros " f e d o r a , r h e l "
%global default_hvs " q e m u , x e n , l x c "
2013-04-17 00:42:25 +04:00
%if 0%{?rhel}
2015-12-29 20:00:40 +03:00
%global preferred_distros " r h e l , f e d o r a "
%global stable_defaults 1
2012-07-10 00:07:32 +04:00
%endif
2013-04-17 00:42:25 +04:00
# End local config
2011-08-01 20:08:08 +04:00
2013-03-17 05:32:29 +04:00
Name : virt-manager
2014-03-07 18:57:04 +04:00
Version : @VERSION@
2015-02-22 19:32:02 +03:00
Release : 1%{?dist}
2015-12-29 20:00:40 +03:00
%global verrel %{version} -%{release}
2006-03-29 15:40:14 +04:00
2015-09-03 19:44:02 +03:00
Summary : Desktop tool for managing virtual machines via libvirt
2006-03-29 15:40:14 +04:00
Group : Applications/Emulators
2007-11-20 19:12:20 +03:00
License : GPLv2+
2016-05-21 00:15:18 +03:00
BuildArch : noarch
2008-09-11 02:51:18 +04:00
URL : http://virt-manager.org/
Source0 : http://virt-manager.org/download/sources/%{name} /%{name} -%{version} .tar.gz
2006-03-29 15:40:14 +04:00
2013-03-18 03:32:19 +04:00
2013-05-10 02:32:30 +04:00
Requires : virt-manager-common = %{verrel}
2012-05-14 17:24:56 +04:00
Requires : pygobject3
Requires : gtk3
2013-04-17 12:38:34 +04:00
Requires : libvirt-glib >= 0.0.9
2013-10-05 00:34:19 +04:00
Requires : dconf
2013-12-14 20:43:19 +04:00
Requires : dbus-x11
2013-04-17 00:42:25 +04:00
2015-12-24 20:29:46 +03:00
# The vte291 package is actually the latest vte with API version 2.91, while
# the vte3 package is effectively a compat package with API version 2.90.
# virt-manager works fine with either, so pull the latest bits so there's
# no ambiguity.
Requires : vte291
2007-07-07 01:46:50 +04:00
# For console widget
2012-05-14 17:24:56 +04:00
Requires : gtk-vnc2
Requires : spice-gtk3
2015-03-30 19:47:39 +03:00
%if 0%{?rhel} == 7
2014-10-01 13:49:52 +04:00
Requires : gnome-icon-theme
2015-03-30 19:47:39 +03:00
%endif
2013-04-17 00:42:25 +04:00
2007-05-18 20:14:33 +04:00
BuildRequires : intltool
2013-03-01 21:40:48 +04:00
BuildRequires : /usr/bin/pod2man
2016-06-18 23:58:21 +03:00
# For python, and python2 rpm macros
BuildRequires : python2-devel
2006-03-29 15:40:14 +04:00
2013-04-17 00:42:25 +04:00
2006-03-29 15:40:14 +04:00
%description
2008-09-10 19:18:06 +04:00
Virtual Machine Manager provides a graphical tool for administering virtual
2013-09-24 04:40:43 +04:00
machines for KVM, Xen, and LXC. Start, stop, add or remove virtual devices,
2008-09-10 19:18:06 +04:00
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.
2006-03-29 15:40:14 +04:00
2013-03-18 03:32:19 +04:00
%package common
Summary : Common files used by the different Virtual Machine Manager interfaces
Group : Applications/Emulators
# This version not strictly required: virt-manager should work with older,
# however varying amounts of functionality will not be enabled.
Requires : libvirt-python >= 0.7.0
Requires : libxml2-python
2015-09-19 01:31:56 +03:00
Requires : python-requests
2017-10-11 14:35:48 +03:00
Requires : python-ipaddress (For Python 2)
2014-10-31 22:09:54 +03:00
Requires : libosinfo >= 0.2.10
2015-02-24 19:23:46 +03:00
# Required for gobject-introspection infrastructure
Requires : pygobject3-base
2018-01-06 22:18:19 +03:00
# Required for pulling files from iso media with isoinfo
Requires : genisoimage
2013-03-18 03:32:19 +04:00
%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
Requires : virt-manager-common = %{verrel}
2017-02-05 23:44:33 +03:00
# For 'virsh console'
Requires : libvirt-client
2013-03-18 03:32:19 +04:00
Provides : virt-install
Provides : virt-clone
Provides : virt-convert
2014-01-19 19:37:14 +04:00
Provides : virt-xml
2013-03-18 03:32:19 +04:00
Obsoletes : python-virtinst
%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).
2006-03-29 15:40:14 +04:00
%prep
%setup -q
2016-06-17 19:56:14 +03:00
2006-03-29 15:40:14 +04:00
%build
2011-03-29 17:36:07 +04:00
%if %{qemu_user}
2015-12-29 20:00:40 +03:00
%global _qemu_user --qemu-user=%{qemu_user}
2011-03-29 17:36:07 +04:00
%endif
%if %{kvm_packages}
2015-12-29 20:00:40 +03:00
%global _kvm_packages --kvm-package-names=%{kvm_packages}
2011-03-29 17:36:07 +04:00
%endif
%if %{preferred_distros}
2015-12-29 20:00:40 +03:00
%global _preferred_distros --preferred-distros=%{preferred_distros}
2011-03-29 17:36:07 +04:00
%endif
%if %{libvirt_packages}
2015-12-29 20:00:40 +03:00
%global _libvirt_packages --libvirt-package-names=%{libvirt_packages}
2011-03-29 17:36:07 +04:00
%endif
2012-07-09 03:42:06 +04:00
%if %{askpass_package}
2015-12-29 20:00:40 +03:00
%global _askpass_package --askpass-package-names=%{askpass_package}
2012-07-09 03:42:06 +04:00
%endif
2014-01-20 20:09:13 +04:00
%if %{stable_defaults}
2015-12-29 20:00:40 +03:00
%global _stable_defaults --stable-defaults
2011-03-29 17:36:07 +04:00
%endif
2015-04-06 23:29:28 +03:00
%if %{default_hvs}
2015-12-29 20:00:40 +03:00
%global _default_hvs --default-hvs %{default_hvs}
2015-04-06 23:29:28 +03:00
%endif
2013-03-17 05:32:29 +04:00
python setup.py configure \
%{?_qemu_user} \
%{?_kvm_packages} \
%{?_libvirt_packages} \
%{?_askpass_package} \
%{?_preferred_distros} \
2015-04-06 23:29:28 +03:00
%{?_stable_defaults} \
%{?_default_hvs}
2006-03-29 15:40:14 +04:00
%install
2015-11-03 00:19:31 +03:00
python setup.py \
--no-update-icon-cache --no-compile-schemas \
install -O1 --root=%{buildroot}
2006-08-08 20:02:00 +04:00
%find_lang %{name}
2006-03-29 15:40:14 +04:00
2016-06-17 19:56:14 +03:00
# Replace '#!/usr/bin/env python2' with '#!/usr/bin/python2'
# The format is ideal for upstream, but not a distro. See:
# https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython
for f in $(find %{buildroot} -type f -executable -print); do
sed -i " 1 s | ^ # ! / u s r / b i n / e n v p y t h o n 2 | # ! %{__python 2 } | " $f || :
done
2015-04-11 18:14:04 +03:00
# The conversion script was only added to virt-manager after several
# Fedora cycles of using gsettings. Installing it now could convert old data
# and wipe out recent settings.
rm %{buildroot} %{_datadir} /GConf/gsettings/org.virt-manager.virt-manager.convert
2013-03-17 05:32:29 +04:00
2006-09-02 00:33:32 +04:00
%post
2011-08-02 21:19:58 +04:00
/bin/touch --no-create %{_datadir} /icons/hicolor &>/dev/null || :
2013-04-18 01:39:25 +04:00
/usr/bin/update-desktop-database &> /dev/null || :
2007-03-03 00:24:35 +03:00
2013-03-17 05:32:29 +04:00
2006-09-02 00:33:32 +04:00
%postun
2011-08-02 21:19:58 +04:00
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir} /icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir} /icons/hicolor &>/dev/null || :
2013-04-18 01:39:25 +04:00
/usr/bin/glib-compile-schemas %{_datadir} /glib-2.0/schemas &> /dev/null || :
2011-08-02 21:19:58 +04:00
fi
2013-04-18 01:39:25 +04:00
/usr/bin/update-desktop-database &> /dev/null || :
2006-09-04 23:19:23 +04:00
2013-03-17 05:32:29 +04:00
2011-08-02 21:19:58 +04:00
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir} /icons/hicolor &>/dev/null || :
2013-04-18 01:39:25 +04:00
/usr/bin/glib-compile-schemas %{_datadir} /glib-2.0/schemas &> /dev/null || :
2011-07-14 02:00:28 +04:00
2013-03-17 05:32:29 +04:00
2011-07-14 02:00:28 +04:00
%files
2016-12-26 14:52:26 +03:00
%doc README.md COPYING NEWS.md
2006-06-27 01:17:45 +04:00
%{_bindir} /%{name}
2006-07-25 15:24:09 +04:00
2008-09-11 02:51:18 +04:00
%{_mandir} /man1/%{name} .1*
2013-03-17 05:32:29 +04:00
%{_datadir} /%{name} /ui/*.ui
2013-04-19 00:03:43 +04:00
%{_datadir} /%{name} /virt-manager
%{_datadir} /%{name} /virtManager
2006-07-25 15:24:09 +04:00
2011-07-12 19:50:11 +04:00
%{_datadir} /%{name} /icons
%{_datadir} /icons/hicolor/*/apps/*
2010-03-23 21:27:30 +03:00
2013-09-24 04:40:43 +04:00
%{_datadir} /appdata/%{name} .appdata.xml
2011-07-14 02:00:28 +04:00
%{_datadir} /applications/%{name} .desktop
2013-04-18 01:39:25 +04:00
%{_datadir} /glib-2.0/schemas/org.virt-manager.virt-manager.gschema.xml
2013-03-17 05:32:29 +04:00
2011-07-14 02:00:28 +04:00
%files common -f %{name}.lang
%dir %{_datadir} /%{name}
2013-04-11 01:13:02 +04:00
%{_datadir} /%{name} /virtcli
2013-03-18 03:32:19 +04:00
%{_datadir} /%{name} /virtconv
%{_datadir} /%{name} /virtinst
2006-07-25 15:24:09 +04:00
2013-03-18 03:32:19 +04:00
%files -n virt-install
%{_mandir} /man1/virt-install.1*
%{_mandir} /man1/virt-clone.1*
%{_mandir} /man1/virt-convert.1*
2014-01-19 19:37:14 +04:00
%{_mandir} /man1/virt-xml.1*
2013-03-18 03:32:19 +04:00
%{_datadir} /%{name} /virt-install
%{_datadir} /%{name} /virt-clone
%{_datadir} /%{name} /virt-convert
2014-01-19 19:37:14 +04:00
%{_datadir} /%{name} /virt-xml
2013-03-18 03:32:19 +04:00
%{_bindir} /virt-install
%{_bindir} /virt-clone
%{_bindir} /virt-convert
2014-01-19 19:37:14 +04:00
%{_bindir} /virt-xml