Blob Blame Raw
%if 0%{?fedora} || 0%{?rhel} > 7
%bcond_with    python2
%bcond_without python3
%else
%bcond_without python2
%bcond_with    python3
%endif

%{!?upstream_version: %global upstream_version %{version}%{?milestone}}

%global pypi_name futurist

Name:           python-%{pypi_name}
Version:        1.7.0
Release:        3%{?dist}
Summary:        Useful additions to futures, from the future

License:        ASL 2.0
URL:            http://docs.openstack.org/developer/futurist
Source0:        https://pypi.io/packages/source/f/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

%if %{with python2}
%package -n python2-%{pypi_name}
Summary:        Useful additions to futures, from the future
%{?python_provide:%python_provide python2-%{pypi_name}}

BuildRequires:  python2-devel
BuildRequires:  python2-pbr
BuildRequires:  python2-sphinx
BuildRequires:  python2-oslo-sphinx
BuildRequires:  python2-futures
BuildRequires:  python2-monotonic
BuildRequires:  python2-prettytable
BuildRequires:  python2-contextlib2
BuildRequires:  python2-setuptools
BuildRequires:  python2-six
BuildRequires:  python2-openstackdocstheme
# test requirements
BuildRequires:  python2-eventlet
BuildRequires:  python2-subunit
BuildRequires:  python2-oslotest
BuildRequires:  python2-testrepository
BuildRequires:  python2-testscenarios
BuildRequires:  python2-testtools

Requires:       python2-six >= 1.9.0
Requires:       python2-monotonic
Requires:       python2-futures >= 3.0
Requires:       python2-contextlib2 >= 0.4.0
Requires:       python2-prettytable

%description -n python2-%{pypi_name}
Code from the future, delivered to you in the now.
%endif

%if %{with python3}
%package -n python3-%{pypi_name}
Summary:        Useful additions to futures, from the future
%{?python_provide:%python_provide python3-%{pypi_name}}

BuildRequires:  python3-devel
BuildRequires:  python3-pbr
BuildRequires:  python3-oslo-sphinx
BuildRequires:  python3-monotonic
BuildRequires:  python3-prettytable
BuildRequires:  python3-sphinx
BuildRequires:  python3-setuptools
BuildRequires:  python3-six
BuildRequires:  python3-openstackdocstheme
# test requirements
BuildRequires:  python3-eventlet
BuildRequires:  python3-subunit
BuildRequires:  python3-oslotest
BuildRequires:  python3-testrepository
BuildRequires:  python3-testscenarios
BuildRequires:  python3-testtools


Requires:       python3-six >= 1.9.0
Requires:       python3-monotonic
Requires:       python3-contextlib2 >= 0.4.0
Requires:       python3-prettytable

%description -n python3-%{pypi_name}
Code from the future, delivered to you in the now.
%endif

%package -n python-%{pypi_name}-doc
Summary:        Useful additions to futures, from the future - documentation

%description -n python-%{pypi_name}-doc
Code from the future, delivered to you in the now. (documentation)

%description
========
Futurist
========

Code from the future, delivered to you in the now.

%prep
%setup -q -n %{pypi_name}-%{version}

%build
%if 0%{with python3}
%py3_build
%endif # with_python3
%if %{with python2}
%py2_build
%endif

# generate html docs
sphinx-build doc/source html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}


%install
%if %{with python3}
%py3_install
%endif
%if %{with python2}
%py2_install
%endif

%check
%if %{with python2}
export PYTHON=%{__python2}
# test fails with db type could not determined
# %{__python2} setup.py testr --slowest
%endif
%if %{with python3}
export PYTHON=%{__python3}
%{__python3} setup.py testr --slowest
%endif

%if %{with python2}
%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif

%if %{with python3}
%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif

%files -n python-%{pypi_name}-doc
%doc html
%license LICENSE

%changelog
* Mon Feb 04 2019 Javier Peña <jpena@redhat.com> - 1.7.0-3
- Remove Python2 subpackage in Fedora 30+ (bz#1671984)
- Enable unit tests

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Mon Jul 23 2018 Matthias Runge <mrunge@redhat.com> - 1.7.0-1
- update to 1.7.0

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

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

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.19.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Fri Jan 19 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.19.0-5
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

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

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

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.19.0-2
- Rebuild for Python 3.6

* Fri Oct 21 2016 Javier Peña <jpena@redhat.com> - 0.19.0-1
- Update to upstream 0.19.0
- Cleanup package
- Add doc subpackage

* Thu Sep 22 2016 Javier Peña <jpena@redhat.com> - 0.18.0-1
- Update to upstream 0.18.0

* Tue Aug 16 2016 Javier Peña <jpena@redhat.com> - 0.17.0-2
- Add python3-oslo-sphinx as BR

* Tue Aug 16 2016 Javier Peña <jpena@redhat.com> - 0.17.0-1
- Update to upstream 0.17.0
- Update Source URL

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

* Fri Feb 26 2016 Javier Peña <jpena@redhat.com> - 0.13.0-1
- Update to upstream 0.13.0

* Wed Feb 10 2016 Javier Peña <jpena@redhat.com> - 0.11.0-1
- Update to upstream 0.11.0

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

* Tue Dec 22 2015 Javier Peña <alan.pevec@redhat.com> 0.9.0-1
- Update to upstream 0.9.0

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Fri Sep 18 2015 Alan Pevec <alan.pevec@redhat.com> 0.5.0-1
- Update to upstream 0.5.0

* Mon Sep 7 2015  jpena <jpena@redhat.com> - 0.4.0-3
- Drop fallback python_sitelib macro
- Fix file listing
* Thu Aug 27 2015 jpena <jpena@redhat.com> - 0.4.0-2
- Fix requires and buildrequires for python2 subpackage
- Fixed fedora macro
- Improved file listing
* Tue Aug 25 2015 jpena <jpena@redhat.com> - 0.4.0-1
- Bump to upstream version 0.4.0
* Thu Aug 13 2015 jpena <jpena@redhat.com> - 0.1.1-5
- Comply with updated Python packaging guidelines (II)
- Add python-six and python-setuptools to BuildRequirements
* Thu Aug 13 2015 jpena <jpena@redhat.com> - 0.1.1-4
- Comply with updated Python packaging guidelines
* Mon Aug 10 2015 jpena <jpena@redhat.com> - 0.1.1-3
- Moved sphinx-build to build step
* Fri Jul 24 2015 jpena <jpena@redhat.com> - 0.1.1-2
- Removed absolute python_sitelib paths
* Tue Jul 14 2015 jpena <jpena@redhat.com> - 0.1.1-1
- Initial package.