File python-otcextensions.spec of Package python-otcextensions
%global pypi_name otcextensions
%bcond_with python3
%bcond_with test
%bcond_with docs
%global common_desc \
A collection of extensions to OpenStackSDK and CLI for OpenTelecomCloud.
%global common_desc_tests \
A collection of extensions to OpenStackSDK and CLI for OpenTelecomCloud. \
- test files
%global common_summary_tests \
An OpenStack SDK and CLI extensions for OpenTelekomCloud - test files
Name: python-%{pypi_name}
Version: 0.28.1
Release: 1%{?dist}
Summary: An SDK and CLI extensions to OpenStackSDK and OpenStackClient for OpenTelekomCloud
License: Apache-2.0
URL: https://github.com/OpenTelekomCloud/python-otcextensions
Source0: https://pypi.io/packages/source/o/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%if %{with python3}
%package -n python%{python3_pkgversion}-%{pypi_name}
Summary: %{summary}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-pbr >= 2.0.0
BuildConflicts: python%{python3_pkgversion}-pbr = 2.1.0
BuildRequires: python%{python3_pkgversion}-openstacksdk >= 0.36.0
%if %{with test}
BuildConflicts: python%{python3_pkgversion}-coverage = 4.4
BuildRequires: python%{python3_pkgversion}-appdirs >= 1.3.0
BuildRequires: python%{python3_pkgversion}-coverage >= 4.0
BuildRequires: python%{python3_pkgversion}-extras >= 1.0.0
BuildRequires: python%{python3_pkgversion}-fixtures >= 3.0.0
BuildRequires: python%{python3_pkgversion}-jsonschema < 3.0.0
BuildRequires: python%{python3_pkgversion}-jsonschema >= 2.6.0
BuildRequires: python%{python3_pkgversion}-mock >= 2.0.0
BuildRequires: python%{python3_pkgversion}-oslotest >= 3.2.0
BuildRequires: python%{python3_pkgversion}-python-subunit >= 1.0.0
BuildRequires: python%{python3_pkgversion}-requests-mock >= 1.2.0
BuildRequires: python%{python3_pkgversion}-stestr >= 1.0.0
BuildRequires: python%{python3_pkgversion}-testrepository >= 0.0.18
BuildRequires: python%{python3_pkgversion}-testscenarios >= 0.4
BuildRequires: python%{python3_pkgversion}-testtools >= 2.2.0
%endif # with test
Conflicts: python%{python3_pkgversion}-pbr = 2.1.0
Requires: python%{python3_pkgversion}-openstacksdk >= 0.36.0
Obsoletes: python2-otcextensions <= 0.7.1-1
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
%description -n python%{python3_pkgversion}-%{pypi_name}
%{common_desc}
%package -n python%{python3_pkgversion}-%{pypi_name}-tests
Summary: An OpenStack SDK and CLI extensions for OpenTelekomCloud - test files
Requires: python%{python3_pkgversion}-%{pypi_name} = %{version}-%{release}
%description -n python%{python3_pkgversion}-%{pypi_name}-tests
%{common_desc_tests}
%endif # with python3
%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
%if %{with python3}
%py3_build
%endif # python3
%if %{with docs}
# generate html docs
PYTHONPATH=${PWD} sphinx-build-3 doc/source html
%endif # with docs
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
%install
# Must do the default python version install last because
# the scripts in /usr/bin are overwritten with every setup.py install.
%if %{with python3}
%py3_install
%endif # python3
%check
%if %{with test}
%if %{with python3}
%{__python3} setup.py test
%endif # with python3
%endif # with test
%if %{with python3}
%files -n python%{python3_pkgversion}-%{pypi_name}
%doc README.rst
%license LICENSE
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-*.egg-info
%exclude %{python3_sitelib}/%{pypi_name}/tests
%files -n python%{python3_pkgversion}-%{pypi_name}-tests
%{python3_sitelib}/%{pypi_name}/tests
%endif # with python3
%changelog