61db72577a8c60caa6f5ebeeb72b5ec8504c0333
[libvirt-python.git] / libvirt-python.spec
1 # -*- rpm-spec -*-
2
3 %define mainstream_version 1.2.3
4 %define module_version_varname mainstream_version
5 %define taglevel 2
6
7 # Disable python 3 bindings
8 %define with_python3 0
9
10 Summary: The libvirt virtualization API python2 binding
11 Name: libvirt-python
12 Version: %{mainstream_version}
13 Release: %{taglevel}
14 Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
15 Url: http://libvirt.org
16 License: LGPLv2+
17 Group: Development/Libraries
18 BuildRequires: libvirt-devel = %{version}-%{release}
19 BuildRequires: python-devel
20 %if %{with_python3}
21 BuildRequires: python3-devel
22 %endif
23
24 %if %{with_python3}
25 %package -n libvirt-python3
26 Summary: The libvirt virtualization API python3 binding
27 Url: http://libvirt.org
28 License: LGPLv2+
29 Group: Development/Libraries
30 %endif
31
32 # Don't want provides for python shared objects
33 %{?filter_provides_in: %filter_provides_in %{python_sitearch}/.*\.so}
34 %{?filter_setup}
35
36 %description
37 The libvirt-python package contains a module that permits applications
38 written in the Python programming language to use the interface
39 supplied by the libvirt library to use the virtualization capabilities
40 of recent versions of Linux (and other OSes).
41
42 %if %{with_python3}
43 %description -n libvirt-python3
44 The libvirt-python package contains a module that permits applications
45 written in the Python programming language to use the interface
46 supplied by the libvirt library to use the virtualization capabilities
47 of recent versions of Linux (and other OSes).
48 %endif
49
50 %prep
51 %setup -q
52
53 %build
54 CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
55 %if %{with_python3}
56 CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
57 %endif
58
59 %install
60 %{__python} setup.py install --skip-build --root=%{buildroot}
61 %if %{with_python3}
62 %{__python3} setup.py install --skip-build --root=%{buildroot}
63 %endif
64 rm -f %{buildroot}%{_libdir}/python*/site-packages/*egg-info
65
66 %files
67 %defattr(-,root,root)
68 %doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
69 %{_libdir}/python2*/site-packages/libvirt.py*
70 %{_libdir}/python2*/site-packages/libvirt_qemu.py*
71 %{_libdir}/python2*/site-packages/libvirt_lxc.py*
72 %{_libdir}/python2*/site-packages/libvirtmod*
73
74 %if %{with_python3}
75 %files -n libvirt-python3
76 %defattr(-,root,root)
77 %doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
78 %{_libdir}/python3*/site-packages/libvirt.py*
79 %{_libdir}/python3*/site-packages/libvirt_qemu.py*
80 %{_libdir}/python3*/site-packages/libvirt_lxc.py*
81 %{_libdir}/python3*/site-packages/__pycache__/libvirt.cpython-*.py*
82 %{_libdir}/python3*/site-packages/__pycache__/libvirt_qemu.cpython-*.py*
83 %{_libdir}/python3*/site-packages/__pycache__/libvirt_lxc.cpython-*.py*
84 %{_libdir}/python3*/site-packages/libvirtmod*
85 %endif
86
87 %changelog
88 * Mon Apr 28 2014 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - libvirt-python-1.2.3-2
89 - 1.2.3
90
91 * Fri Mar 21 2014 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - libvirt-python-1.2.1-1
92 - builds fine on f{18,20}
93
94