950d7af
# Macros for py2/py3 compatibility
950d7af
%if 0%{?fedora} || 0%{?rhel} > 7
950d7af
%global pyver %{python3_pkgversion}
950d7af
%else
950d7af
%global pyver 2
950d7af
%endif
950d7af
%global pyver_bin python%{pyver}
9d7f52c
%global pyver_sitelib %{expand:%{python%{pyver}_sitelib}}
9d7f52c
%global pyver_install %{expand:%{py%{pyver}_install}}
9d7f52c
%global pyver_build %{expand:%{py%{pyver}_build}}
950d7af
# End of macros for py2/py3 compatibility
Mark McLoughlin a2d74aa
%global sname oslo.config
Alan Pevec e7dba62
%global pypi_name oslo-config
e7bd0d9
%global with_doc 1
950d7af
# Needed for train bootstrap
e7bd0d9
%global repo_bootstrap 1
e7bd0d9
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
950d7af
Version:    6.11.1
950d7af
Release:    2%{?dist}
Mark McLoughlin 69c6541
Summary:    OpenStack common configuration library
Mark McLoughlin 69c6541
e7bd0d9
Group:      Development/Languages
Mark McLoughlin 69c6541
License:    ASL 2.0
4ca7d75
URL:        https://launchpad.net/%{sname}
4ca7d75
Source0:    https://tarballs.openstack.org/%{sname}/%{sname}-%{upstream_version}.tar.gz
Alan Pevec 2e821d2
Alan Pevec 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
950d7af
%package -n python%{pyver}-%{pypi_name}
950d7af
Summary:    OpenStack common configuration library
950d7af
%{?python_provide:%python_provide python%{pyver}-%{pypi_name}}
950d7af
%if %{pyver} == 3
950d7af
Obsoletes: python2-%{pypi_name} < %{version}-%{release}
e7bd0d9
%endif
Mark McLoughlin 69c6541
950d7af
Requires:   python%{pyver}-oslo-i18n >= 3.15.3
950d7af
Requires:   python%{pyver}-rfc3986 >= 1.2.0
950d7af
Requires:   python%{pyver}-pbr
950d7af
Requires:   python%{pyver}-requests >= 2.18.0
950d7af
Requires:   python%{pyver}-six >= 1.10.0
950d7af
Requires:   python%{pyver}-stevedore >= 1.20.0
950d7af
Requires:   python%{pyver}-debtcollector >= 1.2.0
950d7af
Requires:   python%{pyver}-netaddr >= 0.7.18
950d7af
%if %{pyver} == 2
950d7af
Requires:   python-enum34
950d7af
Requires:   PyYAML >= 3.10
950d7af
%else
950d7af
Requires:   python%{pyver}-PyYAML >= 3.10
950d7af
%endif
950d7af
950d7af
BuildRequires: python%{pyver}-devel
950d7af
BuildRequires: python%{pyver}-setuptools
950d7af
BuildRequires: python%{pyver}-oslo-i18n
950d7af
BuildRequires: python%{pyver}-rfc3986
950d7af
BuildRequires: python%{pyver}-pbr
66d9fd1
BuildRequires: git
66d9fd1
# Required for tests
950d7af
BuildRequires: python%{pyver}-testscenarios
950d7af
BuildRequires: python%{pyver}-stestr
950d7af
BuildRequires: python%{pyver}-testtools
950d7af
BuildRequires: python%{pyver}-oslotest
950d7af
BuildRequires: python%{pyver}-requests-mock
950d7af
BuildRequires: python%{pyver}-netaddr
950d7af
BuildRequires: python%{pyver}-stevedore
950d7af
%if %{pyver} == 2
950d7af
BuildRequires: python-enum34
950d7af
BuildRequires: PyYAML
950d7af
%else
950d7af
BuildRequires: python%{pyver}-PyYAML
950d7af
%endif
e7bd0d9
e7bd0d9
%if 0%{?repo_bootstrap} == 0
950d7af
BuildRequires: python%{pyver}-oslo-log
e7bd0d9
%endif
49e0694
950d7af
%description -n python%{pyver}-%{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
950d7af
%if 0%{?with_doc}
950d7af
%package -n python-%{pypi_name}-doc
950d7af
Summary:    Documentation for OpenStack common configuration library
950d7af
950d7af
BuildRequires: python%{pyver}-sphinx
950d7af
BuildRequires: python%{pyver}-fixtures
950d7af
BuildRequires: python%{pyver}-openstackdocstheme
950d7af
BuildRequires: python%{pyver}-oslotest >= 1.10.0
950d7af
BuildRequires: python%{pyver}-stevedore
950d7af
BuildRequires: python%{pyver}-sphinxcontrib-apidoc
950d7af
950d7af
%description -n python-%{pypi_name}-doc
950d7af
Documentation for the oslo-config library.
950d7af
%endif
950d7af
Mark McLoughlin 69c6541
%prep
66d9fd1
%autosetup -n %{sname}-%{upstream_version} -S git
e7bd0d9
# Remove shebang from non executable file, it's used by the oslo-config-validator binary.
e7bd0d9
sed -i '/\/usr\/bin\/env/d' oslo_config/validator.py
Mark McLoughlin 69c6541
# let RPM handle deps
Alan Pevec e7dba62
rm -rf {test-,}requirements.txt
Mark McLoughlin 69c6541
e7bd0d9
# Remove tests requiring sphinx if sphinx is not available
e7bd0d9
%if 0%{?with_doc} == 0
e7bd0d9
rm oslo_config/tests/test_sphinxext.py
e7bd0d9
rm oslo_config/tests/test_sphinxconfiggen.py
e7bd0d9
%endif
Mark McLoughlin 69c6541
e7bd0d9
%build
950d7af
%{pyver_build}
Mark McLoughlin 69c6541
e7bd0d9
%if 0%{?with_doc}
e7bd0d9
export PYTHONPATH=.
950d7af
sphinx-build-%{pyver} -b html doc/source doc/build/html
950d7af
# remove the sphinx-build-%{pyver} leftovers
4ca7d75
rm -rf doc/build/html/.{doctrees,buildinfo}
e7bd0d9
%endif
e7bd0d9
e7bd0d9
%install
950d7af
%{pyver_install}
e7bd0d9
pushd %{buildroot}/%{_bindir}
e7bd0d9
for i in generator validator
e7bd0d9
do
950d7af
ln -s oslo-config-$i oslo-config-$i-%{pyver}
e7bd0d9
done
e7bd0d9
popd
Mark McLoughlin 69c6541
Mark McLoughlin 69c6541
%check
e7bd0d9
%if 0%{?repo_bootstrap} == 0
950d7af
PYTHON=%{pyver_bin} stestr-%{pyver} run
e7bd0d9
%endif
Mark McLoughlin 69c6541
950d7af
%files -n python%{pyver}-%{pypi_name}
950d7af
%doc README.rst
950d7af
%license LICENSE
950d7af
%{_bindir}/oslo-config-generator
950d7af
%{_bindir}/oslo-config-generator-%{pyver}
950d7af
%{_bindir}/oslo-config-validator
950d7af
%{_bindir}/oslo-config-validator-%{pyver}
950d7af
%{pyver_sitelib}/oslo_config
950d7af
%{pyver_sitelib}/*.egg-info
950d7af
e7bd0d9
%if 0%{?with_doc}
300cf4f
%files -n python-%{pypi_name}-doc
4ca7d75
%doc doc/build/html
Alan Pevec e7dba62
%license LICENSE
e7bd0d9
%endif
Mark McLoughlin 69c6541
Mark McLoughlin 69c6541
%changelog
950d7af
* Wed Nov 06 2019 Alfredo Moralejo <amoralej@redhat.com> 2:6.11.1-2
950d7af
- Update to upstream version 6.11.1
950d7af
d1fb612
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2:6.8.1-5
d1fb612
- Rebuilt for Python 3.8.0rc1 (#1748018)
d1fb612
8986a67
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2:6.8.1-4
8986a67
- Rebuilt for Python 3.8
8986a67
7ad411f
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2:6.8.1-3
7ad411f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
7ad411f
300cf4f
* Thu May 16 2019 Miro Hrončok <mhroncok@redhat.com> - 2:6.8.1-2
300cf4f
- Rename the documentation package back to python-oslo-config-doc
300cf4f
e7bd0d9
* Fri Mar 08 2019 RDO <dev@lists.rdoproject.org> 2:6.8.1-1
e7bd0d9
- Update to 6.8.1
Mark McLoughlin d04d838