File python-virtinst.spec of Package python-virtinst
#
# spec file for package python-virtinst
#
# Copyright (c) 2013 SUSE LINUX Products 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/
#
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
# This macro is used for the continuous automated builds. It just
# allows an extra fragment based on the timestamp to be appended
# to the release. This distinguishes automated builds, from formal
# Fedora RPM builds
%define _extra_release %{?dist:%{dist}}%{!?dist:%{?extra_release:%{extra_release}}}
%define appname virtinst
%if 0%{?fedora} >= 9 || 0%{suse_version}
%define with_egg 1
%else
%define with_egg 0
%endif
Summary: Python modules and tools for creating virtual machines with libvirt
License: GPL-2.0+
Group: System/Monitoring
Name: python-%{appname}
Version: 0.600.3
Release: 0
Source0: %{appname}-%{version}.tar.bz2
Patch0: virtinst-git-lun.diff
Patch10: virtinst-cdrom.diff
Patch12: virtinst-storage-ocfs2.diff
Patch13: virtinst-qed.diff
Patch14: virtinst-add-cache-modes.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#BuildArch: noarch
Url: http://virt-manager.org
Provides: virt-clone
Provides: virt-convert
Provides: virt-image
Provides: virt-install
Provides: virt-pack
Requires: libvirt-python >= 0.4.5
Requires: libxml2-python
Requires: python-urlgrabber
%if 0%{suse_version} == 0
Requires: libselinux-python
Requires: urlgrabber
%endif
BuildRequires: gettext
BuildRequires: python-devel
Conflicts: virt-manager <= 0.9.0
%description
pyhon-virtinst contains python modules and tools (virt-install,
virt-clone and virt-image) for installing and cloning virtual machines
using libvirt. It supports both paravirtulized guest and guests fully
virtualized guests. Supported hypervisors are Xen, qemu (QEMU) and kvm
(KVM).
%prep
%setup -q -n %{appname}-%{version}
%patch0 -p1
%patch10 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%build
python setup.py build
%install
python setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
# Back compat in case people hardcoded old /usr/sbin/virt-install location
mkdir -p $RPM_BUILD_ROOT/%{_sbindir}
ln -s ../bin/virt-install $RPM_BUILD_ROOT/%{_sbindir}/virt-install
%find_lang %{appname} || echo 0
echo "sitelib: "%{python_sitelib}
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{appname}.lang
%defattr(-,root,root)
%doc README COPYING AUTHORS ChangeLog NEWS doc/image.rng doc/example1.xml
%dir %{python_sitelib}/%{appname}
%dir %{python_sitelib}/virtconv
%{python_sitelib}/%{appname}/*
%{python_sitelib}/virtconv/*
%if %{with_egg}
%{python_sitelib}/%{appname}-*.egg-info
%endif
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_sbindir}/virt-install
%{_bindir}/virt-install
%{_bindir}/virt-clone
%{_bindir}/virt-image
%{_bindir}/virt-convert
%changelog