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/
#


Name:           python-pbr
Version:        4.2.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-4.2.0.tar.gz
BuildRequires:  openstack-macros
BuildRequires:  python-devel
BuildRequires:  python2-setuptools
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
Requires:       python-setuptools
BuildArch:      noarch
%python_subpackages

%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 python-pbr-doc
Summary:        Documentation for the PBR
Group:          Development/Languages/Python
BuildRequires:  python2-Sphinx
BuildRequires:  python3-Sphinx
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-4.2.0
%py_req_cleanup

%build
export SKIP_PIP_INSTALL=1
%python_build

# generate html docs
%{__python2} setup.py build_sphinx
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/pbr

%post
%python_install_alternative pbr

%postun
%python_uninstall_alternative pbr

%files %{python_files}
%python_alternative %{_bindir}/pbr
%doc README.rst
%license LICENSE
%{python_sitelib}/pbr
%{python_sitelib}/pbr-*-py?.?.egg-info

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

%changelog
openSUSE Build Service is sponsored by