%global srcname f5-icontrol-rest
%global sum F5 BIG-IP iControl REST API client
%if 0%{?fedora}
%global with_python3 1
%endif
Name: python-%{srcname}
Version: 1.3.6
Release: 3%{?dist}
Summary: %{sum}
License: ASL 2.0
URL: https://pypi.python.org/pypi/%{srcname}
Source0: https://github.com/F5Networks/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
%if 0%{?el6}%{?el7}
BuildRequires: python-setuptools
BuildRequires: python-requests >= 2.5.0
BuildRequires: python-urllib3
%else
BuildRequires: python2-setuptools
BuildRequires: python2-requests >= 2.5.0
BuildRequires: python2-urllib3
%endif
# doc
BuildRequires: python2-sphinx
%if 0%{?el6}%{?el7}
BuildRequires: python-sphinx_rtd_theme
%endif
# tests
BuildRequires: python2-pytest
%{!?el6:BuildRequires: python2-pytest-cov}
# Not packaged yet...
#BuildRequires: python2-pytest-symbols
%if 0%{?el6}%{?el7}
# Missing on EL6/EL7
#BuildRequires: python2-coveralls
BuildRequires: python-flake8
%{?el6:BuildRequires: python-mccabe}
%{?el7:BuildRequires: python2-mccabe}
BuildRequires: python2-mock
BuildRequires: python-pep8
BuildRequires: pyflakes
# Missing on EL6/EL7
#BuildRequires: python-requests-mock
BuildRequires: python-tox
%else
BuildRequires: python2-coveralls
BuildRequires: python2-flake8
BuildRequires: python2-mccabe
BuildRequires: python2-mock
BuildRequires: python2-pep8
BuildRequires: python2-pyflakes
BuildRequires: python2-requests-mock
BuildRequires: python2-tox
%endif
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-requests >= 2.5.0
BuildRequires: python3-urllib3
# doc
BuildRequires: python3-sphinx
# tests
BuildRequires: python3-coveralls
BuildRequires: python3-flake8
BuildRequires: python3-mccabe
BuildRequires: python3-mock
BuildRequires: python3-pep8
BuildRequires: python3-pyflakes
BuildRequires: python3-pytest
BuildRequires: python3-pytest-cov
# Not packaged yet...
#BuildRequires: python3-pytest-symbols
BuildRequires: python3-requests-mock
BuildRequires: python3-tox
%endif
%description
Generic python library used by the F5 SDK and other F5 projects to communicate
with BIG-IP® via the REST API.
%package -n python2-%{srcname}
Summary: %{sum}
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
Generic python library used by the F5 SDK and other F5 projects to communicate
with BIG-IP® via the REST API.
%if 0%{?with_python3}
%package -n python3-%{srcname}
Summary: %{sum}
%{?python_provide:%python_provide python3-%{srcname}}
%description -n python3-%{srcname}
Generic python library used by the F5 SDK and other F5 projects to communicate
with BIG-IP® via the REST API.
%endif
%prep
%autosetup -n %{srcname}-python-%{version}
# Remove functional tests, they need a real BIG-IP
rm -rf icontrol/test/functional
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%{__python3} setup.py build_sphinx
rm build/sphinx/html/.buildinfo
%endif
%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif
%check
%{__python2} setup.py test
%if 0%{?with_python3}
%{__python3} setup.py test
%endif
%files -n python2-%{srcname}
%license LICENSE
%doc CONTRIBUTING.md README.rst SUPPORT.md
%if ! 0%{?el6}%{?el7}
%doc build/sphinx/html/
%endif
%{python2_sitelib}/*
%if 0%{?with_python3}
%files -n python3-%{srcname}
%license LICENSE
%doc CONTRIBUTING.md README.rst SUPPORT.md
%doc build/sphinx/html/
%{python3_sitelib}/*
%endif
%changelog
* Fri Mar 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.3.6-3
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Wed Feb 21 2018 Xavier Bachelot <xavier@bachelot.org> - 1.3.6-2
- Fix doc.
- Tidy up BR:s for EL6 and EL7.
* Wed Feb 21 2018 Xavier Bachelot <xavier@bachelot.org> - 1.3.6-1
- Update to 1.3.6.
* Mon Dec 18 2017 Xavier Bachelot <xavier@bachelot.org> - 1.3.4-2
- Use tarball from github rather than pypy.
- Fix typo in BuildRequires.
- Add BR: for building docs and running tests.
* Wed Dec 13 2017 Xavier Bachelot <xavier@bachelot.org> - 1.3.4-1
- Initial package.