Blob Blame History Raw
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}

%if 0%{?fedora}
%global with_python3 1
%endif

%global pypi_name taskflow

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

# see https://fedoraproject.org/wiki/Packaging:Python#Macros
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

Name:           python-%{pypi_name}
Version:        1.30.0
Release:        3%{?dist}
Summary:        Taskflow structured state management library

License:        ASL 2.0
URL:            https://launchpad.net/taskflow
Source0:        http://pypi.python.org/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

%description
A library to do [jobs, tasks, flows] in a HA manner using
different backends to be used with OpenStack projects.


%package -n python2-%{pypi_name}
Summary:        Taskflow structured state management library
BuildRequires:  python2-devel
BuildRequires:  python-pbr

Requires:       python-anyjson
Requires:       python-automaton >= 0.2.0
Requires:       python-babel
Requires:       python-cachetools >= 1.0.0
Requires:       python-contextlib2 >= 0.4.0
Requires:       python-debtcollector >= 0.3.0
Requires:       python-enum34
Requires:       python-fasteners >= 0.7
Requires:       python-futures >= 3.0
Requires:       python-futurist >= 0.1.2
Requires:       python-iso8601
Requires:       python-jsonschema
Requires:       python-monotonic >= 0.1
Requires:       python-networkx-core
Requires:       python-oslo-serialization >= 1.4.0
Requires:       python-oslo-utils >= 1.9.0
Requires:       python-pbr
Requires:       python-six >= 1.9.0
Requires:       python-stevedore >= 1.5.0

%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}
A library to do [jobs, tasks, flows] in a HA manner using
different backends to be used with OpenStack projects.

%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary:        Taskflow structured state management library
BuildRequires:  python3-devel
BuildRequires:  python3-pbr

Requires:       python3-anyjson
Requires:       python3-iso8601
Requires:       python3-six
Requires:       python3-babel
Requires:       python3-stevedore
Requires:       python3-futures
Requires:       python3-networkx-core
Requires:       python3-oslo-serialization
Requires:       python3-oslo-utils
Requires:       python3-jsonschema
Requires:       python3-enum34
Requires:       python3-debtcollector
Requires:       python3-automaton >= 0.5.0
Requires:       python3-networkx >= 1.10

%{?python_provide:%python_provide python3-%{pypi_name}}


%description -n python3-%{pypi_name}
A library to do [jobs, tasks, flows] in a HA manner using
different backends to be used with OpenStack projects.
%endif


%package doc
Summary:          Documentation for Taskflow
BuildRequires:  python-oslo-sphinx
BuildRequires:  python-sphinx


BuildRequires:  python-oslo-sphinx
%if 0%{?rhel} == 6
BuildRequires:  python-sphinx10
%else
BuildRequires:  python-sphinx
%endif

# for docs build
BuildRequires:       python-oslo-utils >= 1.9.0
BuildRequires:       python-automaton >= 0.2.0
BuildRequires:       python-cachetools >= 1.0.0
BuildRequires:       python-contextlib2 >= 0.4.0
BuildRequires:       python-futurist >= 0.1.2
BuildRequires:       python-networkx-core
#TODO ImportErrors during sphinx-build:
#kazoo
#redis

%description doc
A library to do [jobs, tasks, flows] in a HA manner using
different backends to be used with OpenStack projects.
This package contains the associated documentation.

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

# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

# Remove the requirements file so that pbr hooks don't add it
# to distutils requires_dist config
rm -rf {test-,}requirements.txt


%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
# generate html docs
%if 0%{?rhel} == 6
sphinx-1.0-build doc/source html
%else
sphinx-build doc/source html
%endif
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}


%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif


%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-*.egg-info

%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-*.egg-info
%endif

%files doc
%doc html
%license LICENSE

%changelog
* Sun Jul 31 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 1.30.0-3
- Add python3 subpackage
- Added python-networkx missing packages
- Remove dependency on networkx.drawing

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

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

* Wed Oct 07 2015 Alan Pevec <alan.pevec@redhat.com> 1.21.0-1
- Update to upstream 1.21.0

* Tue Aug 18 2015 Alan Pevec <alan.pevec@redhat.com> 1.18.0-1
- Update to upstream 1.18.0

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Tue Mar 31 2015 Haikel Guemar <hguemar@fedoraproject.org> 0.7.1-1
- Update to upstream 0.7.1

* Sat Jan 17 2015 Haikel Guemar <hguemar@fedoraproject.org> 0.5.0-1
- Update to upstream 0.5.0
- Drop remove runtime dep on pbr patch
- Add new requirements

* Thu Aug 28 2014 Pádraig Brady <pbrady@redhat.com> - 0.3.21-1
- Latest upstream

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 07 2014 Pádraig Brady <pbrady@redhat.com> - 0.1.2-6
- Remove dependence on pbr

* Sun Mar 16 2014 Padraig Brady <P@draigBrady.com> - 0.1.2-5
- Reduce dependency to python-networkx-core subpackage

* Wed Jan 29 2014 Padraig Brady <P@draigBrady.com> - 0.1.2-4
- Initial package.