Blame SPECS/libvirt-python.spec

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