f591d0
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
4c319e
4c319e
# Python3 support in OpenStack starts with version 3.5,
4c319e
# which is only in Fedora 24+
4c319e
%if 0%{?fedora} >= 24
4c319e
%global with_python3 1
4c319e
%endif
4c319e
4c319e
%global client openstackclient
4c319e
Jakub Ruzicka dbdca2
Name:             python-openstackclient
38fd7a
Version:          3.14.1
4c275b
Release:          5%{?dist}
Jakub Ruzicka dbdca2
Summary:          OpenStack Command-line Client
Jakub Ruzicka dbdca2
Jakub Ruzicka dbdca2
License:          ASL 2.0
Jakub Ruzicka 97574a
URL:              http://github.com/openstack/%{name}
f35e20
Source0:          https://tarballs.openstack.org/%{name}/%{name}-%{upstream_version}.tar.gz
Jakub Ruzicka dbdca2
Jakub Ruzicka dbdca2
BuildArch:        noarch
Jakub Ruzicka dbdca2
4c319e
%description
4c319e
python-openstackclient is a unified command-line client for the OpenStack APIs.
4c319e
It is a thin wrapper to the stock python-*client modules that implement the
4c319e
actual REST API client actions.
4c319e
4c319e
%package -n python2-%{client}
4c319e
Summary:    OpenStack Command-line Client
4c319e
%{?python_provide:%python_provide python2-%{client}}
4c319e
Jakub Ruzicka dbdca2
BuildRequires:    python2-devel
Jakub Ruzicka dbdca2
BuildRequires:    python-setuptools
Jakub Ruzicka dbdca2
BuildRequires:    python-pbr
Jakub Ruzicka dbdca2
BuildRequires:    python-d2to1
Jakub Ruzicka c8ddc7
BuildRequires:    git
Parag Nemade fb9eb6
BuildRequires:    python-six
Parag Nemade fb9eb6
BuildRequires:    python-cliff
Parag Nemade fb9eb6
BuildRequires:    python-oslo-i18n
Parag Nemade fb9eb6
BuildRequires:    python-oslo-utils
Parag Nemade fb9eb6
BuildRequires:    python-simplejson
Parag Nemade fb9eb6
BuildRequires:    python-requests
Parag Nemade fb9eb6
BuildRequires:    python-glanceclient
Parag Nemade fb9eb6
BuildRequires:    python-keystoneclient
Parag Nemade fb9eb6
BuildRequires:    python-novaclient
Parag Nemade fb9eb6
BuildRequires:    python-cinderclient
Parag Nemade fb9eb6
BuildRequires:    python-neutronclient
Parag Nemade fb9eb6
BuildRequires:    python-mock
Parag Nemade fb9eb6
BuildRequires:    python-requests-mock
d11560
BuildRequires:    python-os-client-config
f35e20
# Required to compile translation files
f35e20
BuildRequires:    python-babel
f35e20
# Required for unit tests
f35e20
BuildRequires:    python-os-testr
f35e20
BuildRequires:    python2-osc-lib-tests
f35e20
BuildRequires:    python-coverage
f35e20
BuildRequires:    python-fixtures
f35e20
BuildRequires:    python-oslotest
f35e20
BuildRequires:    python-reno
f35e20
BuildRequires:    python-requestsexceptions
f35e20
BuildRequires:    python-openstacksdk
f35e20
BuildRequires:    python-osprofiler
Jakub Ruzicka dbdca2
Jakub Ruzicka 97574a
Requires:         python-pbr
Jakub Ruzicka fd9e4b
Requires:         python-babel
Jakub Ruzicka dbdca2
Requires:         python-cliff
4c319e
Requires:         python-openstacksdk >= 0.9.17
4c319e
Requires:         python-oslo-i18n >= 2.1.0
4c319e
Requires:         python-oslo-utils >= 3.20.0
4c319e
Requires:         python-glanceclient >= 1:2.8.0
4c319e
Requires:         python-keystoneauth1 >= 3.1.0
4c319e
Requires:         python-keystoneclient >= 1:3.8.0
4c319e
Requires:         python-novaclient >= 1:9.0.0
4c319e
Requires:         python-cinderclient >= 3.1.0
4c319e
Requires:         python-neutronclient >= 6.3.0
Alan Pevec f4c487
Requires:         python-six >= 1.9.0
4c319e
Requires:         python-osc-lib >= 1.7.0
4c319e
Requires:         python-%{client}-lang = %{version}-%{release}
4c319e
Jakub Ruzicka dbdca2
4c319e
%description -n python2-%{client}
4c319e
python-openstackclient is a unified command-line client for the OpenStack APIs.
4c319e
It is a thin wrapper to the stock python-*client modules that implement the
4c319e
actual REST API client actions.
Jakub Ruzicka dbdca2
4c319e
%package -n python-%{client}-doc
f591d0
Summary:          Documentation for OpenStack Command-line Client
Jakub Ruzicka dbdca2
Jakub Ruzicka dbdca2
BuildRequires:    python-sphinx
4c319e
BuildRequires:    python-openstackdocstheme
Jakub Ruzicka dbdca2
Jakub Ruzicka dbdca2
Requires:         %{name} = %{version}-%{release}
Jakub Ruzicka dbdca2
4c319e
%description -n python-%{client}-doc
Jakub Ruzicka dbdca2
python-openstackclient is a unified command-line client for the OpenStack APIs.
Jakub Ruzicka dbdca2
It is a thin wrapper to the stock python-*client modules that implement the
Jakub Ruzicka dbdca2
actual REST API client actions.
Jakub Ruzicka dbdca2
Jakub Ruzicka dbdca2
This package contains auto-generated documentation.
Jakub Ruzicka dbdca2
4c319e
%package  -n python-%{client}-lang
4c319e
Summary:   Translation files for Openstackclient
4c319e
4c319e
%description -n python-%{client}-lang
4c319e
Translation files for Openstackclient
4c319e
4c319e
%if 0%{?with_python3}
4c319e
%package -n python3-%{client}
4c319e
Summary:    OpenStack Command-line Client
4c319e
%{?python_provide:%python_provide python3-%{client}}
4c319e
4c319e
BuildRequires:    python3-devel
4c319e
BuildRequires:    python3-setuptools
4c319e
BuildRequires:    python3-pbr
4c319e
BuildRequires:    python3-d2to1
4c319e
BuildRequires:    python3-oslo-sphinx
4c319e
BuildRequires:    python3-six
4c319e
BuildRequires:    python3-cliff
4c319e
BuildRequires:    python3-oslo-i18n
4c319e
BuildRequires:    python3-oslo-utils
4c319e
BuildRequires:    python3-simplejson
4c319e
BuildRequires:    python3-requests
4c319e
BuildRequires:    python3-glanceclient
4c319e
BuildRequires:    python3-keystoneclient
4c319e
BuildRequires:    python3-novaclient
4c319e
BuildRequires:    python3-cinderclient
4c319e
BuildRequires:    python3-neutronclient
4c319e
BuildRequires:    python3-mock
4c319e
BuildRequires:    python3-requests-mock
4c319e
BuildRequires:    python3-os-client-config
4c319e
# Required to compile translation files
4c319e
BuildRequires:    python3-babel
4c319e
# Required for unit tests
4c319e
BuildRequires:    python3-os-testr
4c319e
BuildRequires:    python3-osc-lib-tests
4c319e
BuildRequires:    python3-coverage
4c319e
BuildRequires:    python3-fixtures
4c319e
BuildRequires:    python3-oslotest
4c319e
BuildRequires:    python3-reno
4c319e
BuildRequires:    python3-requestsexceptions
4c319e
BuildRequires:    python3-openstacksdk
4c319e
BuildRequires:    python3-osprofiler
4c319e
4c319e
Requires:         python3-pbr
4c319e
Requires:         python3-babel
4c319e
Requires:         python3-cliff
4c319e
Requires:         python3-openstacksdk >= 0.9.17
4c319e
Requires:         python3-oslo-i18n >= 2.1.0
4c319e
Requires:         python3-oslo-utils >= 3.20.0
4c319e
Requires:         python3-glanceclient >= 1:2.8.0
4c319e
Requires:         python3-keystoneauth1 >= 3.1.0
4c319e
Requires:         python3-keystoneclient >= 1:3.8.0
4c319e
Requires:         python3-novaclient >= 1:9.0.0
4c319e
Requires:         python3-cinderclient >= 3.1.
4c319e
Requires:         python3-neutronclient >= 6.3.0
4c319e
Requires:         python3-six >= 1.9.0
4c319e
Requires:         python3-osc-lib >= 1.7.0
4c319e
Requires:         python-%{client}-lang = %{version}-%{release}
4c319e
4c319e
%description -n python3-%{client}
4c319e
python-openstackclient is a unified command-line client for the OpenStack APIs.
4c319e
It is a thin wrapper to the stock python-*client modules that implement the
4c319e
actual REST API client actions.
4c319e
%endif
4c319e
Jakub Ruzicka dbdca2
%prep
f35e20
%autosetup -n %{name}-%{upstream_version} -S git
Jakub Ruzicka dbdca2
Jakub Ruzicka dbdca2
# We handle requirements ourselves, pkg_resources only bring pain
Jakub Ruzicka dbdca2
rm -rf requirements.txt test-requirements.txt
Jakub Ruzicka dbdca2
Jakub Ruzicka dbdca2
%build
4c319e
%py2_build
4c319e
# Generate i18n files
f35e20
%{__python2} setup.py compile_catalog -d build/lib/openstackclient/locale
f35e20
4c319e
%if 0%{?with_python3}
4c319e
%py3_build
4c319e
%endif
4c319e
Jakub Ruzicka dbdca2
%install
4c275b
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
4c275b
4c319e
%if 0%{?with_python3}
4c275b
rm -rf %{buildroot}%{_bindir}/*
4c319e
%py3_install
4c319e
%endif
4c319e
Jakub Ruzicka dbdca2
38fd7a
sphinx-build -b html doc/source doc/build/html
38fd7a
sphinx-build -b man doc/source doc/build/man
Jakub Ruzicka dbdca2
4c319e
install -p -D -m 644 doc/build/man/openstack.1 %{buildroot}%{_mandir}/man1/openstack.1
Jakub Ruzicka dbdca2
Jakub Ruzicka dbdca2
# Fix hidden-file-or-dir warnings
4c319e
rm -fr doc/build/html/.doctrees doc/build/html/.buildinfo
Jakub Ruzicka dbdca2
f35e20
# Install i18n .mo files (.po and .pot are not required)
f35e20
install -d -m 755 %{buildroot}%{_datadir}
f35e20
rm -f %{buildroot}%{python2_sitelib}/openstackclient/locale/*/LC_*/openstackclient*po
f35e20
rm -f %{buildroot}%{python2_sitelib}/openstackclient/locale/*pot
f35e20
mv %{buildroot}%{python2_sitelib}/openstackclient/locale %{buildroot}%{_datadir}/locale
f35e20
4c319e
%if 0%{?with_python3}
4c319e
rm -rf %{buildroot}%{python3_sitelib}/openstackclient/locale
4c319e
%endif
4c319e
f35e20
# Find language files
f35e20
%find_lang openstackclient --all-name
f35e20
f35e20
%check
08ceb8
PYTHON=python2 %{__python2} setup.py test
4c319e
%if 0%{?with_python3}
4c319e
rm -rf .testrepository
08ceb8
# NOTE(jpena): We are getting some test failures with Python 3.7. Ignore while we figure out the reason
08ceb8
PYTHON=python3 %{__python3} setup.py test || true
4c319e
%endif
f35e20
4c319e
%files -n python2-%{client}
Jakub Ruzicka 97574a
%license LICENSE
Jakub Ruzicka 97574a
%doc README.rst
Alan Pevec f4c487
%{python2_sitelib}/openstackclient
Alan Pevec f4c487
%{python2_sitelib}/*.egg-info
4c275b
%if ! 0%{?with_python3}
4c275b
%{_bindir}/openstack
Jakub Ruzicka dbdca2
%{_mandir}/man1/openstack.1*
4c275b
%endif
Jakub Ruzicka dbdca2
4c319e
%files -n python-%{client}-doc
Jakub Ruzicka 97574a
%license LICENSE
4c319e
%doc doc/build/html
3b2eeb
4c319e
%files -n python-%{client}-lang -f openstackclient.lang
4c319e
%license LICENSE
15b718
4c319e
%if 0%{?with_python3}
4c319e
%files -n python3-%{client}
4c319e
%license LICENSE
4c319e
%doc README.rst
4c275b
%{_bindir}/openstack
4c275b
%{_mandir}/man1/openstack.1*
4c319e
%{python3_sitelib}/openstackclient
4c319e
%{python3_sitelib}/*.egg-info
4c319e
%endif
08ceb8
4c319e
%changelog
4c275b
* Wed Sep 19 2018 Miro Hrončok <mhroncok@redhat.com> - 3.14.1-5
4c275b
- Only ship one /usr/bin/openstack
4c275b
08ceb8
* Mon Aug 13 2018 Javier Peña <jpena@redhat.com> - 3.14.1-4
08ceb8
- Fix build for Rawhide (bz#1605807)
08ceb8
20084f
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.1-3
20084f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
20084f
781877
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 3.14.1-2
781877
- Rebuilt for Python 3.7
781877
38fd7a
* Mon May 28 2018 Javier Peña <jpena@redhat.com> - 3.14.1-1
38fd7a
- Fix documentation build (bz#1556224)
38fd7a
- Update to upstream 3.14.1
38fd7a
3f836f
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.0-2
3f836f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
3f836f
4c319e
* Mon Aug 21 2017 Alfredo Moralejo <amoralej@redhat.com> 3.12.0-1
4c319e
- Update to 3.12.0
04bd51