File python-validations-libs.spec of Package python-validations-libs

#
# spec file for package python-validations-libs
#
# Copyright (c) 2021 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-validations-libs
Version:        1.0.4
Release:        0
Epoch:          0
Summary:        A collection of python libraries for the Validation Framework
License:        Apache-2.0
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/validations-libs
Source0:        https://files.pythonhosted.org/packages/source/v/validations-libs/validations-libs-1.0.4.tar.gz
BuildRequires:  ansible
BuildRequires:  ansible-runner
BuildRequires:  openstack-macros
BuildRequires:  python3-PrettyTable
BuildRequires:  python3-fixtures
BuildRequires:  python3-keystoneclient
BuildRequires:  python3-os-client-config
BuildRequires:  python3-oslo.utils
BuildRequires:  python3-pbr
BuildRequires:  python3-pyOpenSSL
BuildRequires:  python3-stestr
BuildRequires:  python3-testscenarios
BuildRequires:  python3-testtools
BuildRequires:  python3-warlock
BuildArch:      noarch

%description
This is a collection of python libraries for the Validation Framework

#%package -n python-validations-libs

%package -n python3-validations-libs
Summary:        A collection of python libraries for the Validation Framework
Requires:       ansible
Requires:       ansible-role-validations-libs
Requires:       ansible-runner
Requires:       python3-PrettyTable
Requires:       python3-keystoneauth1
Requires:       python3-oslo.i18n
Requires:       python3-oslo.utils
Requires:       python3-pbr
Requires:       python3-pyOpenSSL
Requires:       python3-requests
Requires:       python3-six
Requires:       python3-warlock
Requires:       python3-wrapt

%description -n python3-validations-libs
This is a collection of python libraries for the Validation Framework.

%package -n python-validations-libs-doc
Summary:        Documentation for Openstack python libraries for the Validation Framework
Group:          Documentation/HTML
BuildRequires:  python3-Sphinx
BuildRequires:  python3-openstackdocstheme
BuildRequires:  python3-reno
BuildRequires:  python3-sphinxcontrib-apidoc

%description -n python-validations-libs-doc
This is a collection of python libraries for the Validation Framework.
This package contains auto-generated documentation.

%package -n ansible-role-validations-libs
Summary:        Ansible role for the Validation Framework.

%description -n ansible-role-validations-libs
Ansible role for the Validation Framework.

%prep
%autosetup -p1 -n validations-libs-1.0.4
%py_req_cleanup

%build
%py3_build

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

%install
%py3_install

#man pages
install -p -D -m 644 doc/build/man/validations-libs.1 \
                     %{buildroot}%{_mandir}/man1/validations-libs.1
# Temporary install of ansible roles
# will be performed on the next release directly through setup.py
# To be removed
install -p -D -m 755 -d %{buildroot}%{_datadir}/ansible/roles/validations/defaults

install -p -D -m 644 roles/validations/defaults/main.yaml \
                     %{buildroot}%{_datadir}/ansible/roles/validations/defaults/

install -p -D -m 755 -d %{buildroot}%{_datadir}/ansible/roles/validations/tasks
install -p -D -m 644 roles/validations/tasks/main.yaml  \
                     roles/validations/tasks/validations.yaml \
                     %{buildroot}%{_datadir}/ansible/roles/validations/tasks/

install -p -D -m 755 -d %{buildroot}%{_datadir}/ansible/roles/fetch-validations/defaults
install -p -D -m 644 roles/fetch-validations/defaults/main.yaml \
                     %{buildroot}%{_datadir}/ansible/roles/fetch-validations/defaults/

%check
python3 -m stestr.cli run

%files -n python3-validations-libs
%license LICENSE
%doc README.rst ChangeLog
%{_mandir}/man1/validations-libs.1*
%{python3_sitelib}/validations_libs
%{python3_sitelib}/*.egg-info

%files -n python-validations-libs-doc
%license LICENSE
%doc doc/build/html

%files -n ansible-role-validations-libs
%license LICENSE
%{_datadir}/ansible/roles/fetch-validations
%{_datadir}/ansible/roles/validations

%changelog
openSUSE Build Service is sponsored by