Mark McLoughlin a2d74aa
%global sname oslo.config
Alan Pevec e7dba62
%global pypi_name oslo-config
Alan Pevec 2e821d2
49e0694
%if 0%{?fedora}
49e0694
%global with_python3 1
49e0694
%endif
Mark McLoughlin 69c6541
Alan Pevec e7dba62
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
Alan Pevec e7dba62
Mark McLoughlin 69c6541
Name:       python-oslo-config
Alan Pevec 7611173
Epoch:      2
68291ac
Version:    3.17.0
68291ac
Release:    1%{?dist}
Mark McLoughlin 69c6541
Summary:    OpenStack common configuration library
Mark McLoughlin 69c6541
Mark McLoughlin 69c6541
Group:      Development/Languages
Mark McLoughlin 69c6541
License:    ASL 2.0
Mark McLoughlin 69c6541
URL:        https://launchpad.net/oslo
66d9fd1
Source0:    http://tarballs.openstack.org/oslo.config/oslo.config-%{upstream_version}.tar.gz
Alan Pevec 2e821d2
af6f3ae
Patch0001: 0001-add-usr-share-project-dist.conf-to-the-default-confi.patch
Mark McLoughlin 69c6541
Mark McLoughlin 69c6541
BuildArch:  noarch
Alan Pevec e7dba62
Alan Pevec e7dba62
%description
Alan Pevec e7dba62
The Oslo project intends to produce a python library containing
Alan Pevec e7dba62
infrastructure code shared by OpenStack projects. The APIs provided
Alan Pevec e7dba62
by the project should be high quality, stable, consistent and generally
Alan Pevec e7dba62
useful.
Alan Pevec e7dba62
Alan Pevec e7dba62
The oslo-config library is a command line and configuration file
Alan Pevec e7dba62
parsing library from the Oslo project.
Alan Pevec e7dba62
Alan Pevec e7dba62
%package -n python2-%{pypi_name}
Alan Pevec e7dba62
Summary:    OpenStack common configuration library
Alan Pevec e7dba62
%{?python_provide:%python_provide python2-%{pypi_name}}
Alan Pevec e7dba62
# python_provide does not exist in CBS Cloud buildroot
Alan Pevec e7dba62
Provides:   python-%{pypi_name} = %{epoch}:%{upstream_version}
Alan Pevec e7dba62
Obsoletes:  python-%{pypi_name} < %{epoch}:%{upstream_version}
Alan Pevec e7dba62
Mark McLoughlin be79640
Requires:   python-argparse
68291ac
Requires:   python-netaddr >= 0.7.12
68291ac
Requires:   python-oslo-i18n >= 2.1.0
68291ac
Requires:   python-rfc3986 >= 0.2.0
Alan Pevec 37b5ef1
Requires:   python-pbr
66d9fd1
Requires:   python-setuptools
66d9fd1
Requires:   python-six >= 1.9.0
68291ac
Requires:   python-stevedore >= 1.10.0
68291ac
Requires:   python-debtcollector >= 1.2.0
Mark McLoughlin 69c6541
Mark McLoughlin 69c6541
BuildRequires: python2-devel
Mark McLoughlin 69c6541
BuildRequires: python-setuptools
68291ac
BuildRequires: python-oslo-i18n
68291ac
BuildRequires: python-rfc3986
597db05
BuildRequires: python-pbr
66d9fd1
BuildRequires: git
Mark McLoughlin 69c6541
Alan Pevec e7dba62
%description -n python2-%{pypi_name}
Mark McLoughlin 69c6541
The Oslo project intends to produce a python library containing
Mark McLoughlin 69c6541
infrastructure code shared by OpenStack projects. The APIs provided
Mark McLoughlin 69c6541
by the project should be high quality, stable, consistent and generally
Mark McLoughlin 69c6541
useful.
Mark McLoughlin 69c6541
Mark McLoughlin 69c6541
The oslo-config library is a command line and configuration file
Mark McLoughlin 69c6541
parsing library from the Oslo project.
Mark McLoughlin 69c6541
Alan Pevec e7dba62
%package -n python2-%{pypi_name}-doc
Mark McLoughlin 69c6541
Summary:    Documentation for OpenStack common configuration library
Alan Pevec e7dba62
%{?python_provide:%python_provide python2-%{pypi_name}-doc}
Alan Pevec e7dba62
# python_provide does not exist in CBS Cloud buildroot
Alan Pevec e7dba62
Provides:   python-%{pypi_name}-doc = %{epoch}:%{upstream_version}
Alan Pevec e7dba62
Obsoletes:  python-%{pypi_name}-doc < %{epoch}:%{upstream_version}
Mark McLoughlin 69c6541
Alan Pevec e7dba62
BuildRequires: python-fixtures
Alan Pevec e7dba62
BuildRequires: python-netaddr
66d9fd1
BuildRequires: python-oslo-sphinx >= 2.3.0
66d9fd1
BuildRequires: python-oslotest >= 1.10.0
66d9fd1
BuildRequires: python-sphinx
Alan Pevec e7dba62
BuildRequires: python-stevedore
Mark McLoughlin 69c6541
Alan Pevec e7dba62
%description -n python2-%{pypi_name}-doc
Mark McLoughlin 69c6541
Documentation for the oslo-config library.
Mark McLoughlin 69c6541
49e0694
%if 0%{?with_python3}
Alan Pevec e7dba62
%package -n python3-%{pypi_name}
49e0694
Summary:    OpenStack common configuration library
Alan Pevec e7dba62
%{?python_provide:%python_provide python3-%{pypi_name}}
Alan Pevec e7dba62
68291ac
Requires:   python3-netaddr >= 0.7.12
68291ac
Requires:   python3-oslo-i18n >= 2.1.0
68291ac
Requires:   python3-rfc3986 >= 0.2.0
66d9fd1
Requires:   python3-pbr
Alan Pevec e7dba62
Requires:   python3-setuptools
Alan Pevec e7dba62
Requires:   python3-six >= 1.9.0
68291ac
Requires:   python3-stevedore >= 1.10.0
68291ac
Requires:   python3-debtcollector >= 1.2.0
49e0694
49e0694
BuildRequires: python3-devel
68291ac
BuildRequires: python3-oslo-i18n
68291ac
BuildRequires: python3-rfc3986
66d9fd1
BuildRequires: python3-pbr
49e0694
BuildRequires: python3-setuptools
66d9fd1
BuildRequires: git
66d9fd1
# Required for tests
66d9fd1
BuildRequires: python3-fixtures
Alan Pevec 8cd2898
BuildRequires: python3-netaddr
66d9fd1
BuildRequires: python3-oslo-sphinx >= 2.3.0
66d9fd1
BuildRequires: python3-oslotest >= 1.10.0
66d9fd1
BuildRequires: python3-six >= 1.9.0
Alan Pevec 8cd2898
BuildRequires: python3-stevedore
49e0694
Alan Pevec e7dba62
%description -n python3-%{pypi_name}
49e0694
The Oslo project intends to produce a python library containing
49e0694
infrastructure code shared by OpenStack projects. The APIs provided
49e0694
by the project should be high quality, stable, consistent and generally
49e0694
useful.
49e0694
49e0694
The oslo-config library is a command line and configuration file
49e0694
parsing library from the Oslo project.
49e0694
%endif
49e0694
Mark McLoughlin 69c6541
%prep
66d9fd1
%autosetup -n %{sname}-%{upstream_version} -S git
Alan Pevec 2e821d2
Mark McLoughlin 69c6541
# let RPM handle deps
Alan Pevec e7dba62
rm -rf {test-,}requirements.txt
Mark McLoughlin 69c6541
Mark McLoughlin 69c6541
%build
49e0694
%{__python2} setup.py build
49e0694
%if 0%{?with_python3}
49e0694
%{__python3} setup.py build
49e0694
%endif
Mark McLoughlin 69c6541
Mark McLoughlin 69c6541
%install
49e0694
%if 0%{?with_python3}
49e0694
# we build the python3 version first not to crush the python2
49e0694
# version of oslo-config-generator
49e0694
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
49e0694
mv %{buildroot}%{_bindir}/oslo-config-generator \
49e0694
   %{buildroot}%{_bindir}/python3-oslo-config-generator
49e0694
%endif
49e0694
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
Mark McLoughlin 69c6541
Mark McLoughlin 69c6541
export PYTHONPATH="$( pwd ):$PYTHONPATH"
Mark McLoughlin 69c6541
pushd doc
Alan Pevec e7dba62
sphinx-build -b html -d build/doctrees  source build/html
Mark McLoughlin 69c6541
popd
Mark McLoughlin 69c6541
Mark McLoughlin 69c6541
%check
68291ac
# Tests disabled because of https://review.openstack.org/#/c/334858
68291ac
# Re-enable them when it's fixed.
68291ac
%{__python2} setup.py test || :
Alan Pevec e7dba62
%if 0%{?with_python3}
66d9fd1
rm -rf .testrepository
68291ac
%{__python3} setup.py test || :
Alan Pevec e7dba62
%endif
Mark McLoughlin 69c6541
Alan Pevec e7dba62
%files -n python2-%{pypi_name}
Alan Pevec e7dba62
%doc README.rst
Alan Pevec e7dba62
%license LICENSE
Alan Pevec 2e821d2
%{_bindir}/oslo-config-generator
Alan Pevec 37b5ef1
%{python2_sitelib}/oslo_config
49e0694
%{python2_sitelib}/*.egg-info
Mark McLoughlin 69c6541
Alan Pevec e7dba62
%files -n python2-%{pypi_name}-doc
Alan Pevec e7dba62
%doc doc/build/html
Alan Pevec e7dba62
%license LICENSE
Mark McLoughlin 69c6541
49e0694
%if 0%{?with_python3}
Alan Pevec e7dba62
%files -n python3-%{pypi_name}
Alan Pevec e7dba62
%doc README.rst
Alan Pevec e7dba62
%license LICENSE
49e0694
%{_bindir}/python3-oslo-config-generator
Alan Pevec 37b5ef1
%{python3_sitelib}/oslo_config
49e0694
%{python3_sitelib}/*.egg-info
49e0694
%endif
49e0694
Mark McLoughlin 69c6541
%changelog
68291ac
* Tue Sep 06 2016 Haikel Guemar <hguemar@fedoraproject.org> 2:3.17.0-1
68291ac
- Update to 3.17.0
Mark McLoughlin d04d838