%bcond_with dotests %global __tar /opt/freeware/bin/tar %global py_major 3.9 %global py_minor 16 %global python_major python%{py_major} %global python3_sitearch %(%{python_major} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(0))") Name: ansible Summary: Curated set of Ansible collections included in addition to ansible-core Version: 7.2.0 Release: 1 License: GPLv3+ Group: Development/Libraries Source0: https://releases.ansible.com/ansible/%{name}-%{version}.tar.gz Url: https://ansible.com BuildArch: noarch Prefix:/opt/freeware BuildRequires: %{python_major}-devel >= %{py_major}.%{py_minor} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major} >= %{py_major}.%{py_minor} Requires: ansible-core >= 2.14.2 %description Ansible is a radically simple model-driven configuration management, multi-node deployment, and remote task execution system. Ansible works over SSH and does not require any software or daemons to be installed on remote nodes. Extension modules can be written in any language and are transferred to managed machines automatically. This package provides a curated set of Ansible collections included in addition to ansible-core. %prep %autosetup -p1 -n %{name}-%{version} # Remove unnecessary files and directories included in the Ansible collection release tarballs # Tracked upstream in part by: https://github.com/ansible-community/community-topics/issues/29 echo "[START] Delete unnecessary files and directories" # Collection tarballs contain a lot of hidden files and directories hidden_pattern=".*\.(DS_Store|all-contributorsrc|ansible-lint|azure-pipelines|circleci|codeclimate.yml|flake8|galaxy_install_info|gitattributes|github|gitignore|gitkeep|gitlab-ci.yml|idea|keep|mypy_cache|nojekyll|orig|plugin-cache.yaml|pre-commit-config.yaml|project|pydevproject|pytest_cache|pytest_cache|readthedocs.yml|settings|swp|travis.yml|vscode|yamllint|yamllint.yaml|zuul.d|zuul.yaml|rstcheck.cfg|placeholder)$" find ansible_collections -depth -regextype posix-egrep -regex "${hidden_pattern}" -print -exec rm -r {} \; # Not needed for runtime rm -rv ansible_collections/cisco/meraki/scripts rm -rv ansible_collections/community/grafana/hacking rm -rv ansible_collections/community/okd/ci/ rm -rv ansible_collections/community/vmware/tools rm -rv ansible_collections/cyberark/conjur/ci/ rm -rv ansible_collections/cyberark/conjur/dev/ rm -rv ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests/ rm -rv ansible_collections/netbox/netbox/hacking/ rm -rv ansible_collections/ovirt/ovirt/automation/ rm -rv ansible_collections/sensu/sensu_go/docker/ rm -v ansible_collections/community/dns/update-psl.sh rm -v ansible_collections/cyberark/conjur/Jenkinsfile rm -v ansible_collections/dellemc/enterprise_sonic/rebuild.sh rm -v ansible_collections/ovirt/ovirt/build.sh # rpmlint W: pem-certificate find ansible_collections/cyberark/conjur -type f -name "*.pem" -print -delete # rpmlint E: zero-length find -type f -name "*requirements.txt" -size 0 -print -delete rm -v ansible_collections/community/zabbix/roles/zabbix_agent/files/win_sample/doSomething.ps1 rm -v ansible_collections/community/docker/meta/ee-bindep.txt rm -vr ansible_collections/ibm/spectrum_virtualize/roles/place_holder echo "[END] Delete unnecessary files and directories" # Remove shebangs instead of hardocding to %%__python3 to avoid unexpected issues # from https://github.com/ansible/ansible/commit/9142be2f6cabbe6597c9254c5bb9186d17036d55. # Upstream, ansible-core has also removed shebangs from its modules. # # XXX: Print out the files before they're replaced #find -type f ! -executable -name '*.py' | tee non_exec # xargs is noticably faster than find -exec, because it spawns one sed process # instead of ~13 thousand! #xargs -a non_exec -d'\n' sed -i -e '1{\@^#!.*@d}' %build export OBJECT_MODE=64 %{python_major} setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %{python_major} setup.py install --skip-build --root ${RPM_BUILD_ROOT} ( cd ${RPM_BUILD_ROOT} grep -rl "\/usr\/bin\/python3" . | xargs /opt/freeware/bin/sed -i 's|#!/usr/bin/python3|#!/opt/freeware/bin/python3.9|g' ) %check %if %{with dotests} #export PYTHON=%{python_major} #%{python_major} -m venv python_venv #. ./python_venv/bin/activate #pip3.9 install six==1.13.0 #pip3.9 install pyparsing==2.4.4 #pip3.9 install packaging==19.2 #make tests-py3 #deactivate %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %license COPYING %doc README.rst PKG-INFO CHANGELOG-v7.rst %{_bindir}/* %{python3_sitearch}/* %changelog * Tue Jul 11 2023 Reshma V Kumar - 7.2.0-1 - Update to 7.2.0 * Mon Apr 10 2023 Reshma V Kumar - 2.9.25-2 - Rebuild with python3.9 * Tue Aug 24 2021 Rishita Saha - 2.9.25-1 - Update to 2.9.25 to fix CVE-2021-20191 and CVE-2021-20178 * Fri Oct 06 2020 Rishita Saha - 2.9.14-1 - Update to 2.9.14 to fix CVE-2020-14365 * Fri Sep 11 2020 Rishita Saha - 2.9.10-1 - Update to 2.9.10 to fix CVE-2020-10744 * Fri May 08 2020 Rishita Saha - 2.9.7-1 - Update to 2.9.7 to fix CVE-2020-1737 * Fri Feb 07 2020 Ayappan P - 2.9.4-1 - Update to 2.9.4 * Sun Oct 28 2018 Ravi Hirekurabar - 2.7.0-1 - Updated to 2.7.0 - Created softlink conf files in /etc/ansible * Tue Sep 11 2018 Ravi Hirekurabar - 2.6.2-1 - Updated to 2.6.2 * Fri Mar 02 2018 Ravi Hirekurabar - 2.4.2.0-1 - Updated to 2.4.2.0-1 * Thu May 11 2017 Ravi Hirekurabar - 2.2.2.0-1 - first version for AIX V6.1 and higher