From e7dba6282e2e5b27edfc31242724281f969c23ee Mon Sep 17 00:00:00 2001 From: Alan Pevec Date: Sep 03 2015 08:44:03 +0000 Subject: Merge rpm-master Change-Id: I306b94c7fdcc26290b55af9c28a63ff0402dde70 --- diff --git a/python-oslo-config.spec b/python-oslo-config.spec index a389a25..2d37f27 100644 --- a/python-oslo-config.spec +++ b/python-oslo-config.spec @@ -1,10 +1,12 @@ %global sname oslo.config -%global milestone a5 +%global pypi_name oslo-config %if 0%{?fedora} %global with_python3 1 %endif +%{!?upstream_version: %global upstream_version %{version}%{?milestone}} + Name: python-oslo-config Epoch: 2 Version: 2.4.0 @@ -19,6 +21,23 @@ Source0: https://pypi.python.org/packages/source/o/%{sname}/%{sname}-%{versio Patch0001: 0001-add-usr-share-project-dist.conf-to-the-default-confi.patch BuildArch: noarch + +%description +The Oslo project intends to produce a python library containing +infrastructure code shared by OpenStack projects. The APIs provided +by the project should be high quality, stable, consistent and generally +useful. + +The oslo-config library is a command line and configuration file +parsing library from the Oslo project. + +%package -n python2-%{pypi_name} +Summary: OpenStack common configuration library +%{?python_provide:%python_provide python2-%{pypi_name}} +# python_provide does not exist in CBS Cloud buildroot +Provides: python-%{pypi_name} = %{epoch}:%{upstream_version} +Obsoletes: python-%{pypi_name} < %{epoch}:%{upstream_version} + Requires: python-setuptools Requires: python-argparse Requires: python-six >= 1.9.0 @@ -30,7 +49,7 @@ BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-pbr -%description +%description -n python2-%{pypi_name} The Oslo project intends to produce a python library containing infrastructure code shared by OpenStack projects. The APIs provided by the project should be high quality, stable, consistent and generally @@ -39,25 +58,38 @@ useful. The oslo-config library is a command line and configuration file parsing library from the Oslo project. -%package doc +%package -n python2-%{pypi_name}-doc Summary: Documentation for OpenStack common configuration library -Group: Documentation +%{?python_provide:%python_provide python2-%{pypi_name}-doc} +# python_provide does not exist in CBS Cloud buildroot +Provides: python-%{pypi_name}-doc = %{epoch}:%{upstream_version} +Obsoletes: python-%{pypi_name}-doc < %{epoch}:%{upstream_version} BuildRequires: python-sphinx +BuildRequires: python-fixtures BuildRequires: python-oslo-sphinx >= 2.3.0 +BuildRequires: python-netaddr +BuildRequires: python-stevedore -%description doc +%description -n python2-%{pypi_name}-doc Documentation for the oslo-config library. %if 0%{?with_python3} -%package -n python3-oslo-config +%package -n python3-%{pypi_name} Summary: OpenStack common configuration library +%{?python_provide:%python_provide python3-%{pypi_name}} + +Requires: python3-setuptools +Requires: python3-six >= 1.9.0 +Requires: python3-netaddr +Requires: python3-stevedore +Requires: python3-pbr BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pbr -%description -n python3-oslo-config +%description -n python3-%{pypi_name} The Oslo project intends to produce a python library containing infrastructure code shared by OpenStack projects. The APIs provided by the project should be high quality, stable, consistent and generally @@ -68,39 +100,27 @@ parsing library from the Oslo project. %endif %prep -%setup -q -n %{sname}-%{version} +%setup -q -n %{sname}-%{upstream_version} %patch0001 -p1 # let RPM handle deps -rm -f requirements.txt - -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -%endif +rm -rf {test-,}requirements.txt %build %{__python2} setup.py build - %if 0%{?with_python3} -pushd %{py3dir} %{__python3} setup.py build -popd %endif %install %if 0%{?with_python3} # we build the python3 version first not to crush the python2 # version of oslo-config-generator -pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} mv %{buildroot}%{_bindir}/oslo-config-generator \ %{buildroot}%{_bindir}/python3-oslo-config-generator -# FIXME: documentation not built due to non-python3 -popd %endif - %{__python2} setup.py install -O1 --skip-build --root %{buildroot} # Delete tests @@ -108,25 +128,30 @@ rm -fr %{buildroot}%{python2_sitelib}/tests export PYTHONPATH="$( pwd ):$PYTHONPATH" pushd doc -sphinx-build -b html -d build/doctrees source build/html +sphinx-build -b html -d build/doctrees source build/html popd -# Fix hidden-file-or-dir warnings -rm -fr doc/build/html/.buildinfo %check +%{__python2} setup.py test +%if 0%{?with_python3} +%{__python3} setup.py test +%endif -%files -%doc README.rst LICENSE +%files -n python2-%{pypi_name} +%doc README.rst +%license LICENSE %{_bindir}/oslo-config-generator %{python2_sitelib}/oslo_config %{python2_sitelib}/*.egg-info -%files doc -%doc LICENSE doc/build/html +%files -n python2-%{pypi_name}-doc +%doc doc/build/html +%license LICENSE %if 0%{?with_python3} -%files -n python3-oslo-config -%doc README.rst LICENSE +%files -n python3-%{pypi_name} +%doc README.rst +%license LICENSE %{_bindir}/python3-oslo-config-generator %{python3_sitelib}/oslo_config %{python3_sitelib}/*.egg-info