File python-pbr.spec of Package python-pbr

#
# spec file for package python-pbr
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%if 0%{?rhel} || 0%{?fedora}
%global rdo 1
%endif
Name:           python-pbr
Version:        5.5.0
Release:        0
Summary:        Python Build Reasonableness
License:        Apache-2.0
Group:          Development/Languages/Python
URL:            https://pypi.org/project/pbr
Source0:        https://files.pythonhosted.org/packages/source/p/pbr/pbr-5.5.0.tar.gz
BuildRequires:  openstack-macros
BuildRequires:  python3-setuptools
BuildArch:      noarch

%description
PBR is a library that injects some useful and sensible default behaviors into
your setuptools run. It started off life as the chunks of code that were copied
between all of the OpenStack projects. Around the time that OpenStack hit 18
different projects each with at least 3 active branches, it seems like a good
time to make that code into a proper re-usable library.

%package -n python3-pbr
Summary:        Python Build Reasonableness
Group:          Development/Languages/Python
Requires:       python3-setuptools
%if 0%{?suse_version} > 1500
Obsoletes:      python-pbr < %{version}-%{release}
Obsoletes:      python2-pbr < %{version}-%{release}
%endif

%description -n python3-pbr
PBR is a library that injects some useful and sensible default behaviors into
your setuptools run. It started off life as the chunks of code that were copied
between all of the OpenStack projects. Around the time that OpenStack hit 18
different projects each with at least 3 active branches, it seems like a good
time to make that code into a proper re-usable library.

%package -n python-pbr-doc
Summary:        Documentation for the PBR
Group:          Development/Languages/Python
BuildRequires:  python3-Sphinx
BuildRequires:  python3-sphinxcontrib-apidoc
Provides:       %{python_module pbr-doc = %{version}}

%description -n python-pbr-doc
Documentation for the PBR, a library that injects some useful and sensible default
behaviors into your setuptools run.

%prep
%autosetup -p1 -n pbr-5.5.0
%py_req_cleanup

%build
export SKIP_PIP_INSTALL=1
%py3_build

# generate html docs
PYTHONPATH=$PWD PBR_VERSION=5.5.0 %sphinx_build -b html doc/source doc/build/html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}

%install
%py3_install

%files -n python3-pbr
%{_bindir}/pbr
%doc README.rst
%license LICENSE
%{python3_sitelib}/pbr
%{python3_sitelib}/pbr-*-py?.?.egg-info

%files -n python-pbr-doc
%license LICENSE
%doc doc/build/html

%changelog