ci: Drop CentOS 8 Stream and switch F38 to 40, Ubuntu 20.04 to 22.04
[libvirt-python.git] / libvirt-python.spec.in
blobe260eaf999c02d0708820fcedf115379dd7851d3
1 # -*- rpm-spec -*-
3 # This spec file assumes you are building on a Fedora or RHEL version
4 # that's still supported by the vendor. It may work on other distros
5 # or versions, but no effort will be made to ensure that going forward
6 %define min_rhel 8
7 %define min_fedora 33
9 %if (0%{?fedora} && 0%{?fedora} >= %{min_fedora}) || (0%{?rhel} && 0%{?rhel} >= %{min_rhel})
10 %define supported_platform 1
11 %else
12 %define supported_platform 0
13 %endif
15 Summary: The libvirt virtualization API python3 binding
16 Name: libvirt-python
17 Version: @VERSION@
18 Release: 1%{?dist}
19 Source0: https://libvirt.org/sources/python/%{name}-%{version}.tar.gz
20 Url: https://libvirt.org
21 License: LGPL-2.1-or-later
22 BuildRequires: libvirt-devel == %{version}
23 BuildRequires: python3-devel
24 BuildRequires: python3-pytest
25 BuildRequires: python3-lxml
26 BuildRequires: python3-setuptools
27 BuildRequires: gcc
29 # Don't want provides for python shared objects
30 %{?filter_provides_in: %filter_provides_in %{python3_sitearch}/.*\.so}
31 %{?filter_setup}
33 %description
34 The libvirt-python package contains a module that permits applications
35 written in the Python programming language to use the interface
36 supplied by the libvirt library to use the virtualization capabilities
37 of recent versions of Linux (and other OSes).
39 %package -n python3-libvirt
40 Summary: The libvirt virtualization API python3 binding
41 Url: http://libvirt.org
42 License: LGPLv2+
43 %{?python_provide:%python_provide python3-libvirt}
44 Provides: libvirt-python3 = %{version}-%{release}
45 Obsoletes: libvirt-python3 <= 3.6.0-1%{?dist}
47 %description -n python3-libvirt
48 The python3-libvirt package contains a module that permits applications
49 written in the Python 3.x programming language to use the interface
50 supplied by the libvirt library to use the virtualization capabilities
51 of recent versions of Linux (and other OSes).
53 %prep
54 %setup -q
56 # Unset execute bit for example scripts; it can introduce spurious
57 # RPM dependencies, like /usr/bin/python3
58 # for the -python3 package
59 find examples -type f -exec chmod 0644 \{\} \;
61 %build
62 %if ! %{supported_platform}
63 echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
64 exit 1
65 %endif
67 %py3_build
69 %install
70 %py3_install
72 %check
73 %pytest
75 %files -n python3-libvirt
76 %doc ChangeLog AUTHORS README COPYING examples/
77 %{python3_sitearch}/libvirt.py*
78 %{python3_sitearch}/libvirtaio.py*
79 %{python3_sitearch}/libvirt_qemu.py*
80 %{python3_sitearch}/libvirt_lxc.py*
81 %{python3_sitearch}/__pycache__/libvirt.cpython-*.py*
82 %{python3_sitearch}/__pycache__/libvirt_qemu.cpython-*.py*
83 %{python3_sitearch}/__pycache__/libvirt_lxc.cpython-*.py*
84 %{python3_sitearch}/__pycache__/libvirtaio.cpython-*.py*
85 %{python3_sitearch}/libvirtmod*
86 %{python3_sitearch}/*egg-info
88 %changelog