5457fb4
# -*- rpm-spec -*-
5457fb4
5457fb4
# This spec file assumes you are building on a Fedora or RHEL version
5457fb4
# that's still supported by the vendor. It may work on other distros
5457fb4
# or versions, but no effort will be made to ensure that going forward
5457fb4
%define min_rhel 6
5457fb4
%define min_fedora 25
5457fb4
5457fb4
%if (0%{?fedora} && 0%{?fedora} >= %{min_fedora}) || (0%{?rhel} && 0%{?rhel} >= %{min_rhel})
5457fb4
    %define supported_platform 1
5457fb4
%else
5457fb4
    %define supported_platform 0
5457fb4
%endif
5457fb4
5457fb4
%define _with_python2 1
0daaf6d
%if 0%{?fedora} > 29 || 0%{?rhel} > 7
0daaf6d
%define _with_python2 0
0daaf6d
%endif
0daaf6d
5457fb4
%define _with_python3 0
5457fb4
%if 0%{?fedora} || 0%{?rhel} > 7
5457fb4
%define _with_python3 1
5457fb4
%endif
08a2e08
5457fb4
# Whether py2 packages are assumed to have python2- name prefix
5457fb4
%define py2_versioned_deps 0
5457fb4
%if 0%{?fedora} || 0%{?rhel} > 7
5457fb4
%define py2_versioned_deps 1
d7284d0
%endif
d7284d0
5457fb4
%{!?with_python2: %define with_python2 %{_with_python2}}
5457fb4
%{!?with_python3: %define with_python3 %{_with_python3}}
5457fb4
756adb4
Summary: The libvirt virtualization API python2 binding
08a2e08
Name: libvirt-python
774a1c7
Version: 4.3.0
bc79ee1
Release: 1%{?dist}%{?extra_release}
08a2e08
Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
08a2e08
Url: http://libvirt.org
08a2e08
License: LGPLv2+
08a2e08
Group: Development/Libraries
5457fb4
BuildRequires: libvirt-devel == %{version}
5457fb4
%if %{with_python2}
5457fb4
%if %{py2_versioned_deps}
5457fb4
BuildRequires: python2-devel
5457fb4
BuildRequires: python2-nose
5457fb4
BuildRequires: python2-lxml
5457fb4
%else
08a2e08
BuildRequires: python-devel
ee59e45
BuildRequires: python-nose
ee59e45
BuildRequires: python-lxml
5457fb4
%endif
5457fb4
%endif
d7284d0
%if %{with_python3}
756adb4
BuildRequires: python3-devel
ee59e45
BuildRequires: python3-nose
ee59e45
BuildRequires: python3-lxml
d7284d0
%endif
756adb4
08a2e08
# Don't want provides for python shared objects
5457fb4
%if %{with_python2}
08a2e08
%{?filter_provides_in: %filter_provides_in %{python_sitearch}/.*\.so}
5457fb4
%endif
5457fb4
%if %{with_python3}
5457fb4
%{?filter_provides_in: %filter_provides_in %{python3_sitearch}/.*\.so}
5457fb4
%endif
08a2e08
%{?filter_setup}
08a2e08
08a2e08
%description
08a2e08
The libvirt-python package contains a module that permits applications
08a2e08
written in the Python programming language to use the interface
08a2e08
supplied by the libvirt library to use the virtualization capabilities
08a2e08
of recent versions of Linux (and other OSes).
08a2e08
5457fb4
%if %{with_python2}
d7284d0
%package -n python2-libvirt
d7284d0
Summary: The libvirt virtualization API python2 binding
d7284d0
Url: http://libvirt.org
d7284d0
License: LGPLv2+
d7284d0
Group: Development/Libraries
d7284d0
%{?python_provide:%python_provide python2-libvirt}
d7284d0
Provides: libvirt-python = %{version}-%{release}
d7284d0
Obsoletes: libvirt-python <= 3.6.0-1%{?dist}
d7284d0
d7284d0
%description -n python2-libvirt
d7284d0
The python2-libvirt package contains a module that permits applications
d7284d0
written in the Python programming language to use the interface
d7284d0
supplied by the libvirt library to use the virtualization capabilities
d7284d0
of recent versions of Linux (and other OSes).
5457fb4
%endif
d7284d0
d7284d0
%if %{with_python3}
d7284d0
%package -n python3-libvirt
d4cdac2
Summary: The libvirt virtualization API python3 binding
d4cdac2
Url: http://libvirt.org
d4cdac2
License: LGPLv2+
d4cdac2
Group: Development/Libraries
d7284d0
%{?python_provide:%python_provide python3-libvirt}
d7284d0
Provides: libvirt-python3 = %{version}-%{release}
d7284d0
Obsoletes: libvirt-python3 <= 3.6.0-1%{?dist}
d4cdac2
d7284d0
%description -n python3-libvirt
d7284d0
The python3-libvirt package contains a module that permits applications
756adb4
written in the Python programming language to use the interface
756adb4
supplied by the libvirt library to use the virtualization capabilities
756adb4
of recent versions of Linux (and other OSes).
d7284d0
%endif
756adb4
08a2e08
%prep
08a2e08
%setup -q
08a2e08
fead210
# Unset execute bit for example scripts; it can introduce spurious
fead210
# RPM dependencies, like /usr/bin/python which can pull in python2
fead210
# for the -python3 package
78763e0
find examples -type f -exec chmod 0644 \{\} \;
78763e0
08a2e08
%build
5457fb4
%if ! %{supported_platform}
5457fb4
echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
5457fb4
exit 1
5457fb4
%endif
5457fb4
5457fb4
%if %{with_python2}
08a2e08
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
5457fb4
%endif
d7284d0
%if %{with_python3}
756adb4
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
d7284d0
%endif
08a2e08
08a2e08
%install
5457fb4
%if %{with_python2}
08a2e08
%{__python} setup.py install --skip-build --root=%{buildroot}
5457fb4
%endif
d7284d0
%if %{with_python3}
756adb4
%{__python3} setup.py install --skip-build --root=%{buildroot}
d7284d0
%endif
08a2e08
ee59e45
%check
5457fb4
%if %{with_python2}
ee59e45
%{__python} setup.py test
5457fb4
%endif
d7284d0
%if %{with_python3}
ee59e45
%{__python3} setup.py test
d7284d0
%endif
ee59e45
5457fb4
%if %{with_python2}
d7284d0
%files -n python2-libvirt
08a2e08
%defattr(-,root,root)
08a2e08
%doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
5457fb4
%{python_sitearch}/libvirt.py*
5457fb4
%{python_sitearch}/libvirt_qemu.py*
5457fb4
%{python_sitearch}/libvirt_lxc.py*
5457fb4
%{python_sitearch}/libvirtmod*
5457fb4
%{python_sitearch}/*egg-info
5457fb4
%endif
756adb4
d7284d0
%if %{with_python3}
d7284d0
%files -n python3-libvirt
756adb4
%defattr(-,root,root)
756adb4
%doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
5457fb4
%{python3_sitearch}/libvirt.py*
5457fb4
%{python3_sitearch}/libvirtaio.py*
5457fb4
%{python3_sitearch}/libvirt_qemu.py*
5457fb4
%{python3_sitearch}/libvirt_lxc.py*
5457fb4
%{python3_sitearch}/__pycache__/libvirt.cpython-*.py*
5457fb4
%{python3_sitearch}/__pycache__/libvirt_qemu.cpython-*.py*
5457fb4
%{python3_sitearch}/__pycache__/libvirt_lxc.cpython-*.py*
5457fb4
%{python3_sitearch}/__pycache__/libvirtaio.cpython-*.py*
5457fb4
%{python3_sitearch}/libvirtmod*
5457fb4
%{python3_sitearch}/*egg-info
d7284d0
%endif
08a2e08
08a2e08
%changelog
774a1c7
* Thu May  3 2018 Daniel P. Berrangé <berrange@redhat.com> - 4.3.0-1
774a1c7
- Update to 4.3.0 release
774a1c7
0daaf6d
* Tue Apr  3 2018 Daniel P. Berrangé <berrange@redhat.com> - 4.2.0-1
0daaf6d
- Update to 4.2.0 release
0daaf6d
- Set python2 to be disabled from Fedora 30 onwards
0daaf6d
bc79ee1
* Mon Mar  5 2018 Daniel P. Berrange <berrange@redhat.com> - 4.1.0-1
bc79ee1
- Update to 4.1.0 release
bc79ee1
2aeb539
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-2
2aeb539
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2aeb539
5457fb4
* Fri Jan 19 2018 Daniel P. Berrange <berrange@redhat.com> - 4.0.0-1
5457fb4
- Update to 4.0.0 release
5457fb4
1630d03
* Tue Dec  5 2017 Daniel P. Berrange <berrange@redhat.com> - 3.10.0-1
1630d03
- Update to 3.10.0 release
1630d03
ace03dd
* Fri Nov  3 2017 Daniel P. Berrange <berrange@redhat.com> - 3.9.0-1
ace03dd
- Update to 3.9.0 release
ace03dd
1ce1c28
* Wed Oct  4 2017 Daniel P. Berrange <berrange@redhat.com> - 3.8.0-1
1ce1c28
- Update to 3.8.0 release
1ce1c28
b34372a
* Mon Sep  4 2017 Daniel P. Berrange <berrange@redhat.com> - 3.7.0-1
b34372a
- Update to 3.7.0 release
b34372a
d7284d0
* Fri Aug 11 2017 Daniel P. Berrange <berrange@redhat.com> - 3.6.0-2
d7284d0
- Rename sub-RPMs to python2-libvirt & python3-libvirt
d7284d0
- Re-add py3 conditionals for benefit of RHEL/CentOS builds
d7284d0
9ffe210
* Thu Aug 10 2017 Daniel P. Berrange <berrange@redhat.com> - 3.6.0-1
9ffe210
- Update to 3.6.0 release
9ffe210
- Always build py3 package
9ffe210
3ba125f
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.0-4
3ba125f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
3ba125f
c4b9b35
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.0-3
c4b9b35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c4b9b35
Igor Gnatenko 881a1b8
* Fri Jul 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 3.5.0-2
Igor Gnatenko 881a1b8
- Rebuild due to bug in RPM (RHBZ #1468476)
Igor Gnatenko 881a1b8
70973a2
* Thu Jul  6 2017 Daniel P. Berrange <berrange@redhat.com> - 3.5.0-1
70973a2
- Update to 3.5.0 release
70973a2
e5750c5
* Mon Jun  5 2017 Daniel P. Berrange <berrange@redhat.com> - 3.4.0-1
e5750c5
- Update to 3.4.0 release
e5750c5
2ffaf64
* Mon May  8 2017 Daniel P. Berrange <berrange@redhat.com> - 3.3.0-1
2ffaf64
- Update to 3.3.0 release
2ffaf64
0212090
* Mon Apr  3 2017 Daniel P. Berrange <berrange@redhat.com> - 3.2.0-1
0212090
- Update to 3.2.0 release
0212090
1de747f
* Fri Mar  3 2017 Daniel P. Berrange <berrange@redhat.com> - 3.1.0-1
1de747f
- Update to 3.1.0 release
1de747f
880d82f
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-2
880d82f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
880d82f
55a5585
* Thu Jan 19 2017 Daniel P. Berrange <berrange@redhat.com> - 3.0.0-1
55a5585
- Update to 3.0.0 release