2018-01-11 19:33:47 +03:00
# -*- rpm-spec -*-
2018-01-11 19:32:40 +03:00
# This spec file assumes you are building on a Fedora or RHEL version
# that's still supported by the vendor. It may work on other distros
# or versions, but no effort will be made to ensure that going forward
2021-09-01 20:31:14 +03:00
%define min_rhel 8
%define min_fedora 33
2018-01-11 19:32:40 +03:00
%if (0%{?fedora} && 0%{?fedora} >= %{min_fedora}) || (0%{?rhel} && 0%{?rhel} >= %{min_rhel})
%define supported_platform 1
%else
%define supported_platform 0
%endif
2013-11-12 22:21:57 +04:00
2019-12-04 13:27:36 +03:00
Summary : The libvirt virtualization API python3 binding
2013-11-12 22:21:57 +04:00
Name : libvirt-python
2024-04-29 11:01:53 +03:00
Version : @VERSION@
2019-01-22 14:20:04 +03:00
Release : 1%{?dist}
2021-04-12 20:12:48 +03:00
Source0 : https://libvirt.org/sources/python/%{name} -%{version} .tar.gz
Url : https://libvirt.org
2023-04-26 15:23:11 +03:00
License : LGPL-2.1-or-later
2018-01-11 19:42:12 +03:00
BuildRequires : libvirt-devel == %{version}
2013-12-11 20:31:03 +04:00
BuildRequires : python3-devel
2021-04-08 17:20:46 +03:00
BuildRequires : python3-pytest
2014-04-07 15:19:45 +04:00
BuildRequires : python3-lxml
2022-11-23 15:24:29 +03:00
BuildRequires : python3-setuptools
2018-07-23 14:13:32 +03:00
BuildRequires : gcc
2013-12-11 20:31:03 +04:00
2013-11-27 15:57:16 +04:00
# Don't want provides for python shared objects
2018-01-12 18:58:56 +03:00
%{?filter_provides_in: %filter_provides_in %{python3_sitearch} /.*\.so}
2013-11-27 15:57:16 +04:00
%{?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).
2017-08-09 18:19:00 +03:00
%package -n python3-libvirt
2014-07-29 18:24:48 +04:00
Summary : The libvirt virtualization API python3 binding
Url : http://libvirt.org
License : LGPLv2+
2017-08-09 18:19:00 +03:00
%{?python_provide:%python_provide python3-libvirt}
Provides : libvirt-python3 = %{version} -%{release}
2017-08-10 12:39:06 +03:00
Obsoletes : libvirt-python3 <= 3.6.0-1%{?dist}
2014-07-29 18:24:48 +04:00
2017-08-09 18:19:00 +03:00
%description -n python3-libvirt
2017-08-10 12:56:14 +03:00
The python3-libvirt package contains a module that permits applications
2019-12-04 13:27:36 +03:00
written in the Python 3.x programming language to use the interface
2013-12-11 20:31:03 +04:00
supplied by the libvirt library to use the virtualization capabilities
of recent versions of Linux (and other OSes).
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
2016-04-20 21:47:48 +03:00
# Unset execute bit for example scripts; it can introduce spurious
2019-12-04 13:27:36 +03:00
# RPM dependencies, like /usr/bin/python3
2016-04-20 21:47:48 +03:00
# for the -python3 package
find examples -type f -exec chmod 0644 \{\} \;
2013-11-12 22:21:57 +04:00
%build
2018-01-11 19:32:40 +03:00
%if ! %{supported_platform}
echo " T h i s R P M r e q u i r e s e i t h e r F e d o r a > = %{min_fedora} o r R H E L > = %{min_rhel} "
exit 1
%endif
2019-04-03 20:10:06 +03:00
%py3_build
2013-11-12 22:21:57 +04:00
%install
2019-04-03 20:10:06 +03:00
%py3_install
2013-11-12 22:21:57 +04:00
2014-04-02 18:33:53 +04:00
%check
2023-06-20 13:21:00 +03:00
%pytest
2014-04-02 18:33:53 +04:00
2017-08-09 18:19:00 +03:00
%files -n python3-libvirt
2023-06-06 11:26:13 +03:00
%doc ChangeLog AUTHORS README COPYING examples/
2018-01-12 19:01:28 +03:00
%{python3_sitearch} /libvirt.py*
%{python3_sitearch} /libvirtaio.py*
%{python3_sitearch} /libvirt_qemu.py*
%{python3_sitearch} /libvirt_lxc.py*
%{python3_sitearch} /__pycache__/libvirt.cpython-*.py*
%{python3_sitearch} /__pycache__/libvirt_qemu.cpython-*.py*
%{python3_sitearch} /__pycache__/libvirt_lxc.cpython-*.py*
%{python3_sitearch} /__pycache__/libvirtaio.cpython-*.py*
%{python3_sitearch} /libvirtmod*
%{python3_sitearch} /*egg-info
2013-11-27 15:57:16 +04:00
%changelog