diff --git a/python-oslo-context.spec b/python-oslo-context.spec index 96725ab..1324e90 100644 --- a/python-oslo-context.spec +++ b/python-oslo-context.spec @@ -1,9 +1,15 @@ -# Created by pyp2rpm-1.1.0b %global pypi_name oslo.context +%{!?_licensedir:%global license %%doc} + +%if 0%{?fedora} +%global with_python3 1 +%endif + +%{!?upstream_version: %global upstream_version %{version}%{?milestone}} Name: python-oslo-context Version: 0.5.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OpenStack Oslo Context library License: ASL 2.0 @@ -12,26 +18,62 @@ Source0: https://pypi.python.org/packages/source/o/%{pypi_name}/%{pypi_na BuildArch: noarch +%description +The OpenStack Oslo context library has helpers to maintain +useful information about a request context. +The request context is usually populated in the +WSGI pipeline and used by various modules such as logging. + +%package -n python2-%{pypi_name} +Summary: OpenStack Oslo Context library +%{?python_provide:%python_provide python2-%{pypi_name}} BuildRequires: python2-devel BuildRequires: python-pbr Requires: python-babel -%description +%description -n python2-%{pypi_name} The OpenStack Oslo context library has helpers to maintain useful information about a request context. The request context is usually populated in the WSGI pipeline and used by various modules such as logging. -%package doc +%package -n python2-%{pypi_name}-doc Summary: Documentation for the OpenStack Oslo context library BuildRequires: python-sphinx BuildRequires: python-oslo-sphinx BuildRequires: python-fixtures -%description doc +%description -n python2-%{pypi_name}-doc +Documentation for the OpenStack Oslo context library. + +# python3 +%if 0%{?with_python3} +%package -n python3-%{pypi_name} +Summary: OpenStack Oslo Context library +%{?python_provide:%python_provide python3-%{pypi_name}} +BuildRequires: python3-devel +BuildRequires: python3-pbr + +Requires: python3-babel + +%description -n python3-%{pypi_name} +The OpenStack Oslo context library has helpers to maintain +useful information about a request context. +The request context is usually populated in the +WSGI pipeline and used by various modules such as logging. + +%package -n python3-%{pypi_name}-doc +Summary: Documentation for the OpenStack Oslo context library +%{?python_provide:%python_provide python3-%{pypi_name}} +BuildRequires: python3-sphinx +BuildRequires: python3-oslo-sphinx +BuildRequires: python3-fixtures + +%description -n python3-%{pypi_name}-doc Documentation for the OpenStack Oslo context library. +%endif %prep %setup -q -n %{pypi_name}-%{version} @@ -42,24 +84,55 @@ rm -f requirements.txt # doc export PYTHONPATH="$( pwd ):$PYTHONPATH" %{__python2} setup.py build_sphinx - # Remove the sphinx-build leftovers rm -fr doc/build/html/.{doctrees,buildinfo} +%if 0%{?with_python3} +%{__python3} setup.py build +export PYTHONPATH="$( pwd ):$PYTHONPATH" +pushd doc +sphinx-build-3 -b html -d build/doctrees source build/html +popd +# Fix hidden-file-or-dir warnings +rm -fr doc/build/html/.buildinfo +%endif + %install %{__python2} setup.py install --skip-build --root %{buildroot} -%files + +%if 0%{?with_python3} +%{__python3} setup.py install --skip-build --root %{buildroot} +%endif + +%files -n python2-%{pypi_name} %license LICENSE %doc README.rst %{python2_sitelib}/oslo_context %{python2_sitelib}/*.egg-info -%files doc +%if 0%{?with_python3} +%files -n python3-%{pypi_name} +%license LICENSE +%doc README.rst +%{python3_sitelib}/oslo_context +%{python3_sitelib}/*.egg-info +%endif + +%files -n python2-%{pypi_name}-doc %license LICENSE %doc doc/build/html +%if 0%{?with_python3} +%files -n python3-%{pypi_name}-doc +%license LICENSE +%doc doc/build/html +%endif + %changelog +* Thu Sep 03 2015 Chandan Kumar 0.5.0-2 +- Added python2 and python3 subpackages + * Mon Aug 17 2015 Alan Pevec 0.5.0-1 - Update to upstream 0.5.0