Debian Codegraph @

libvirt-python.spec

raw
1 # -*- rpm-spec -*-
2
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
8
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
14
15 %define dist_name libvirt_python
16
17 Summary: The libvirt virtualization API python3 binding
18 Name: libvirt-python
19 Version: 12.6.0
20 Release: 1%{?dist}
21 Source0: https://libvirt.org/sources/python/%{dist_name}-%{version}.tar.gz
22 Url: https://libvirt.org
23 License: LGPL-2.1-or-later
24 BuildRequires: libvirt-devel == %{version}
25 BuildRequires: python3-devel
26 BuildRequires: python3-pytest
27 BuildRequires: python3-lxml
28 BuildRequires: python3-setuptools
29 BuildRequires: gcc
30
31 # Don't want provides for python shared objects
32 %{?filter_provides_in: %filter_provides_in %{python3_sitearch}/.*\.so}
33 %{?filter_setup}
34
35 %description
36 The libvirt-python package contains a module that permits applications
37 written in the Python programming language to use the interface
38 supplied by the libvirt library to use the virtualization capabilities
39 of recent versions of Linux (and other OSes).
40
41 %package -n python3-libvirt
42 Summary: The libvirt virtualization API python3 binding
43 Url: http://libvirt.org
44 %{?python_provide:%python_provide python3-libvirt}
45 Provides: libvirt-python3 = %{version}-%{release}
46 Obsoletes: libvirt-python3 <= 3.6.0-1%{?dist}
47
48 %description -n python3-libvirt
49 The python3-libvirt package contains a module that permits applications
50 written in the Python 3.x programming language to use the interface
51 supplied by the libvirt library to use the virtualization capabilities
52 of recent versions of Linux (and other OSes).
53
54 %prep
55 %setup -q -n %{dist_name}-%{version}
56
57 # Unset execute bit for example scripts; it can introduce spurious
58 # RPM dependencies, like /usr/bin/python3
59 # for the -python3 package
60 find examples -type f -exec chmod 0644 \{\} \;
61
62 %build
63 %if ! %{supported_platform}
64 echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
65 exit 1
66 %endif
67
68 %py3_build
69
70 %install
71 %py3_install
72
73 %check
74 %pytest
75
76 %files -n python3-libvirt
77 %doc ChangeLog AUTHORS README COPYING examples/
78 %{python3_sitearch}/libvirt.py*
79 %{python3_sitearch}/libvirtaio.py*
80 %{python3_sitearch}/libvirt_qemu.py*
81 %{python3_sitearch}/libvirt_lxc.py*
82 %{python3_sitearch}/__pycache__/libvirt.cpython-*.py*
83 %{python3_sitearch}/__pycache__/libvirt_qemu.cpython-*.py*
84 %{python3_sitearch}/__pycache__/libvirt_lxc.cpython-*.py*
85 %{python3_sitearch}/__pycache__/libvirtaio.cpython-*.py*
86 %{python3_sitearch}/libvirtmod*
87 %{python3_sitearch}/*egg-info
88
89 %changelog