Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

%if 0%{?__python2:1}
%{!?python2_shortver: %global python2_shortver %(%{__python2} -c 'import sys; print("%s.%s" % (sys.version_info.major,sys.version_info.minor))')}
%else
%{!?python2_shortver: %global python3_shortver 2.x}
%endif

%if 0%{?__python3:1}
%{!?python3_shortver: %global python3_shortver %(%{__python3} -c 'import sys; print("%s.%s" % (sys.version_info.major,sys.version_info.minor))')}
%else
%{!?python3_shortver: %global python3_shortver 3.x}
%endif

%global srcname shade

Name:           python-%{srcname}
Version:        1.27.1
Release:        2%{?dist}
Summary:        Python module for operating OpenStack clouds
License:        ASL 2.0
URL:            https://pypi.python.org/pypi/shade
Source0:        https://pypi.io/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz

BuildArch:      noarch

%description
shade is a simple client library for operating OpenStack clouds.

%package -n python2-%{srcname}
Summary:        %{summary}

BuildRequires:  git
BuildRequires:  python2-pbr >= 0.11
BuildRequires:  python2-devel

# test-requirements.txt
BuildRequires: python2-fixtures
BuildRequires: python2-mock
BuildRequires: python2-oslotest
BuildRequires: python2-requests-mock
BuildRequires: python2-stestr
BuildRequires: python2-testscenarios
BuildRequires: python2-testtools

# requirements.txt
BuildRequires:  python2-os-client-config
BuildRequires:  python2-openstacksdk

Requires:       python2-pbr
Requires:       python2-os-client-config
Requires:       python2-openstacksdk

Conflicts:      python-novaclient = 2.27.0
Conflicts:      python-novaclient = 2.32.0

%description -n python2-%{srcname}
shade is a simple client library for operating OpenStack clouds.

%if 0%{?with_python3}
%package -n python3-%{srcname}
Summary:        %{summary}

BuildRequires:  python3-devel

# test-requirements.txt
BuildRequires: python3-fixtures
BuildRequires: python3-mock
BuildRequires: python3-oslotest
BuildRequires: python3-requests-mock
BuildRequires: python3-stestr
BuildRequires: python3-testscenarios
BuildRequires: python3-testtools
# requirements.txt
BuildRequires:  python3-os-client-config
BuildRequires:  python3-openstacksdk

Requires:       python3-pbr
Requires:       python3-os-client-config
Requires:       python3-openstacksdk

Conflicts:      python3-novaclient = 2.27.0
Conflicts:      python3-novaclient = 2.32.0

%description -n python3-%{srcname}
shade is a simple client library for operating OpenStack clouds.
%endif

%prep
%autosetup -n %{srcname}-%{version} -S git

%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif

%check
PYTHON=python2 stestr --test-path ./shade/tests/unit run
%if 0%{?with_python3}
PYTHON=python3 stestr-3 --test-path ./shade/tests/unit run
%endif

%install
%py2_install
%if 0%{?with_python3}
rm $RPM_BUILD_ROOT%{_bindir}/*
%py3_install
%endif

%files -n python2-%{srcname}
%license LICENSE
%doc README.rst AUTHORS
%{python2_sitelib}/shade*

%if ! 0%{?with_python3}
%{_bindir}/shade-inventory
%endif

%if 0%{?with_python3}
%files -n python3-%{srcname}
%license LICENSE
%doc README.rst AUTHORS
%{python3_sitelib}/shade*
%{_bindir}/shade-inventory
%endif

%changelog
* Wed Sep 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.27.1-2
- Only ship one /usr/bin/shade-inventory

* Thu Aug 16 2018 Javier Peña <jpena@redhat.com> - 1.27.1-1
- New upstream 1.27.1 release
- Fixed Rawhide build (bz#1605905)

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.18.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.18.1-5
- Rebuilt for Python 3.7

* Mon Mar 26 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.18.1-4
- 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> - 1.18.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.18.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Thu Mar 30 2017 Paul Belanger <pabelanger@redhat.com> - 1.18.1-1
- New upstream 1.18.1 release
- Bump os-client-config to 1.25.0
- Remove python-magnumclient and python-heatclient
- Add python-futures dependency

* Mon Mar 27 2017 Paul Belanger <pabelanger@redhat.com> - 1.17.0-2
- Remove python3-ipaddress

* Sun Mar 26 2017 Paul Belanger <pabelanger@redhat.com> - 1.17.0-1
- New upstream 1.17.0 release (closes #1432701)
- Uncap PBR as 2.0 has been released
- Add python-jmespath, python-requests-mock, python-testscenarios
- Bump python-os-client-config to 1.22.0
- Remove python-betamax, python-swiftclient, python-glanceclient,
  python-troveclient
- Enable python3 support (closes #1369025)

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Wed Oct 19 2016 Paul Belanger <pabelanger@redhat.com> - 1.12.1
- New upstream 1.12.1 release
- Add python-magnumclient, python-designateclient, python-betamax
- Update existing dependency versions
- Switch Source0 to pypi.io

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.0-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Wed Apr 20 2016 Paul Belanger <pabelanger@redhat.com> - 1.7.0-1
- New upstream 1.7.0 release

* Thu Mar 10 2016 Paul Belanger <pabelanger@redhat.com> - 1.5.1-1
- New upstream 1.5.1 release
- Add Requires python-heatclient
- Remove unneeded python-designateclient
- Add python-ipaddress requires
- Fix minimal requirements
- Enable unit testing (closes #1306419)

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jan 14 2016 Paul Belanger <pabelanger@redhat.com> - 1.4.0-3
- Add Requires python-requestsexceptions

* Fri Jan 08 2016 Lars Kellogg-Stedman <lars@redhat.com> - 1.4.0-2
- avoid rpmlint failures due to undefined macros

* Fri Jan 08 2016 Lars Kellogg-Stedman <lars@redhat.com> - 1.4.0-1
- shade 1.4.0

* Mon Jan 04 2016 Lars Kellogg-Stedman <lars@redhat.com> - 1.3.0-2
- correct rpmlint errors

* Mon Jan 04 2016 Lars Kellogg-Stedman <lars@redhat.com> - 1.3.0-1
- shade 1.3.0

* Wed Oct 28 2015 Lars Kellogg-Stedman <lars@redhat.com> - 1.0.0-3
- initial package