2013-11-12 22:21:57 +04:00
2013-12-11 20:31:03 +04:00
%define with_python3 0
%if 0%{?fedora} > 18
%define with_python3 1
%endif
Summary : The libvirt virtualization API python2 binding
2013-11-12 22:21:57 +04:00
Name : libvirt-python
Version : @PY_VERSION@
Release : 1%{?dist} %{?extra_release}
Source0 : http://libvirt.org/sources/python/%{name} -%{version} .tar.gz
2013-11-27 15:57:16 +04:00
Url : http://libvirt.org
2013-11-12 22:21:57 +04:00
License : LGPLv2+
Group : Development/Libraries
BuildRequires : libvirt-devel >= @C_VERSION@
BuildRequires : python-devel
2014-04-02 18:33:53 +04:00
BuildRequires : python-nose
2014-04-07 15:19:45 +04:00
BuildRequires : python-lxml
2013-12-11 20:31:03 +04:00
%if %{with_python3}
BuildRequires : python3-devel
2014-04-02 18:33:53 +04:00
BuildRequires : python3-nose
2014-04-07 15:19:45 +04:00
BuildRequires : python3-lxml
2013-12-11 20:31:03 +04:00
%endif
%if %{with_python3}
%package -n libvirt-python3
Summary : The libvirt virtualization API python3 binding
Url : http://libvirt.org
License : LGPLv2+
Group : Development/Libraries
%endif
2013-11-12 22:21:57 +04:00
2013-11-27 15:57:16 +04:00
# Don't want provides for python shared objects
%{?filter_provides_in: %filter_provides_in %{python_sitearch} /.*\.so}
%{?filter_setup}
2013-11-12 22:21:57 +04:00
%description
The libvirt-python package contains a module that permits applications
written in the Python programming language to use the interface
supplied by the libvirt library to use the virtualization capabilities
of recent versions of Linux (and other OSes).
2013-12-11 20:31:03 +04:00
%if %{with_python3}
%description -n libvirt-python3
The libvirt-python package contains a module that permits applications
written in the Python programming language to use the interface
supplied by the libvirt library to use the virtualization capabilities
of recent versions of Linux (and other OSes).
%endif
2013-11-12 22:21:57 +04:00
%prep
2013-11-27 15:57:16 +04:00
%setup -q
2013-11-12 22:21:57 +04:00
%build
CFLAGS=" $RPM_OPT_FLAGS " %{__python} setup.py build
2013-12-11 20:31:03 +04:00
%if %{with_python3}
CFLAGS=" $RPM_OPT_FLAGS " %{__python 3} setup.py build
%endif
2013-11-12 22:21:57 +04:00
%install
%{__python} setup.py install --skip-build --root=%{buildroot}
2013-12-11 20:31:03 +04:00
%if %{with_python3}
%{__python 3} setup.py install --skip-build --root=%{buildroot}
%endif
2013-11-12 22:21:57 +04:00
rm -f %{buildroot} %{_libdir} /python*/site-packages/*egg-info
2014-04-02 18:33:53 +04:00
%check
%{__python} setup.py test
%if %{with_python3}
%{__python 3} setup.py test
%endif
2013-11-12 22:21:57 +04:00
%files
%defattr (-,root,root)
2013-11-27 15:57:16 +04:00
%doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
2013-12-11 20:31:03 +04:00
%{_libdir} /python2*/site-packages/libvirt.py*
%{_libdir} /python2*/site-packages/libvirt_qemu.py*
%{_libdir} /python2*/site-packages/libvirt_lxc.py*
%{_libdir} /python2*/site-packages/libvirtmod*
%if %{with_python3}
%files -n libvirt-python3
%defattr (-,root,root)
%doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
%{_libdir} /python3*/site-packages/libvirt.py*
%{_libdir} /python3*/site-packages/libvirt_qemu.py*
%{_libdir} /python3*/site-packages/libvirt_lxc.py*
%{_libdir} /python3*/site-packages/__pycache__/libvirt.cpython-*.py*
%{_libdir} /python3*/site-packages/__pycache__/libvirt_qemu.cpython-*.py*
%{_libdir} /python3*/site-packages/__pycache__/libvirt_lxc.cpython-*.py*
%{_libdir} /python3*/site-packages/libvirtmod*
%endif
2013-11-27 15:57:16 +04:00
%changelog