765ba68
%if 0%{?fedora} >= 24
765ba68
%global with_python3 1
765ba68
%endif
765ba68
Alan Pevec 077ceb5
%global pypi_name oslo.middleware
765ba68
%global pkg_name oslo-middleware
765ba68
765ba68
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
Alan Pevec 077ceb5
Alan Pevec 077ceb5
Name:           python-oslo-middleware
30a78ea
Version:        3.8.0
30a78ea
Release:        1%{?dist}
Alan Pevec 077ceb5
Summary:        OpenStack Oslo Middleware library
Alan Pevec 077ceb5
Alan Pevec 077ceb5
License:        ASL 2.0
Alan Pevec 077ceb5
URL:            https://launchpad.net/oslo
Alan Pevec 077ceb5
Source0:        https://pypi.python.org/packages/source/o/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
Alan Pevec 077ceb5
BuildArch:      noarch
Alan Pevec 077ceb5
765ba68
%package -n python2-%{pkg_name}
765ba68
Summary:        OpenStack Oslo Middleware library
765ba68
%{?python_provide:%python_provide python2-%{pkg_name}}
765ba68
Alan Pevec 077ceb5
BuildRequires:  python2-devel
Alan Pevec 077ceb5
BuildRequires:  python-pbr
Alan Pevec 077ceb5
# for docs build
Alan Pevec 077ceb5
BuildRequires:  python-oslo-config
Alan Pevec 077ceb5
BuildRequires:  python-oslo-context
Alan Pevec 077ceb5
BuildRequires:  python-oslo-i18n
765ba68
BuildRequires:  python-oslo-utils
765ba68
# Required for testing
765ba68
BuildRequires:  python-fixtures
765ba68
BuildRequires:  python-hacking
765ba68
BuildRequires:  python-mock
765ba68
BuildRequires:  python-oslotest
765ba68
BuildRequires:  python-testtools
765ba68
BuildRequires:  python-webob
Alan Pevec 077ceb5
Alan Pevec 077ceb5
Requires:       python-babel
765ba68
Requires:       python-jinja2
Alan Pevec 077ceb5
Requires:       python-oslo-config
Alan Pevec 077ceb5
Requires:       python-oslo-context
Alan Pevec 077ceb5
Requires:       python-oslo-i18n
765ba68
Requires:       python-oslo-utils
Alan Pevec 077ceb5
Requires:       python-six
Alan Pevec 077ceb5
Requires:       python-stevedore
Alan Pevec 077ceb5
Requires:       python-webob
Alan Pevec 077ceb5
765ba68
%description -n python2-%{pkg_name}
765ba68
The OpenStack Oslo Middleware library.
765ba68
Oslo middleware library includes components that can be injected into wsgi
765ba68
pipelines to intercept request/response flows. The base class can be
765ba68
enhanced with functionality like add/delete/modification of http headers
765ba68
and support for limiting size/connection etc.
765ba68
765ba68
%if 0%{?with_python3}
765ba68
%package -n python3-%{pkg_name}
765ba68
Summary:        OpenStack Oslo Middleware library
765ba68
%{?python_provide:%python_provide python3-%{pkg_name}}
765ba68
765ba68
BuildRequires:  python3-devel
765ba68
BuildRequires:  python3-pbr
765ba68
# for docs build
765ba68
BuildRequires:  python3-oslo-config
765ba68
BuildRequires:  python3-oslo-context
765ba68
BuildRequires:  python3-oslo-i18n
765ba68
# Required for testing
765ba68
BuildRequires:  python3-fixtures
765ba68
BuildRequires:  python3-hacking
765ba68
BuildRequires:  python3-mock
765ba68
BuildRequires:  python3-oslotest
765ba68
BuildRequires:  python3-testtools
765ba68
BuildRequires:  python3-webob
765ba68
765ba68
Requires:       python3-babel
765ba68
Requires:       python3-jinja2
765ba68
Requires:       python3-oslo-config
765ba68
Requires:       python3-oslo-context
765ba68
Requires:       python3-oslo-i18n
765ba68
Requires:       python3-oslo-utils
765ba68
Requires:       python3-six
765ba68
Requires:       python3-stevedore
765ba68
Requires:       python3-webob
765ba68
765ba68
%description -n python3-%{pkg_name}
Alan Pevec 077ceb5
The OpenStack Oslo Middleware library.
Alan Pevec 077ceb5
Oslo middleware library includes components that can be injected into wsgi
Alan Pevec 077ceb5
pipelines to intercept request/response flows. The base class can be
Alan Pevec 077ceb5
enhanced with functionality like add/delete/modification of http headers
Alan Pevec 077ceb5
and support for limiting size/connection etc.
Alan Pevec 077ceb5
765ba68
%package -n python3-%{pkg_name}-tests
765ba68
Summary:    Tests for the Oslo Middleware library
765ba68
765ba68
Requires:  python3-%{pkg_name} = %{version}-%{release}
765ba68
Requires:  python3-fixtures
765ba68
Requires:  python3-hacking
765ba68
Requires:  python3-mock
765ba68
Requires:  python3-oslotest
765ba68
Requires:  python3-testtools
765ba68
765ba68
%description -n python3-%{pkg_name}-tests
765ba68
Tests for the Oslo Middleware library.
765ba68
765ba68
%endif
765ba68
Alan Pevec 077ceb5
%package doc
Alan Pevec 077ceb5
Summary:    Documentation for the Oslo Middleware library
Alan Pevec 077ceb5
Group:      Documentation
Alan Pevec 077ceb5
Alan Pevec 077ceb5
BuildRequires:  python-sphinx
Alan Pevec 077ceb5
BuildRequires:  python-oslo-sphinx
Alan Pevec 077ceb5
Alan Pevec 077ceb5
%description doc
Alan Pevec 077ceb5
Documentation for the Oslo Middleware library.
Alan Pevec 077ceb5
765ba68
%package -n python2-%{pkg_name}-tests
765ba68
Summary:    Tests for the Oslo Middleware library
765ba68
765ba68
Requires:  python-%{pkg_name} = %{version}-%{release}
765ba68
Requires:  python-fixtures
765ba68
Requires:  python-hacking
765ba68
Requires:  python-mock
765ba68
Requires:  python-oslotest
765ba68
Requires:  python-testtools
765ba68
765ba68
%description -n python2-%{pkg_name}-tests
765ba68
Tests for the Oslo Middleware library.
765ba68
765ba68
%description
765ba68
The OpenStack Oslo Middleware library.
765ba68
Oslo middleware library includes components that can be injected into wsgi
765ba68
pipelines to intercept request/response flows. The base class can be
765ba68
enhanced with functionality like add/delete/modification of http headers
765ba68
and support for limiting size/connection etc.
765ba68
Alan Pevec 077ceb5
%prep
765ba68
%setup -q -n %{pypi_name}-%{upstream_version}
Alan Pevec 077ceb5
# Let RPM handle the dependencies
765ba68
rm -rf {test-,}requirements.txt
Alan Pevec 077ceb5
Alan Pevec 077ceb5
%build
765ba68
%py2_build
765ba68
765ba68
%if 0%{?with_python3}
765ba68
%py3_build
765ba68
%endif
Alan Pevec 077ceb5
Alan Pevec 077ceb5
# generate html docs
Alan Pevec 077ceb5
sphinx-build doc/source html
Alan Pevec 077ceb5
# remove the sphinx-build leftovers
Alan Pevec 077ceb5
rm -rf html/.{doctrees,buildinfo}
Alan Pevec 077ceb5
Alan Pevec 077ceb5
%install
765ba68
%py2_install
765ba68
765ba68
%if 0%{?with_python3}
765ba68
%py3_install
765ba68
%endif
Alan Pevec 077ceb5
765ba68
%check
765ba68
%{__python2} setup.py test
765ba68
%if 0%{?with_python3}
765ba68
rm -rf .testrepository
765ba68
%{__python3} setup.py test
765ba68
%endif
Alan Pevec 077ceb5
765ba68
%files -n python2-%{pkg_name}
Alan Pevec 077ceb5
%license LICENSE
Alan Pevec 077ceb5
%doc README.rst
Alan Pevec 077ceb5
%{python2_sitelib}/oslo_middleware
Alan Pevec 077ceb5
%{python2_sitelib}/*.egg-info
765ba68
%exclude %{python2_sitelib}/oslo_middleware/tests/
Alan Pevec 077ceb5
765ba68
%if 0%{?with_python3}
765ba68
%files -n python3-%{pkg_name}
Alan Pevec 077ceb5
%license LICENSE
765ba68
%doc README.rst
765ba68
%{python3_sitelib}/oslo_middleware
765ba68
%{python3_sitelib}/*.egg-info
f84148e
765ba68
%files -n python3-%{pkg_name}-tests
765ba68
%{python3_sitelib}/oslo_middleware/tests/
765ba68
%endif
Alan Pevec f307c97
765ba68
%files doc
765ba68
%license LICENSE
765ba68
%doc html
Alan Pevec 2b40e7c
765ba68
%files -n python2-%{pkg_name}-tests
765ba68
%{python2_sitelib}/oslo_middleware/tests/
Alan Pevec cb81fed
765ba68
%changelog
30a78ea
* Wed Sep 07 2016 Haikel Guemar <hguemar@fedoraproject.org> 3.8.0-1
30a78ea
- Update to 3.8.0
30a78ea
7c82334
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.0-2
7c82334
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
7c82334
765ba68
* Wed Mar 23 2016 Haikel Guemar <hguemar@fedoraproject.org> 3.7.0-
765ba68
- Update to 3.7.0
8858e71