File python-ansible.spec of Package python-ansible

#
# spec file for package python-ansible
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name:           python-ansible
Version:        2.8.2
Release:        0
Summary:        Software automation engine
License:        GPL-3.0-or-later
Group:          Development/Languages/Python
Url:            https://ansible.com/
Source:         https://releases.ansible.com/ansible/ansible-%{version}.tar.gz
Source99:       python-ansible-rpmlintrc
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module cryptography}
BuildRequires:  %{python_module PyYAML}
BuildRequires:  %{python_module Jinja2}
BuildRequires:  %{python_module paramiko}
BuildRequires:  %{python_module passlib}
BuildRequires:  fdupes
Recommends:     sshpass
Recommends:     %{python_module dnspython}
Recommends:     %{python_module dopy}
Recommends:     %{python_module pywinrm}
Recommends:     %{python_module httplib2}
Recommends:     %{python_module keyczar}
Recommends:     %{python_module six}
Requires:       %{python_module setuptools}
Provides:		%{python_module python-ldap}
Conflicts:      ansible

%python_subpackages

%description
Ansible is an IT automation system. It handles
configuration-management, application deployment, cloud provisioning, ad-hoc
task-execution, and multinode orchestration - including trivializing things
like zero downtime rolling updates with load balancers.

%prep
%setup -q -n ansible-%{version}
find . -name .git_keep -delete
find contrib/ -type f -exec chmod 644 {} +

%build
%python_build

%install
%python_install
%if %{with test}
mkdir -p %{buildroot}%{_sysconfdir}/ansible/
cp examples/hosts %{buildroot}%{_sysconfdir}/ansible/
cp examples/ansible.cfg %{buildroot}%{_sysconfdir}/ansible/
mkdir -p %{buildroot}/%{_mandir}/man1/
cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/
mkdir -p %{buildroot}/%{_datadir}/ansible
find %{python_sitelib}/* -type f -executable -exec chmod -x "{}" \;

%fdupes %{buildroot}/%{_prefix}

%check
%pytest

%endif

%files %{python_files}
%license COPYING
%doc *.rst contrib examples changelogs
%python3_only %{_bindir}/ansible
%{_bindir}/ansible-config
%python3_only %{_bindir}/ansible-connection
%{_bindir}/ansible-console
%{_bindir}/ansible-doc
%{_bindir}/ansible-galaxy
%{_bindir}/ansible-inventory
%{_bindir}/ansible-playbook
%{_bindir}/ansible-pull
%{_bindir}/ansible-vault
%{python_sitelib}/*
%python3_only %{_mandir}/man1/ansible.1%{?ext_man}*
%python3_only %{_mandir}/man1/ansible-config.1%{?ext_man}*
%python3_only %{_mandir}/man1/ansible-console.1%{?ext_man}*
%python3_only %{_mandir}/man1/ansible-doc.1%{?ext_man}*
%python3_only %{_mandir}/man1/ansible-galaxy.1%{?ext_man}*
%python3_only %{_mandir}/man1/ansible-inventory.1%{?ext_man}*
%python3_only %{_mandir}/man1/ansible-playbook.1%{?ext_man}*
%python3_only %{_mandir}/man1/ansible-pull.1%{?ext_man}*
%python3_only %{_mandir}/man1/ansible-vault.1%{?ext_man}*
%dir %{_sysconfdir}/ansible
%python3_only %config(noreplace) %{_sysconfdir}/ansible/ansible.cfg
%python3_only %config(noreplace) %{_sysconfdir}/ansible/hosts

%changelog
openSUSE Build Service is sponsored by