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

%global pypi_name oslo.middleware
%global pkg_name oslo-middleware
%global common_desc \
The OpenStack Oslo Middleware library. \
Oslo middleware library includes components that can be injected into wsgi \
pipelines to intercept request/response flows. The base class can be \
enhanced with functionality like add/delete/modification of http headers \
and support for limiting size/connection etc.

%global common_desc2 \
Tests for the Oslo Middleware library.

Name:           python-oslo-middleware
Version:        3.34.0
Release:        2%{?dist}
Summary:        OpenStack Oslo Middleware library

License:        ASL 2.0
URL:            https://launchpad.net/oslo
Source0:        https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
BuildArch:      noarch

BuildRequires:  git

%description
%{common_desc}

%package -n python3-%{pkg_name}
Summary:        OpenStack Oslo Middleware library
%{?python_provide:%python_provide python3-%{pkg_name}}

BuildRequires:  python3-devel
BuildRequires:  python3-pbr
# for docs build
BuildRequires:  python3-oslo-config
BuildRequires:  python3-oslo-context
BuildRequires:  python3-oslo-i18n
# Required for testing
BuildRequires:  python3-fixtures
BuildRequires:  python3-hacking
BuildRequires:  python3-mock
BuildRequires:  python3-oslotest
BuildRequires:  python3-oslo-serialization
BuildRequires:  python3-statsd
BuildRequires:  python3-testtools
BuildRequires:  python3-webob

Requires:       python3-pbr
Requires:       python3-debtcollector >= 1.2.0
Requires:       python3-jinja2
Requires:       python3-oslo-config >= 2:5.1.0
Requires:       python3-oslo-context >= 2.19.2
Requires:       python3-oslo-i18n >= 3.15.3
Requires:       python3-oslo-utils >= 3.33.0
Requires:       python3-six
Requires:       python3-statsd
Requires:       python3-stevedore >= 1.20.0
Requires:       python3-webob >= 1.7.1
Requires:       python-%{pkg_name}-lang = %{version}-%{release}

%description -n python3-%{pkg_name}
%{common_desc}

%package -n python3-%{pkg_name}-tests
Summary:    Tests for the Oslo Middleware library

Requires:  python3-%{pkg_name} = %{version}-%{release}
Requires:  python3-fixtures
Requires:  python3-hacking
Requires:  python3-mock
Requires:  python3-oslotest
Requires:  python3-testtools

%description -n python3-%{pkg_name}-tests
%{common_desc2}

%package doc
Summary:    Documentation for the Oslo Middleware library

BuildRequires:  python3-sphinx
BuildRequires:  python3-openstackdocstheme

%description doc
Documentation for the Oslo Middleware library.

%package  -n python-%{pkg_name}-lang
Summary:   Translation files for Oslo middleware library

%description -n python-%{pkg_name}-lang
Translation files for Oslo middleware library

%prep
%autosetup -n %{pypi_name}-%{upstream_version} -S git
# Let RPM handle the dependencies
rm -rf {test-,}requirements.txt

%build
%py3_build

# generate html docs
%{__python3} setup.py build_sphinx -b html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
# Generate i18n files
%{__python3} setup.py compile_catalog -d build/lib/oslo_middleware/locale

%install
%py3_install

# Install i18n .mo files (.po and .pot are not required)
install -d -m 755 %{buildroot}%{_datadir}
rm -f %{buildroot}%{python3_sitelib}/oslo_middleware/locale/*/LC_*/oslo_middleware*po
rm -f %{buildroot}%{python3_sitelib}/oslo_middleware/locale/*pot
mv %{buildroot}%{python3_sitelib}/oslo_middleware/locale %{buildroot}%{_datadir}/locale

# Find language files
%find_lang oslo_middleware --all-name

%check
export PYTHON=%{__python3}
%{__python3} setup.py test

%files -n python3-%{pkg_name}
%license LICENSE
%doc README.rst
%{python3_sitelib}/oslo_middleware
%{python3_sitelib}/*.egg-info

%files -n python3-%{pkg_name}-tests
%{python3_sitelib}/oslo_middleware/tests/

%files doc
%license LICENSE
%doc doc/build/html

%files -n python-%{pkg_name}-lang -f oslo_middleware.lang
%license LICENSE

%changelog
* Thu Jan 31 2019 Yatin Karel <ykarel@redhat.com>  - 3.34.0-2
- Drop python2 sub packages (#1634863)

* Sat Feb 10 2018 RDO <dev@lists.rdoproject.org> 3.34.0-1
- Update to 3.34.0