File python-virtinst.spec of Package python-virtinst

#
# spec file for package python-virtinst
#
# Copyright (c) 2011 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

Name:           python-%{appname}
Version:        0.500.4
Release:        1
Source0:        http://virt-manager.org/download/sources/%{appname}/%{appname}-%{version}.tar.gz
Patch100:       suse_fix_for_kvm.diff

License:        GPLv2+
Group:          System/Monitoring
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
#BuildArch: noarch
Url:            http://virt-manager.et.redhat.com/download.html
Provides:       virt-install
Provides:       virt-clone
Provides:       virt-image
Provides:       virt-pack
Provides:       virt-convert
Requires:       libvirt-python >= 0.4.5-2.fc10
Requires:       libxml2-python
Requires:       python-urlgrabber
%if 0%{suse_version} == 0
Requires:       libselinux-python
Requires:       urlgrabber
%endif
BuildRequires:  gettext
BuildRequires:  python-devel

%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}
%patch100

%build
python setup.py build

%install
#rm -rf $RPM_BUILD_ROOT
python setup.py install -O1 --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
openSUSE Build Service is sponsored by