File python-os-apply-config.spec of Package python-os-apply-config

#
# spec file for package python-os-apply-config
#
# 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/
#


%global sname os-apply-config
%bcond_with test
%bcond_with docs
Name:           python-os-apply-config
Version:        9.1.2
Release:        0
Summary:        OpenStack os-apply-config Configuration Library
License:        Apache-2.0
Group:          Development/Languages/Python
URL:            https://launchpad.net/%{sname}
Source0:        https://files.pythonhosted.org/packages/source/o/%{sname}/%{sname}-%{version}.tar.gz
BuildRequires:  openstack-macros
BuildRequires:  python-devel
BuildRequires:  python-pbr
BuildRequires:  python-setuptools
Requires:       python-PyYAML
Requires:       python-anyjson
Requires:       python-pbr
Requires:       python-pystache
Requires:       python-setuptools
Requires:       python-six
BuildArch:      noarch
%if %{with test}
BuildRequires:  python-fixtures
BuildRequires:  python-mock
BuildRequires:  python-python-subunit
BuildRequires:  python-stestr
BuildRequires:  python-testscenarios
BuildRequires:  python-testtools
%endif

%description
os-apply-config is a apply configuration from cloud metadata

%package doc
Summary:        Documentation for OpenStack Os-apply-config configuration library
Group:          Development/Languages/Python
BuildRequires:  python-Sphinx
BuildRequires:  python-oslosphinx
BuildRequires:  python-reno

%description doc
Documentation for the os-apply-config library.

%prep
%autosetup -n %{sname}-%{version}
%py_req_cleanup

%build
%{py2_build}

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

%install
%{py2_install}
install -d -m 755 %{buildroot}%{_libexecdir}/os-apply-config/templates

%if %{with test}
%check
%{__python2} -m stestr.cli run
%endif

%files
%license LICENSE
%doc README.rst
%{_bindir}/os-apply-config
%{_bindir}/os-config-applier
%{python2_sitelib}/os_apply_config
%{python2_sitelib}/*.egg-info
%dir %{_libexecdir}/os-apply-config
%dir %{_libexecdir}/os-apply-config/templates

%if %{with docs}
%files doc
%doc doc/build/html
%license LICENSE
%endif

%changelog
openSUSE Build Service is sponsored by