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