%if 0%{?rhel} == 7
# FIXME maybe drop python2 but still for compatibility reasons
%global with_python2 1
%endif
%if 0%{?rhel} >= 7
%global with_python3 1
%endif
%if 0%{?fedora}
%global with_python3 1
%global with_python3_tests 1
%endif
%global srcname pyvmomi
%global desc \
pyVmomi is the Python SDK for the vSphere API that allows you to manage\
ESX, ESXi, and vCenter.
Name: python-%{srcname}
Version: 6.7.1
Release: 6%{?dist}
Summary: vSphere Python SDK
License: ASL 2.0
URL: https://github.com/vmware/%{srcname}
Source0: %{url}/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz
BuildArch: noarch
%description
%desc
%if 0%{?with_python2}
%package -n python2-%{srcname}
Summary: vSphere Python SDK
BuildRequires: python2-devel
# FIXME add proper version suffixes of python subpackages
BuildRequires: python%{?!rhel:2}-testtools
BuildRequires: python%{?!rhel:2}-vcrpy
BuildRequires: python2-setuptools
BuildRequires: python2-requests
BuildRequires: python2-six
BuildRequires: python%{?!rhel:2}-fixtures
BuildRequires: python%{?!rhel:2}-tox
BuildRequires: python2-requests
BuildRequires: python2-six
%{?python_provide:%python_provide python2-%{srcname}}
Provides: python2-pyvim
%description -n python2-%{srcname}
%desc
This package is for Python version 2.
%endif
%if %{with python3}
%package -n python%{python3_pkgversion}-%{srcname}
Summary: vSphere SDK for Python%{python3_other_version}
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-devel
%if 0%{?with_python3_tests}
BuildRequires: python%{python3_pkgversion}-testtools >= 0.9.34
BuildRequires: python%{python3_pkgversion}-vcrpy
BuildRequires: python%{python3_pkgversion}-yarl
BuildRequires: python%{python3_pkgversion}-fixtures
BuildRequires: python%{python3_pkgversion}-tox
%endif
BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: python%{python3_pkgversion}-six
Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-six
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
Provides: python%{python3_pkgversion}-pyvim
%description -n python%{python3_pkgversion}-%{srcname}
%desc
This package is for Python3 version %{python3_version} only.
%if 0%{?python3_other_pkgversion}
%package -n python%{python3_other_pkgversion}-%{srcname}
Summary: vSphere SDK for Python%{python3_other_version}
BuildRequires: python%{python3_other_pkgversion}-setuptools
BuildRequires: python%{python3_other_pkgversion}-devel
%if 0%{?with_python3_tests}
BuildRequires: python%{python3_other_pkgversion}-testtools >= 0.9.34
BuildRequires: python%{python3_other_pkgversion}-vcrpy
BuildRequires: python%{python3_other_pkgversion}-yarl
BuildRequires: python%{python3_other_pkgversion}-fixtures
BuildRequires: python%{python3_other_pkgversion}-tox
%endif
BuildRequires: python%{python3_other_pkgversion}-requests
BuildRequires: python%{python3_other_pkgversion}-six
Requires: python%{python3_other_pkgversion}-requests
Requires: python%{python3_other_pkgversion}-six
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}}
Provides: python%{python3_other_pkgversion}-pyvim
%description -n python%{python3_other_pkgversion}-%{srcname}
%desc
This package is for Python3 version %{python3_other_version} only.
%endif
%endif
%prep
%autosetup -n %{srcname}-%{version}
%build
%{?with_python2: %py2_build}
%{?with_python3: %py3_build}
%{?python3_other_pkgversion: %py3_other_build}
%install
%{?with_python2: %py2_install}
%{?with_python3: %py3_install}
%{?python3_other_pkgversion: %py3_other_install}
%check
# FIXME python validator does not like any explicit version
# upstream issue#735
sed -i -r 's:(.*)==.*:\1:g' test-requirements.txt
%{?with_python2: %{__python2} setup.py test}
%if 0%{?with_python3_tests}
%{__python3} setup.py test
# FIXME requests module is currently not available for python36
%if 0
%{?python3_other_pkgversion: %{__python3_other} setup.py test}
%endif
%endif
%if 0%{?with_python2}
%files -n python2-%{srcname}
%license LICENSE.txt
%doc README.rst
%{python2_sitelib}/pyVmomi
%{python2_sitelib}/pyVim
%{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info
%endif
%if 0%{?with_python3}
%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE.txt
%doc README.rst
%{python3_sitelib}/pyVmomi
%{python3_sitelib}/pyVim
%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info
%endif
%if 0%{?python3_other_pkgversion}
%files -n python%{python3_other_pkgversion}-%{srcname}
%license LICENSE.txt
%doc README.rst
%{python3_other_sitelib}/pyVmomi
%{python3_other_sitelib}/pyVim
%{python3_other_sitelib}/%{srcname}-%{version}-py?.?.egg-info
%endif
%changelog
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 6.7.1-6
- Rebuilt for Python 3.8
* Thu Aug 01 2019 Raphael Groner <projects.rg@smart.ms> - 6.7.1-5
- drop brand
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.7.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Mar 08 2019 Troy Dawson <tdawson@redhat.com> - 6.7.1-3
- [epel7] Rebuilt to change main python from 3.4 to 3.6
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.7.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jan 18 2019 Raphael Groner <projects.rg@smart.ms> - 6.7.1-2
- fix dependencies
* Wed Oct 31 2018 Raphael Groner <projects.rg@smart.ms> - 6.7.1-1
- new version
- introduce dependency generator
- use github for release tarball, due to pypi provides zip only
- drop duplicate README.rst, tests are obsolete
- add python3 subpackages for epel7, readd python2 but epel7 only
* Thu Oct 11 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 6.5-10
- Python2 binary package has been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.5-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 6.5-8
- Rebuilt for Python 3.7
* Wed Mar 28 2018 Iryna Shcherbina <ishcherb@redhat.com> - 6.5-7
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 6.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sun Mar 05 2017 Fabio Alessandro Locati <fale@fedoraproject.org> - 6.5-4
- Fix build adding yarl build deps
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 6.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 6.5-2
- Rebuild for Python 3.6
* Tue Dec 13 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 6.5-1
- Update to 6.5
* Thu Sep 08 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 6.0.0.2016.6-1
- Update to version 6.0.0.2016.6
- Simplify the SPEC file
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.0.2014.1.1-6
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 5.5.0.2014.1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.0.2014.1.1-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.5.0.2014.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Sep 22 2014 Michael Rice <michael@michaelrice.org> - 5.5.0.2014.1.1-3
- Changed spec to work on EPEL
* Thu Sep 18 2014 Michael Rice <michael@michaelrice.org> - 5.5.0.2014.1.1-2
- Changes to spec from review suggestions
* Sun Aug 31 2014 Michael Rice <michael@michaelrice.org> - 5.5.0.2014.1.1-1
- Bugfix release from upstream.
* Fri Aug 22 2014 Michael Rice <michael@michaelrice.org> - 5.5.0.2014.1-2
- Changes to spec file based on bugzilla package review.
* Wed Aug 20 2014 Michael Rice <michael@michaelrice.org> - 5.5.0.2014.1-1
- Initial RPM build.