35f2bcb
# Macros for py2/py3 compatibility
35f2bcb
%if 0%{?fedora} || 0%{?rhel} > 7
35f2bcb
%global pyver %{python3_pkgversion}
35f2bcb
%else
35f2bcb
%global pyver 2
35f2bcb
%endif
35f2bcb
%global pyver_bin python%{pyver}
35f2bcb
%global pyver_sitelib %python%{pyver}_sitelib
35f2bcb
%global pyver_install %py%{pyver}_install
35f2bcb
%global pyver_build %py%{pyver}_build
35f2bcb
# End of macros for py2/py3 compatibility
7471d5c
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
7471d5c
0a09127
%global sname novaclient
35f2bcb
%global with_doc 1
0a09127
027794d
%global common_desc \
027794d
This is a client for the OpenStack Nova API. There's a Python API (the \
027794d
novaclient module), and a command-line script (nova). Each implements 100% of \
027794d
the OpenStack Nova API.
027794d
Mark McLoughlin acbee3d
Name:             python-novaclient
039c8c7
Epoch:            1
35f2bcb
Version:          13.0.0
2a55b11
Release:          3%{?dist}
Mark McLoughlin acbee3d
Summary:          Python API and CLI for OpenStack Nova
Mark McLoughlin acbee3d
License:          ASL 2.0
027794d
URL:              https://launchpad.net/%{name}
0a09127
Source0:          https://pypi.io/packages/source/p/%{name}/%{name}-%{version}.tar.gz
Mark McLoughlin acbee3d
BuildArch:        noarch
0a09127
027794d
BuildRequires:  git
027794d
0a09127
%description
027794d
%{common_desc}
0a09127
35f2bcb
%package -n python%{pyver}-%{sname}
0a09127
Summary:          Python API and CLI for OpenStack Nova
35f2bcb
%{?python_provide:%python_provide python%{pyver}-novaclient}
35f2bcb
%if %{pyver} == 3
7006047
Obsoletes: python2-%{sname} < %{version}-%{release}
35f2bcb
%endif
35f2bcb
35f2bcb
BuildRequires:    python%{pyver}-devel
35f2bcb
BuildRequires:    python%{pyver}-pbr
35f2bcb
BuildRequires:    python%{pyver}-setuptools
35f2bcb
35f2bcb
Requires:         python%{pyver}-babel >= 2.3.4
35f2bcb
Requires:         python%{pyver}-iso8601 >= 0.1.11
35f2bcb
Requires:         python%{pyver}-keystoneauth1 >= 3.5.0
35f2bcb
Requires:         python%{pyver}-oslo-i18n >= 3.15.3
35f2bcb
Requires:         python%{pyver}-oslo-serialization >= 2.18.0
35f2bcb
Requires:         python%{pyver}-oslo-utils >= 3.33.0
35f2bcb
Requires:         python%{pyver}-pbr >= 2.0.0
35f2bcb
Requires:         python%{pyver}-prettytable >= 0.7.2
35f2bcb
Requires:         python%{pyver}-six >= 1.10.0
35f2bcb
# Handle python2 exception
35f2bcb
%if %{pyver} == 2
35f2bcb
Requires:         python-simplejson >= 3.5.1
35f2bcb
%else
35f2bcb
Requires:         python%{pyver}-simplejson >= 3.5.1
35f2bcb
%endif
35f2bcb
35f2bcb
35f2bcb
%description -n python%{pyver}-%{sname}
027794d
%{common_desc}
0a09127
35f2bcb
%if 0%{?with_doc}
Mark McLoughlin acbee3d
%package doc
Mark McLoughlin acbee3d
Summary:          Documentation for OpenStack Nova API Client
Mark McLoughlin acbee3d
35f2bcb
BuildRequires:    python%{pyver}-sphinx
35f2bcb
BuildRequires:    python%{pyver}-sphinxcontrib-apidoc
35f2bcb
BuildRequires:    python%{pyver}-openstackdocstheme
35f2bcb
BuildRequires:    python%{pyver}-oslo-utils
35f2bcb
BuildRequires:    python%{pyver}-keystoneauth1
35f2bcb
BuildRequires:    python%{pyver}-oslo-serialization
35f2bcb
BuildRequires:    python%{pyver}-prettytable
Mark McLoughlin acbee3d
Mark McLoughlin acbee3d
%description      doc
027794d
%{common_desc}
35f2bcb
%endif
Mark McLoughlin acbee3d
Mark McLoughlin acbee3d
This package contains auto-generated documentation.
Mark McLoughlin acbee3d
Mark McLoughlin acbee3d
%prep
bdbb334
%autosetup -n %{name}-%{upstream_version} -S git
Mark McLoughlin acbee3d
Jakub Ruzicka fe58fbe
# Let RPM handle the requirements
35f2bcb
rm -rf *requirements.txt
Mark McLoughlin acbee3d
Mark McLoughlin acbee3d
%build
35f2bcb
%{pyver_build}
Mark McLoughlin acbee3d
Mark McLoughlin acbee3d
%install
35f2bcb
%{pyver_install}
35f2bcb
# Create a versioned binary for backwards compatibility until everything is pure py3
35f2bcb
ln -s nova %{buildroot}%{_bindir}/nova-%{pyver}
Mark McLoughlin acbee3d
Alan Pevec 697e4ca
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
Jakub Ruzicka 25df862
install -pm 644 tools/nova.bash_completion \
Jakub Ruzicka 25df862
    %{buildroot}%{_sysconfdir}/bash_completion.d/nova
Alan Pevec 697e4ca
35f2bcb
# Delete tests
35f2bcb
rm -fr %{buildroot}%{pyver_sitelib}/novaclient/tests
35f2bcb
35f2bcb
%if 0%{?with_doc}
35f2bcb
sphinx-build-%{pyver} -b html doc/source doc/build/html
35f2bcb
sphinx-build-%{pyver} -b man doc/source doc/build/man
Jakub Ruzicka 25df862
bdbb334
install -p -D -m 644 doc/build/man/nova.1 %{buildroot}%{_mandir}/man1/nova.1
Mark McLoughlin acbee3d
Mark McLoughlin acbee3d
# Fix hidden-file-or-dir warnings
35f2bcb
rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo doc/build/html/.htaccess
35f2bcb
%endif
Mark McLoughlin acbee3d
35f2bcb
%files -n python%{pyver}-%{sname}
0a09127
%license LICENSE
0a09127
%doc README.rst
35f2bcb
%{pyver_sitelib}/%{sname}
35f2bcb
%{pyver_sitelib}/*.egg-info
0a09127
%{_sysconfdir}/bash_completion.d
35f2bcb
%if 0%{?with_doc}
0a09127
%{_mandir}/man1/nova.1.gz
35f2bcb
%endif
7006047
%{_bindir}/nova
35f2bcb
%{_bindir}/nova-%{pyver}
Mark McLoughlin acbee3d
35f2bcb
%if 0%{?with_doc}
Mark McLoughlin acbee3d
%files doc
bdbb334
%doc doc/build/html
0a09127
%license LICENSE
35f2bcb
%endif
Mark McLoughlin acbee3d
Mark McLoughlin acbee3d
%changelog
2a55b11
* Mon Aug 19 2019 Miro HronĨok <mhroncok@redhat.com> - 1:13.0.0-3
2a55b11
- Rebuilt for Python 3.8
2a55b11
07a85dd
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:13.0.0-2
07a85dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
07a85dd
35f2bcb
* Mon Mar 11 2019 RDO <dev@lists.rdoproject.org> 1:13.0.0-1
35f2bcb
- Update to 13.0.0
Mark McLoughlin acbee3d