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
9 %if (0%{?fedora} && 0%{?fedora} >= %{min_fedora}) || (0%{?rhel} && 0%{?rhel} >= %{min_rhel})
10 %define supported_platform
1
12 %define supported_platform
0
15 %define _with_python2
1
16 %if 0%{?fedora} || 0%{?rhel} > 7
17 %define _with_python2
0
20 %define _with_python3
0
21 %if 0%{?fedora} || 0%{?rhel} > 7
22 %define _with_python3
1
25 # Whether py2 packages are assumed to have python2- name prefix
26 %define py2_versioned_deps
0
27 %if 0%{?fedora} || 0%{?rhel} > 7
28 %define py2_versioned_deps
1
31 %{!?with_python2: %define with_python2 %{_with_python2}}
32 %{!?with_python3: %define with_python3 %{_with_python3}}
34 Summary: The libvirt virtualization API python2 binding
38 Source0: http
://libvirt.org
/sources
/python
/%{name}-%{version}.tar.gz
39 Url
: http
://libvirt.org
41 BuildRequires
: libvirt
-devel
== %{version}
43 %if %{py2_versioned_deps}
44 BuildRequires
: python2
-devel
45 BuildRequires
: python2
-nose
46 BuildRequires
: python2
-lxml
48 BuildRequires
: python
-devel
49 BuildRequires
: python
-nose
50 BuildRequires
: python
-lxml
54 BuildRequires
: python3
-devel
55 BuildRequires
: python3
-nose
56 BuildRequires
: python3
-lxml
60 # Don't want provides for python shared objects
62 %{?filter_provides_in: %filter_provides_in %{python2_sitearch}/.*\.so}
65 %{?filter_provides_in: %filter_provides_in %{python3_sitearch}/.*\.so}
70 The libvirt
-python package contains a module that permits applications
71 written
in the Python programming language to use the interface
72 supplied by the libvirt library to use the virtualization capabilities
73 of recent versions of Linux
(and other OSes
).
76 %package -n python2
-libvirt
77 Summary: The libvirt virtualization API python2 binding
78 Url
: http
://libvirt.org
80 %{?python_provide:%python_provide python2-libvirt}
81 Provides: libvirt
-python
= %{version}-%{release}
82 Obsoletes
: libvirt
-python
<= 3.6.0-1%{?dist}
84 %description -n python2
-libvirt
85 The python2
-libvirt package contains a module that permits applications
86 written
in the Python programming language to use the interface
87 supplied by the libvirt library to use the virtualization capabilities
88 of recent versions of Linux
(and other OSes
).
92 %package -n python3
-libvirt
93 Summary: The libvirt virtualization API python3 binding
94 Url
: http
://libvirt.org
96 %{?python_provide:%python_provide python3-libvirt}
97 Provides: libvirt
-python3
= %{version}-%{release}
98 Obsoletes
: libvirt
-python3
<= 3.6.0-1%{?dist}
100 %description -n python3
-libvirt
101 The python3
-libvirt package contains a module that permits applications
102 written
in the Python programming language to use the interface
103 supplied by the libvirt library to use the virtualization capabilities
104 of recent versions of Linux
(and other OSes
).
110 # Unset execute bit for example scripts; it can introduce spurious
111 # RPM dependencies, like /usr/bin/python which can pull in python2
112 # for the -python3 package
113 find examples
-type f
-exec chmod
0644 \
{\
} \
;
116 %if ! %{supported_platform}
117 echo "This RPM requires either Fedora
>= %{min_fedora} or RHEL >= %{min_rhel}"
122 %if 0%{?fedora} || 0%{?rhel} >= 8
125 CFLAGS
="$RPM_OPT_FLAGS"
%{__python2} setup.py build
129 %if 0%{?fedora} || 0%{?rhel} >= 8
132 CFLAGS
="$RPM_OPT_FLAGS"
%{__python3} setup.py build
138 %if 0%{?fedora} || 0%{?rhel} >= 8
141 %{__python2} setup.py install --skip-build --root=%{buildroot}
145 %if 0%{?fedora} || 0%{?rhel} >= 8
148 %{__python3} setup.py install --skip-build --root=%{buildroot}
154 %{__python2} setup.py
test
157 %{__python3} setup.py
test
161 %files -n python2
-libvirt
162 %doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples
/
163 %{python2_sitearch}/libvirt.py
*
164 %{python2_sitearch}/libvirt_qemu.py
*
165 %{python2_sitearch}/libvirt_lxc.py
*
166 %{python2_sitearch}/libvirtmod
*
167 %{python2_sitearch}/*egg
-info
171 %files -n python3
-libvirt
172 %doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples
/
173 %{python3_sitearch}/libvirt.py
*
174 %{python3_sitearch}/libvirtaio.py
*
175 %{python3_sitearch}/libvirt_qemu.py
*
176 %{python3_sitearch}/libvirt_lxc.py
*
177 %{python3_sitearch}/__pycache__
/libvirt.cpython
-*.py
*
178 %{python3_sitearch}/__pycache__
/libvirt_qemu.cpython
-*.py
*
179 %{python3_sitearch}/__pycache__
/libvirt_lxc.cpython
-*.py
*
180 %{python3_sitearch}/__pycache__
/libvirtaio.cpython
-*.py
*
181 %{python3_sitearch}/libvirtmod
*
182 %{python3_sitearch}/*egg
-info