]>
Commit | Line | Data |
---|---|---|
12295758 | 1 | # NOTE: for versions >= 6 (for python 3.5+) see python3-libvirt.spec |
e756e9a6 SS |
2 | # |
3 | # Conditional build: | |
4 | %bcond_without lxc # LXC support | |
5 | %bcond_without qemu # Qemu support | |
756c07da | 6 | %bcond_without python2 # CPython 2.x module |
12295758 | 7 | %bcond_with python3 # CPython 3.x module (built from python3-libvirt.spec) |
e756e9a6 SS |
8 | |
9 | # qemu available only on x86 and ppc | |
a60469c3 | 10 | %ifnarch %{ix86} %{x8664} x32 ppc |
e756e9a6 SS |
11 | %undefine with_qemu |
12 | %endif | |
e756e9a6 SS |
13 | |
14 | %define origname libvirt-python | |
f5417bcb JB |
15 | Summary: Python 2.x bindings to interact with virtualization capabilities |
16 | Summary(pl.UTF-8): Wiązania Pythona 2.x do współpracy z funkcjami wirtualizacji | |
e756e9a6 | 17 | Name: python-libvirt |
756c07da JB |
18 | # keep 5.x here for python2 support |
19 | Version: 5.10.0 | |
20 | Release: 1 | |
e756e9a6 SS |
21 | License: LGPL v2.1+ |
22 | Group: Development/Languages/Python | |
756c07da JB |
23 | Source0: https://libvirt.org/sources/python/%{origname}-%{version}.tar.gz |
24 | # Source0-md5: 045c8b45a1aed0725d874ce072027570 | |
25 | URL: https://libvirt.org/ | |
26 | BuildRequires: libvirt-devel >= 5.10.0 | |
f8d78362 | 27 | BuildRequires: pkgconfig |
756c07da JB |
28 | %if %{with python2} |
29 | BuildRequires: python >= 1:2.5 | |
30 | BuildRequires: python-devel >= 1:2.5 | |
31 | %endif | |
f5417bcb | 32 | %if %{with python3} |
756c07da JB |
33 | BuildRequires: python3 >= 1:3.2 |
34 | BuildRequires: python3-devel >= 1:3.2 | |
f5417bcb | 35 | %endif |
e756e9a6 | 36 | BuildRequires: rpm-pythonprov |
756c07da | 37 | BuildRequires: rpmbuild(macros) >= 1.714 |
a0fc4e44 | 38 | BuildConflicts: python-PyXML < 0.8.4-13 |
756c07da | 39 | Requires: libvirt >= 5.10.0 |
e756e9a6 SS |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
41 | ||
42 | %description | |
43 | Libvirt is a C toolkit to interact with the virtualization | |
44 | capabilities of recent versions of Linux. | |
45 | ||
f5417bcb | 46 | This package contains the Python 2.x bindings for the libvirt library. |
e756e9a6 SS |
47 | |
48 | %description -l pl.UTF-8 | |
49 | Libvirt to zestaw narzędzi w C do współpracy z funkcjami wirtualizacji | |
50 | obecnych wersji Linuksa. | |
51 | ||
f5417bcb JB |
52 | Ten pakiet zawiera wiązania Pythona 2.x do biblioteki libvirt. |
53 | ||
54 | %package -n python3-libvirt | |
55 | Summary: Python 3.x bindings to interact with virtualization capabilities | |
56 | Summary(pl.UTF-8): Wiązania Pythona 3.x do współpracy z funkcjami wirtualizacji | |
57 | Group: Development/Languages/Python | |
756c07da | 58 | Requires: libvirt >= 5.10.0 |
f5417bcb JB |
59 | |
60 | %description -n python3-libvirt | |
61 | Libvirt is a C toolkit to interact with the virtualization | |
62 | capabilities of recent versions of Linux. | |
63 | ||
64 | This package contains the Python 3.x bindings for the libvirt library. | |
65 | ||
66 | %description -n python3-libvirt -l pl.UTF-8 | |
67 | Libvirt to zestaw narzędzi w C do współpracy z funkcjami wirtualizacji | |
68 | obecnych wersji Linuksa. | |
69 | ||
70 | Ten pakiet zawiera wiązania Pythona 3.x do biblioteki libvirt. | |
e756e9a6 SS |
71 | |
72 | %prep | |
73 | %setup -q -n %{origname}-%{version} | |
74 | ||
75 | %build | |
756c07da | 76 | %if %{with python2} |
a96a37c7 | 77 | %py_build |
756c07da | 78 | %endif |
f5417bcb JB |
79 | |
80 | %if %{with python3} | |
a96a37c7 | 81 | %py3_build |
f5417bcb | 82 | %endif |
e756e9a6 SS |
83 | |
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
e756e9a6 | 86 | |
756c07da | 87 | %if %{with python2} |
a96a37c7 | 88 | %py_install |
f5417bcb | 89 | |
e756e9a6 | 90 | %py_postclean |
756c07da | 91 | %endif |
e756e9a6 | 92 | |
f5417bcb | 93 | %if %{with python3} |
a96a37c7 | 94 | %py3_install |
f5417bcb JB |
95 | %endif |
96 | ||
e756e9a6 SS |
97 | %clean |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
756c07da | 100 | %if %{with python2} |
e756e9a6 SS |
101 | %files |
102 | %defattr(644,root,root,755) | |
756c07da | 103 | %doc AUTHORS ChangeLog NEWS README |
e756e9a6 SS |
104 | %attr(755,root,root) %{py_sitedir}/libvirtmod.so |
105 | %{py_sitedir}/libvirt.py[co] | |
106 | %if %{with lxc} | |
107 | %attr(755,root,root) %{py_sitedir}/libvirtmod_lxc.so | |
108 | %{py_sitedir}/libvirt_lxc.py[co] | |
109 | %endif | |
110 | %if %{with qemu} | |
111 | %attr(755,root,root) %{py_sitedir}/libvirtmod_qemu.so | |
112 | %{py_sitedir}/libvirt_qemu.py[co] | |
113 | %endif | |
f8d78362 | 114 | %{py_sitedir}/libvirt_python-%{version}-py*.egg-info |
756c07da | 115 | %endif |
f5417bcb JB |
116 | |
117 | %if %{with python3} | |
118 | %files -n python3-libvirt | |
119 | %defattr(644,root,root,755) | |
756c07da | 120 | %doc AUTHORS ChangeLog NEWS README |
f5417bcb JB |
121 | %attr(755,root,root) %{py3_sitedir}/libvirtmod.*.so |
122 | %{py3_sitedir}/libvirt.py | |
123 | %{py3_sitedir}/__pycache__/libvirt.*.py[co] | |
d086242b JP |
124 | %{py3_sitedir}/libvirtaio.py |
125 | %{py3_sitedir}/__pycache__/libvirtaio.*.py[co] | |
f5417bcb JB |
126 | %if %{with lxc} |
127 | %attr(755,root,root) %{py3_sitedir}/libvirtmod_lxc.*.so | |
128 | %{py3_sitedir}/libvirt_lxc.py | |
129 | %{py3_sitedir}/__pycache__/libvirt_lxc.*.py[co] | |
130 | %endif | |
131 | %if %{with qemu} | |
132 | %attr(755,root,root) %{py3_sitedir}/libvirtmod_qemu.*.so | |
133 | %{py3_sitedir}/libvirt_qemu.py | |
134 | %{py3_sitedir}/__pycache__/libvirt_qemu.*.py[co] | |
135 | %endif | |
136 | %{py3_sitedir}/libvirt_python-%{version}-py*.egg-info | |
137 | %endif |