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