- Create system directories that Ansible defines as default locations

in ansible/config/base.yml
- rephrase the summary line 
- Disable shebang munging for specific paths. These files are data files.
  ansible-test munges the shebangs itself.

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ansible?expand=0&rev=156
This commit is contained in:
Lars Vogdt 2019-11-21 16:28:08 +00:00 committed by Git OBS Bridge
parent 8c16a86de5
commit 4d2f438f90
3 changed files with 68 additions and 2 deletions

View File

@ -2,3 +2,9 @@
addFilter("non-executable-script.*/usr/lib/python.*/site-packages/ansible/modules/.*");
# same as utils and runner script
addFilter("non-executable-script.*/usr/lib/python.*/site-packages/ansible/(cli|galaxy|module_utils|plugins/action|runner|utils)/.*.py");
# no really a lib - ignore rpmlint for this package explicitely
addFilter("explicit-lib-dependency python3-passlib");
# standard files, needed for python
addFilter("files-duplicate /usr/lib/python.*/site-packages/ansible/.*");
# same for the ansible-test sub-package
addFilter("files-duplicate /usr/lib/python.*/site-packages/ansible_test/.*");

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Nov 21 16:27:05 UTC 2019 - Lars Vogdt <lars@linux-schulserver.de>
- Create system directories that Ansible defines as default locations
in ansible/config/base.yml
- rephrase the summary line
- Disable shebang munging for specific paths. These files are data files.
ansible-test munges the shebangs itself.
-------------------------------------------------------------------
Tue Nov 19 18:04:50 UTC 2019 - Lars Vogdt <lars@linux-schulserver.de>

View File

@ -30,6 +30,11 @@
%define python python
%endif
# Disable shebang munging for specific paths. These files are data files.
# ansible-test munges the shebangs itself.
%global __brp_mangle_shebangs_exclude_from /usr/lib/python[0-9]+\.[0-9]+/site-packages/ansible_test/_data/.*
%if 0%{?suse_version} && 0%{?suse_version} <= 1110 || 0%{?rhel} == 5
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
@ -38,12 +43,12 @@ BuildArch: noarch
Name: ansible
Version: 2.9.1
Release: 0
Summary: Software automation engine
Summary: SSH-based configuration management, deployment, and task execution system
License: GPL-3.0-or-later
Group: Development/Languages/Python
Url: https://ansible.com/
Source: https://releases.ansible.com/ansible/ansible-%{version}.tar.gz
Source1: ansible-%{version}.tar.gz.sha
Source1: https://releases.ansible.com/ansible/ansible-%{version}.tar.gz.sha
Source99: ansible-rpmlintrc
# SuSE/openSuSE
%if 0%{?suse_version}
@ -187,6 +192,51 @@ mkdir -p %{buildroot}/%{_datadir}/ansible
%fdupes %{buildroot}/%{python_sitelib}/ansible/
%endif
# Create system directories that Ansible defines as default locations in
# ansible/config/base.yml
DATADIR_LOCATIONS='%{_datadir}/ansible/collections
%{_datadir}/ansible/plugins/doc_fragments
%{_datadir}/ansible/plugins/action
%{_datadir}/ansible/plugins/become
%{_datadir}/ansible/plugins/cache
%{_datadir}/ansible/plugins/callback
%{_datadir}/ansible/plugins/cliconf
%{_datadir}/ansible/plugins/connection
%{_datadir}/ansible/plugins/filter
%{_datadir}/ansible/plugins/httpapi
%{_datadir}/ansible/plugins/inventory
%{_datadir}/ansible/plugins/lookup
%{_datadir}/ansible/plugins/modules
%{_datadir}/ansible/plugins/module_utils
%{_datadir}/ansible/plugins/netconf
%{_datadir}/ansible/roles
%{_datadir}/ansible/plugins/strategy
%{_datadir}/ansible/plugins/terminal
%{_datadir}/ansible/plugins/test
%{_datadir}/ansible/plugins/vars'
UPSTREAM_DATADIR_LOCATIONS=$(grep -ri default lib/ansible/config/base.yml| tr ':' '\n' | grep '/usr/share/ansible')
if [ "$SYSTEM_LOCATIONS" != "$UPSTREAM_SYSTEM_LOCATIONS" ] ; then
echo "The upstream Ansible datadir locations have changed. Spec file needs to be updated"
exit 1
fi
mkdir -p %{buildroot}%{_datadir}/ansible/plugins/
for location in $DATADIR_LOCATIONS ; do
mkdir %{buildroot}"$location"
done
mkdir -p %{buildroot}%{_sysconfdir}/ansible/
mkdir -p %{buildroot}%{_sysconfdir}/ansible/roles/
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/
cp -pr docs/docsite/rst .
%files
%defattr(-,root,root,-)
%if 0%{?suse_version} >= 1200
@ -224,6 +274,7 @@ mkdir -p %{buildroot}/%{_datadir}/ansible
%dir %{_sysconfdir}/ansible
%config(noreplace) %{_sysconfdir}/ansible/ansible.cfg
%config(noreplace) %{_sysconfdir}/ansible/hosts
%{_datadir}/ansible/
%files -n ansible-test
%{_bindir}/ansible-test