From c0762ab0921c54d16cc0e78598e8c4f9e940bb93 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 2 Feb 2023 15:54:28 -0600 Subject: [PATCH 01/18] Sync with epel8 --- ansible.spec | 239 +++++++++++++++++++++------------------------------ 1 file changed, 98 insertions(+), 141 deletions(-) diff --git a/ansible.spec b/ansible.spec index 5dc7a3e..a6c1e1c 100644 --- a/ansible.spec +++ b/ansible.spec @@ -3,22 +3,18 @@ %bcond_with tests %global ansible_licensedir %{_defaultlicensedir}/ansible %global ansible_docdir %{_defaultdocdir}/ansible +%global min_ansible_core 2.13.3 -# This should be updated after each release to match upstream's metadata -# We manually specify this in order to workaround RHEL 8's deficient -# python-rpm-generators and lack of dynamic BR support. -# https://github.com/ansible-community/community-topics/issues/84 -%global ansible_core_version 2.13.3 -%global ansible_core_next_version 2.14 -%global ansible_core_requires (ansible-core >= %{ansible_core_version} with ansible-core < %{ansible_core_next_version}) +# Roles' files and templates should not be mangled. +# These files are installed on remote systems which may or may not have the +# same filesystem layout as Fedora. +%global __brp_mangle_shebangs_exclude_from ^%{python3_sitelib}/ansible_collections/[^/]+/[^/]+/roles/[^/]+/(files|templates)/.*$ +%global __requires_exclude_from %{?__requires_exclude_from:%__requires_exclude_from|}%{__brp_mangle_shebangs_exclude_from} %if 0%{?rhel} == 8 -# RHEL 8's ansible-core package is built using Python 3.8, which is not the default version. +# RHEL 8's ansible-core package is built using Python 3.9, which is not the default version. %define python3_pkgversion 39 BuildRequires: python%{python3_pkgversion}-rpm-macros - -# RHEL 8's RPM Python dependency generator ignores the version constraints, so we manually specify the dependency. -Requires: %{ansible_core_requires} %endif %global uversion %(tr -d '~' <<< %{version}) @@ -26,7 +22,7 @@ Requires: %{ansible_core_requires} Name: ansible Summary: Curated set of Ansible collections included in addition to ansible-core Version: 6.3.0 -Release: 1%{?dist} +Release: 2%{?dist} # In addition to GPL-3.0-or-later, the following licenses apply. # License text that solely exists in file headers were not considered. @@ -55,7 +51,7 @@ BuildRequires: findutils BuildRequires: hardlink BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools -BuildRequires: %{ansible_core_requires} +BuildRequires: %{py3_dist ansible-core} >= %{min_ansible_core} %if %{with tests} # TODO build-requires @@ -78,14 +74,29 @@ to ansible-core. %prep %autosetup -p1 -n %{name}-%{uversion} +%if %{defined rhel} +# Relax ansible-core dependency to avoid FTI bugs +# +# This is necessary, because the EPEL ansible maintainers don't have control +# over ansible-core in RHEL, and it's difficult to time updates across +# repositories. I have tried to stick to upstream's version constraints, but +# that's apparently not working too well. This change gives us a grace period +# to properly release and test new ansible major versions after RHEL rebases +# ansible-core. The lower version constraints can stay in place. + +sed -i "s|'ansible-core ~= 2.13\..*',$|'ansible-core >= %{min_ansible_core}',|" setup.py +# Verify +set -o pipefail +grep -B1 "'ansible-core >= %{min_ansible_core}'," setup.py | grep -F 'install_requires=[' +%endif + + # Fix wrong-script-end-of-line-encoding in azure.azcollection find ansible_collections/azure/azcollection -type f -print -exec dos2unix -k '{}' \; find ansible_collections/community/mongodb/roles/*/{files,templates} -type f ! -executable -name '*.sh*' \ -print -exec chmod a+x '{}' \; -sed -i -e '1{\@^#!.*@d}' ansible_collections/cyberark/conjur/Jenkinsfile - # 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" @@ -94,13 +105,23 @@ echo "[START] Delete unnecessary 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 and has -# /Users/kbreit/Documents/Programming/ansible_collections/cisco/meraki/venv/bin/python shebang -rm -r ansible_collections/cisco/meraki/scripts - # Not needed for runtime -rm -r ansible_collections/netbox/netbox/hacking -rm -r ansible_collections/cyberark/conjur/roles/conjur_host_identity/tests +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/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 -vr ansible_collections/ibm/spectrum_virtualize/roles/place_holder +rm -v ansible_collections/sensu/sensu_go/tools/windows-versions.py +rm -v ansible_collections/community/dns/update-docs-fragments.py +rm -v ansible_collections/community/dns/update-psl.sh +rm -v ansible_collections/community/routeros/update-docs.py +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 @@ -112,10 +133,22 @@ rm -f ansible_collections/community/docker/meta/ee-bindep.txt echo "[END] Delete unnecessary files and directories" +### +# Fix various shebang related issues to appease brp-managle-shebangs +### + +chmod a-x ansible_collections/community/digitalocean/scripts/inventory/digital_ocean.py +chmod a-x ansible_collections/ngine_io/cloudstack/scripts/inventory/cloudstack.py +# # 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. -find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' \; +# +# 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}' # This ensures that %%ansible_core_requires is set properly, when %%pyproject_buildrequires is defined. # It also ensures that dependencies remain consistent. @@ -125,14 +158,13 @@ find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{ %endif %build -# disable the python -s shbang flag as we want to be able to find non system modules -%global py3_shbang_opts %{nil} -%py3_shebang_fix ansible_collections %py3_build %install %py3_install +%global filelist %{_builddir}/%{buildsubdir}/files.list + # Install docs and licenses ( mkdir -p "%{buildroot}%{ansible_docdir}" "%{buildroot}%{ansible_licensedir}" @@ -140,18 +172,17 @@ find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{ # This finds the license file for each collection, moves it to # `%%{ansible_licensedir}/collection_namespace/collection_name`, and then adds # `%%license /path/to/license` to the %%files list. - # `-printf '%%P\n'` removes the trailing `./`. for f in $(find . -mindepth 3 -type f \( -iname '*LICENSE*' -o -iname '*COPYING*' \) -not -name '*.py' -not -name '*.pyc' -printf '%%P\n' | grep -v '\.license$'); do dirname="$(dirname %{buildroot}%{ansible_licensedir}/${f})" mkdir -p "${dirname}" mv "${f}" "${dirname}" - tee -a %{_builddir}/files.list << EOF + tee -a %{filelist} << EOF %%license %%{ansible_licensedir}/${f} EOF done for f in $(find -mindepth 3 -iname 'LICENSES' -type d); do cp -rfp --parents ${f} %{buildroot}%{ansible_licensedir} - echo "%%license %%{ansible_licensedir}/${f}" >> %{_builddir}/files.list + echo "%%license %%{ansible_licensedir}/${f}" >> %{filelist} done # This does the same thing, but for READMEs. @@ -159,7 +190,7 @@ EOF dirname="$(dirname %{buildroot}%{ansible_docdir}/${f})" mkdir -p "${dirname}" mv "${f}" "${dirname}" - tee -a %{_builddir}/files.list << EOF + tee -a %{filelist} << EOF %%doc %%{ansible_docdir}/${f} EOF done @@ -172,7 +203,7 @@ hardlink -v %{buildroot}%{ansible_licensedir} # TODO: Run tests %endif -%files -f %{_builddir}/files.list +%files -f files.list %license COPYING %doc README.rst PKG-INFO porting_guide_6.rst CHANGELOG-v6.rst %{_bindir}/ansible-community @@ -185,55 +216,24 @@ hardlink -v %{buildroot}%{ansible_licensedir} %{python3_sitelib}/*egg-info %changelog -* Tue Aug 23 2022 Maxwell G - 6.3.0-1 +* Fri Nov 18 2022 Maxwell G - 6.3.0-2 +- Relax version constraint +- Package cleanup + +* Tue Nov 08 2022 Maxwell G - 6.3.0-1 - Update to 6.3.0. - -* Tue Aug 02 2022 Maxwell G - 6.2.0-1 -- Update to 6.2.0. - -* Wed Jul 20 2022 Fedora Release Engineering - 6.1.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Fri Jul 15 2022 Maxwell G - 6.1.0-2 -- Fix FTI (rhbz#2107532). - -* Thu Jul 14 2022 Maxwell G - 6.1.0-1 -- Update to 6.1.0. - -* Wed Jun 22 2022 Maxwell G - 6.0.0-1 -- Update to 6.0.0. - -* Wed Jun 22 2022 Maxwell G - 6.0.0~rc1-1 -- Update to 6.0.0~rc1. - Stop duplicating docs and licenses. - Don't remove tests in %%prep that are now handled by setup.py. - Hardlink duplicated files and fix rpmlint errors +- Fixes: rhbz#2141351 -* Thu Jun 16 2022 Python Maint - 5.9.0-2 -- Rebuilt for Python 3.11 +* Thu Jul 21 2022 Maxwell G - 5.4.0-3 +- Rebuild to fix bug in epel-rpm-macros' Python dependency generator -* Wed Jun 08 2022 Maxwell G - 5.9.0-1 -- Update to 5.9.0. - -* Thu May 19 2022 Maxwell G - 5.8.0-1 -- Update to 5.8.0. -- Remove fortinet.fortios patch. - -* Wed Apr 27 2022 Maxwell G - 5.7.0-1 -- Update to 5.7.0. -- Fix SyntaxError in fortinet.fortios collection. -- Fix rpmlint errors - -* Mon Apr 25 2022 Maxwell G - 5.6.0-2 +* Mon Apr 25 2022 Maxwell G - 5.4.0-2 - Ensure correct version of ansible-core is available at buildtime. - Implement support for epel8. -* Wed Apr 06 2022 Kevin Fenzi - 5.6.0-1 -- Update to 5.6.0. - -* Tue Mar 15 2022 David Moreau-Simard - 5.5.0-1 -- Update to latest upstream release - * Tue Feb 22 2022 David Moreau-Simard - 5.4.0-1 - Update to latest upstream release @@ -256,105 +256,68 @@ hardlink -v %{buildroot}%{ansible_licensedir} - Removed packaging macros (soon included in ansible-packaging, see rhbz#2038591) - Removed provides/obsoletes on ansible-python3 -* Mon Nov 01 2021 Kevin Fenzi - 2.9.27-2 -- Add patch for oracle linux Fixes rhbz#2018369 - -* Mon Oct 11 2021 Kevin Fenzi - 2.9.27-1 +* Tue Oct 26 2021 Kevin Fenzi - 2.9.27-1 - Update to 2.9.27. Fixes rhbz#2012918 -* Tue Sep 14 2021 Kevin Fenzi - 2.9.26-1 -- Update to 2.9.26. Fixes rhbz#2002394 - * Fri Aug 20 2021 Kevin Fenzi - 2.9.25-1 - Update to 2.9.25. Fixes rhbz#1994108 * Sun Jul 25 2021 Kevin Fenzi - 2.9.24-1 - Update to 2.9.24. Fixes rhbz#1983837 -* Wed Jul 21 2021 Fedora Release Engineering - 2.9.23-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Sat Jul 10 2021 Kevin Fenzi - 2.9.23-2 -- Fix FTBFS with sphinx 4.x. Fixes rhbz#1977303 - * Tue Jun 22 2021 Kevin Fenzi - 2.9.23-1 - Update to 2.9.23. Fixes rhbz#1974592 - Add patch for Rocky Linux. Fixes rhbz#1968728 -* Fri Jun 04 2021 Python Maint - 2.9.22-2 -- Rebuilt for Python 3.10 - * Mon May 24 2021 Kevin Fenzi - 2.9.22-1 -- Update to 2.9.22. Fixes rhbz#1964173 +- Update to 2.9.22. -* Mon May 03 2021 Kevin Fenzi - 2.9.21-1 -- Update to 2.9.21. Fixes rhbz#1956584 +* Tue May 04 2021 Kevin Fenzi - 2.9.21-1 +- Update to 2.9.21. * Sat Apr 24 2021 Kevin Fenzi - 2.9.20-1 - Update to 2.9.20. +- Split out ansible-test to a subpackage. + +* Fri Mar 12 2021 Orion Poplawski - 2.9.18-2 +- Add rpm macros and generators for collections * Sat Feb 20 2021 Kevin Fenzi - 2.9.18-1 - Update to 2.9.18. - Fixes: CVE-2021-20228 CVE-2021-20178 CVE-2021-20180 CVE-2021-20191 -* Tue Jan 26 2021 Fedora Release Engineering - 2.9.17-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Sun Jan 24 2021 Kevin Fenzi - 2.9.17-2 +* Sun Jan 24 2021 Kevin Fenzi - 2.9.17-1 - Update to 2.9.17. -* Sat Jan 16 2021 Kevin Fenzi - 2.9.16-2 -- Conflict with ansible-base 2.10.x for now. -- Ajust generator so collections will install/work with either ansible or ansible-base. - -* Tue Dec 15 2020 Kevin Fenzi - 2.9.16-1 -- Update to 2.9.16. +* Thu Dec 17 2020 Kevin Fenzi - 2.9.16-1 +- Update to 2.9.16 * Tue Nov 03 2020 Kevin Fenzi - 2.9.15-1 -- Update to 2.9.15. +- Update to 2.9.15 -* Tue Oct 06 2020 Kevin Fenzi - 2.9.14-1 -- Update to 2.9.14. +* Wed Oct 07 2020 Kevin Fenzi - 2.9.14-1 +- Update to 2.9.14 -* Tue Sep 01 2020 Kevin Fenzi - 2.9.13-1 -- Update to 2.9.13. Fixes CVE-2020-14365 +* Thu Sep 03 2020 Kevin Fenzi - 2.9.13-1 +- Update to 2.9.13 * Tue Aug 11 2020 Kevin Fenzi - 2.9.12-1 -- Update to 2.9.12. - -* Sun Aug 09 2020 Igor Raits - 2.9.11-4 -- Add support for generating '>=' dependencies in RPM generator - -* Sat Aug 08 2020 Igor Raits - 2.9.11-3 -- Add very basic support for generating dependencies in RPM generator - -* Mon Jul 27 2020 Fedora Release Engineering - 2.9.11-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild +- Update to 2.9.12 * Tue Jul 21 2020 Kevin Fenzi - 2.9.11-1 -- Update to 2.9.11. +- Update to 2.9.11 + +* Sat Jun 20 2020 Kevin Fenzi - 2.9.10-2 +- Add patch for rabbitmq bug: https://patch-diff.githubusercontent.com/raw/ansible/ansible/pull/50381.patch * Thu Jun 18 2020 Kevin Fenzi - 2.9.10-1 - Update to 2.9.10. -* Fri May 29 2020 Charalampos Stratakis - 2.9.9-3 -- Fix Python 3.9 compatibility (#1808674) -- Pin Pytest to version 4 for now - -* Tue May 26 2020 Miro HronĨok - 2.9.9-2 -- Rebuilt for Python 3.9 - * Tue May 12 2020 Kevin Fenzi - 2.9.9-1 - Update to 2.9.9. Fixes bug #1834582 - Fixes gathering facts on f32+ bug #1832625 -* Sun Apr 19 2020 Igor Raits - 2.9.7-3 -- Own /usr/share/ansible/collections/ansible_collections - -* Sun Apr 19 2020 Igor Raits - 2.9.7-2 -- Add macros for packaging Ansible collections - -* Fri Apr 17 2020 Kevin Fenzi - 2.9.7-1 +* Sat Apr 18 2020 Kevin Fenzi - 2.9.7-1 - Update to 2.9.7. - fixes CVE-2020-1733 CVE-2020-1735 CVE-2020-1740 CVE-2020-1746 CVE-2020-1753 CVE-2020-10684 CVE-2020-10685 CVE-2020-10691 - Drop the -s from the shebang to allow ansible to use locally installed modules. @@ -364,13 +327,7 @@ hardlink -v %{buildroot}%{ansible_licensedir} - fixes for CVE-2020-1737, CVE-2020-1739 * Thu Feb 13 2020 Kevin Fenzi - 2.9.5-1 -- Update to 2.9.5. Fixes bug #1802725 - -* Tue Jan 28 2020 Fedora Release Engineering - 2.9.4-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Tue Jan 21 2020 Kevin Fenzi - 2.9.4-1 -- Update to 2.9.4 with one bugfix. +- Update to 2.9.5. * Thu Jan 16 2020 Kevin Fenzi - 2.9.3-1 - Update to 2.9.3. @@ -425,7 +382,7 @@ hardlink -v %{buildroot}%{ansible_licensedir} - Fixes for various releases build/test issues. * Fri May 17 2019 Kevin Fenzi - 2.8.0-1 -- Update to 2.8.0 final. +- Update to 2.8.0 final. - Add datadirs for other packages to land ansible files in. * Fri May 10 2019 Kevin Fenzi - 2.8.0-0.4rc3 @@ -571,7 +528,7 @@ hardlink -v %{buildroot}%{ansible_licensedir} - Conditionalize jmespath to work around amazon linux issues. Fixes bug #1494640 * Tue Sep 19 2017 Kevin Fenzi - 2.4.0.0-1 -- Update to 2.4.0. +- Update to 2.4.0. * Tue Aug 08 2017 Kevin Fenzi - 2.3.2.0-1 - Update to 2.3.2. Fixes bugs #1471017 #1461116 #1465586 @@ -724,7 +681,7 @@ hardlink -v %{buildroot}%{ansible_licensedir} - Update to 1.9.1 * Wed Mar 25 2015 Kevin Fenzi 1.9.0.1-2 -- Drop upstreamed epel6 patches. +- Drop upstreamed epel6 patches. * Wed Mar 25 2015 Kevin Fenzi 1.9.0.1-1 - Update to 1.9.0.1 @@ -775,7 +732,7 @@ hardlink -v %{buildroot}%{ansible_licensedir} - Update to 1.6.9 with more shell quoting fixes. * Tue Jul 22 2014 Kevin Fenzi 1.6.8-1 -- Update to 1.6.8 with fixes for shell quoting from previous release. +- Update to 1.6.8 with fixes for shell quoting from previous release. - Fixes bugs #1122060 #1122061 #1122062 * Mon Jul 21 2014 Kevin Fenzi 1.6.7-1 @@ -871,7 +828,7 @@ hardlink -v %{buildroot}%{ansible_licensedir} * Thu Sep 12 2013 Kevin Fenzi 1.3.0-1 - Update to 1.3.0 - Drop node-fireball subpackage entirely. -- Obsolete/provide fireball subpackage. +- Obsolete/provide fireball subpackage. - Add Requires python-keyczar on main package for accelerated mode. * Wed Aug 21 2013 Kevin Fenzi 1.2.3-2 From 36b9b120c4c0e0a35a2f392536086a5e93593dde Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 2 Feb 2023 16:16:35 -0600 Subject: [PATCH 02/18] Update to 7.1.0. Sync with rawhide. --- .gitignore | 2 ++ ansible.rpmlintrc | 5 +++++ ansible.spec | 44 +++++++++++++++++++++++++------------------- sources | 2 +- 4 files changed, 33 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index e8c8a29..74c40c0 100644 --- a/.gitignore +++ b/.gitignore @@ -125,3 +125,5 @@ /ansible-6.1.0.tar.gz /ansible-6.2.0.tar.gz /ansible-6.3.0.tar.gz +/ansible-7.2.0.tar.gz +/ansible-7.1.0.tar.gz diff --git a/ansible.rpmlintrc b/ansible.rpmlintrc index bdf23ba..1e73c2d 100644 --- a/ansible.rpmlintrc +++ b/ansible.rpmlintrc @@ -2,3 +2,8 @@ addFilter("W: files-duplicate") addFilter("E: files-duplicated-waste") addFilter("W: name-repeated-in-summary") addFilter("W: cross-directory-hard-link") +# Roles' files and templates should not be mangled +addFilter(r"E: env-script-interpreter.*ansible_collections/[^/]+/[^/]+/roles/[^/]+/(files|templates)/") +addFilter("W: deprecated-grep \['egrep'\]") +addFilter("W: no-manual-page-for-binary ansible-community") +addFilter(r"E: zero-length /usr/lib/python3.\d+/site-packages/ansible_collections/community/zabbix/roles/zabbix_agent/vars/main.yml") diff --git a/ansible.spec b/ansible.spec index a6c1e1c..757212d 100644 --- a/ansible.spec +++ b/ansible.spec @@ -3,7 +3,7 @@ %bcond_with tests %global ansible_licensedir %{_defaultlicensedir}/ansible %global ansible_docdir %{_defaultdocdir}/ansible -%global min_ansible_core 2.13.3 +%global min_ansible_core 2.14.1 # Roles' files and templates should not be mangled. # These files are installed on remote systems which may or may not have the @@ -17,12 +17,11 @@ BuildRequires: python%{python3_pkgversion}-rpm-macros %endif -%global uversion %(tr -d '~' <<< %{version}) - Name: ansible Summary: Curated set of Ansible collections included in addition to ansible-core -Version: 6.3.0 -Release: 2%{?dist} +Version: 7.1.0 +%global uversion %(tr -d '~' <<< %{version}) +Release: 1%{?dist} # In addition to GPL-3.0-or-later, the following licenses apply. # License text that solely exists in file headers were not considered. @@ -84,19 +83,15 @@ to ansible-core. # to properly release and test new ansible major versions after RHEL rebases # ansible-core. The lower version constraints can stay in place. -sed -i "s|'ansible-core ~= 2.13\..*',$|'ansible-core >= %{min_ansible_core}',|" setup.py +sed -i "s|'ansible-core ~= 2.14\..*',$|'ansible-core >= %{min_ansible_core}',|" setup.py # Verify set -o pipefail grep -B1 "'ansible-core >= %{min_ansible_core}'," setup.py | grep -F 'install_requires=[' %endif - # Fix wrong-script-end-of-line-encoding in azure.azcollection find ansible_collections/azure/azcollection -type f -print -exec dos2unix -k '{}' \; -find ansible_collections/community/mongodb/roles/*/{files,templates} -type f ! -executable -name '*.sh*' \ - -print -exec chmod a+x '{}' \; - # 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" @@ -111,15 +106,13 @@ 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 -vr ansible_collections/ibm/spectrum_virtualize/roles/place_holder -rm -v ansible_collections/sensu/sensu_go/tools/windows-versions.py -rm -v ansible_collections/community/dns/update-docs-fragments.py rm -v ansible_collections/community/dns/update-psl.sh -rm -v ansible_collections/community/routeros/update-docs.py +rm -v ansible_collections/cyberark/conjur/Jenkinsfile rm -v ansible_collections/dellemc/enterprise_sonic/rebuild.sh rm -v ansible_collections/ovirt/ovirt/build.sh @@ -128,18 +121,25 @@ 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 -f ansible_collections/community/zabbix/roles/zabbix_agent/files/win_sample/doSomething.ps1 -rm -f ansible_collections/community/docker/meta/ee-bindep.txt +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" ### # Fix various shebang related issues to appease brp-managle-shebangs ### +find ansible_collections/community/mongodb/roles/*/{files,templates} -type f '!' -executable -name '*.sh*' \ + -print -exec chmod a+x '{}' \; -chmod a-x ansible_collections/community/digitalocean/scripts/inventory/digital_ocean.py -chmod a-x ansible_collections/ngine_io/cloudstack/scripts/inventory/cloudstack.py +# ansible_collections/lowlydba/sqlserver thought it was a good idea to make +# *every* single file, in its repository executable, including .md, .yml, and +# .rst. :facepalm: # +# TODO: File issue upstream +find ansible_collections/lowlydba/sqlserver/ -executable -type f -print -exec chmod a-x '{}' \; + # 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. @@ -158,6 +158,9 @@ xargs -a non_exec -d'\n' sed -i -e '1{\@^#!.*@d}' %endif %build +# disable the python -s shbang flag as we want to be able to find non system modules +%global py3_shbang_opts %{nil} +%py3_shebang_fix ansible_collections %py3_build %install @@ -205,7 +208,7 @@ hardlink -v %{buildroot}%{ansible_licensedir} %files -f files.list %license COPYING -%doc README.rst PKG-INFO porting_guide_6.rst CHANGELOG-v6.rst +%doc README.rst PKG-INFO porting_guide_?.rst CHANGELOG-v?.rst %{_bindir}/ansible-community # Note (dmsimard): This ansible package installs collections to the python sitelib to mirror the UX # when installing the ansible package from PyPi. @@ -216,6 +219,9 @@ hardlink -v %{buildroot}%{ansible_licensedir} %{python3_sitelib}/*egg-info %changelog +* Thu Feb 02 2023 Maxwell G - 7.1.0-1 +- Update to 7.1.0. + * Fri Nov 18 2022 Maxwell G - 6.3.0-2 - Relax version constraint - Package cleanup diff --git a/sources b/sources index 24eef83..193fa44 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-6.3.0.tar.gz) = 3832159065d6400caade84de1ff5f31d64d7b5d9c3a61ae9bb2ad207e410166dac3537c68d0ec3df7c4b8aec61ee48cc4b690e3117a987efa9306c6cbee534e0 +SHA512 (ansible-7.1.0.tar.gz) = bd3c5f12021f4ae1805889790bbf29c748418580e08b4e5a19aeb1dc88510f7a2cabaf4e045d98361246a1f52f3d31cbebf5a1441a60fec3095b8a4628572557 From 50fd8298d0d92602bf867b77cc0e8d70fe4b5c3c Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 9 Feb 2023 19:54:13 -0600 Subject: [PATCH 03/18] Update to 7.2.0. --- ansible.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ansible.spec b/ansible.spec index 757212d..6e73e86 100644 --- a/ansible.spec +++ b/ansible.spec @@ -3,7 +3,7 @@ %bcond_with tests %global ansible_licensedir %{_defaultlicensedir}/ansible %global ansible_docdir %{_defaultdocdir}/ansible -%global min_ansible_core 2.14.1 +%global min_ansible_core 2.14.2 # Roles' files and templates should not be mangled. # These files are installed on remote systems which may or may not have the @@ -19,7 +19,7 @@ BuildRequires: python%{python3_pkgversion}-rpm-macros Name: ansible Summary: Curated set of Ansible collections included in addition to ansible-core -Version: 7.1.0 +Version: 7.2.0 %global uversion %(tr -d '~' <<< %{version}) Release: 1%{?dist} @@ -219,6 +219,9 @@ hardlink -v %{buildroot}%{ansible_licensedir} %{python3_sitelib}/*egg-info %changelog +* Fri Feb 10 2023 Maxwell G - 7.2.0-1 +- Update to 7.2.0. + * Thu Feb 02 2023 Maxwell G - 7.1.0-1 - Update to 7.1.0. diff --git a/sources b/sources index 193fa44..97311bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-7.1.0.tar.gz) = bd3c5f12021f4ae1805889790bbf29c748418580e08b4e5a19aeb1dc88510f7a2cabaf4e045d98361246a1f52f3d31cbebf5a1441a60fec3095b8a4628572557 +SHA512 (ansible-7.2.0.tar.gz) = 30d7f912cd6b2e41f1e5d880b014f00d332b4cc533512be8de885e95b63cf890ffb38a616de74c6b7fd9d6a961b7e2a1843bfe758fbcd9f3c962f1c856f20725 From 209b6b2efab39ebc1589d2cbbf62e83e669572f6 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 9 Feb 2023 19:50:27 -0600 Subject: [PATCH 04/18] Add back specfile comment about find(1) syntax This was accidentally removed at some point. --- ansible.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible.spec b/ansible.spec index 6e73e86..1c1a688 100644 --- a/ansible.spec +++ b/ansible.spec @@ -175,6 +175,7 @@ xargs -a non_exec -d'\n' sed -i -e '1{\@^#!.*@d}' # This finds the license file for each collection, moves it to # `%%{ansible_licensedir}/collection_namespace/collection_name`, and then adds # `%%license /path/to/license` to the %%files list. + # `-printf '%%P\n'` removes the trailing `./`. for f in $(find . -mindepth 3 -type f \( -iname '*LICENSE*' -o -iname '*COPYING*' \) -not -name '*.py' -not -name '*.pyc' -printf '%%P\n' | grep -v '\.license$'); do dirname="$(dirname %{buildroot}%{ansible_licensedir}/${f})" mkdir -p "${dirname}" From b0cb3266b0597d204cb1033529ae598b20c2796c Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 17 Feb 2023 15:16:27 -0600 Subject: [PATCH 05/18] Build for 3.11 on RHEL 8 and 9 --- ansible.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ansible.spec b/ansible.spec index 1c1a688..a1dd92a 100644 --- a/ansible.spec +++ b/ansible.spec @@ -11,9 +11,10 @@ %global __brp_mangle_shebangs_exclude_from ^%{python3_sitelib}/ansible_collections/[^/]+/[^/]+/roles/[^/]+/(files|templates)/.*$ %global __requires_exclude_from %{?__requires_exclude_from:%__requires_exclude_from|}%{__brp_mangle_shebangs_exclude_from} -%if 0%{?rhel} == 8 -# RHEL 8's ansible-core package is built using Python 3.9, which is not the default version. -%define python3_pkgversion 39 +%if 0%{?rhel} >= 8 +# ansible-core package is built against Python 3.11 in RHEL 8 and RHEL 9 which +# is not the default version. +%global python3_pkgversion 3.11 BuildRequires: python%{python3_pkgversion}-rpm-macros %endif From ca7e15c45355db4f79e59b2046af343b6e2d2109 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 23 Feb 2023 20:38:10 -0600 Subject: [PATCH 06/18] Use more precise globs in %files --- ansible.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible.spec b/ansible.spec index a1dd92a..7e74c37 100644 --- a/ansible.spec +++ b/ansible.spec @@ -217,8 +217,8 @@ hardlink -v %{buildroot}%{ansible_licensedir} # This allows users to install individual collections manually with ansible-galaxy (~/.ansible/collections/ansible_collections) # or via standalone distribution packages to datadir (/usr/share). # Both will have precedence over the collections installed in the python sitelib. -%{python3_sitelib}/ansible_collections -%{python3_sitelib}/*egg-info +%{python3_sitelib}/ansible_collections/ +%{python3_sitelib}/ansible-%{uversion}-py%{python3_version}.egg-info/ %changelog * Fri Feb 10 2023 Maxwell G - 7.2.0-1 From 73db8d17ac40eb4b23b2b16007617f2f5d7f1e46 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 29 Mar 2023 11:49:57 -0500 Subject: [PATCH 07/18] Work around CentOS Stream 8 brokenness `BuildRequires: python3.11-rpm-macros` isn't necessary on RHEL 9 (python3.11-devel Provides python3.11-rpm-macros) and Stream 8 is missing the package entirely [1]. The Stream 8 version does contain some extra macros, so we'll add this back once the c8s compose issues are fixed. We need to set %python3_version manually until python-rpm-macros-3-45.el8 reaches the mirrors to unbreak %py3_shebang_fix. [1] https://bugzilla.redhat.com/show_bug.cgi?id=2137139#c18 --- ansible.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible.spec b/ansible.spec index 7e74c37..3507d3b 100644 --- a/ansible.spec +++ b/ansible.spec @@ -15,7 +15,9 @@ # ansible-core package is built against Python 3.11 in RHEL 8 and RHEL 9 which # is not the default version. %global python3_pkgversion 3.11 -BuildRequires: python%{python3_pkgversion}-rpm-macros +# We need to specify this manually until python-rpm-macros-3-45.el8 +# (see rhbz#2169780) reaches the mirrors. +%global python3_version 3.11 %endif Name: ansible From 5a1fc25e2b01f20cf7ab62d02917daba63d9fad7 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 20 Apr 2023 21:43:45 +0000 Subject: [PATCH 08/18] Revert "Work around CentOS Stream 8 brokenness" This reverts commit 73db8d17ac40eb4b23b2b16007617f2f5d7f1e46. The underlying issues have been fixed in CentOS Stream 8. --- ansible.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ansible.spec b/ansible.spec index 3507d3b..7e74c37 100644 --- a/ansible.spec +++ b/ansible.spec @@ -15,9 +15,7 @@ # ansible-core package is built against Python 3.11 in RHEL 8 and RHEL 9 which # is not the default version. %global python3_pkgversion 3.11 -# We need to specify this manually until python-rpm-macros-3-45.el8 -# (see rhbz#2169780) reaches the mirrors. -%global python3_version 3.11 +BuildRequires: python%{python3_pkgversion}-rpm-macros %endif Name: ansible From 32d4fd10aea1c849bd3e5a24b3ba8ceccad0fc9b Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 31 May 2023 01:20:52 +0000 Subject: [PATCH 09/18] remove unused .coveragerc file --- .coveragerc | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 698302a..0000000 --- a/.coveragerc +++ /dev/null @@ -1,24 +0,0 @@ -# This configuration file is used for manual execution of coverage -# as well as for tests run through ansible-test. - -[run] -branch = True - -# Enable concurrency. This also enables parallel mode, which results in -# multiple coverage files being created. Concurrency allows us to collect -# results from multiple tests simultaneously, as well as supporting multiple -# test runs, such as from integration tests. -concurrency = multiprocessing -parallel = True - -# When running tests through ansible-test, this option is overridden by -# the COVERAGE_FILE environment variable. This option is present for -# convenience when running coverage manually from this directory. -data_file = test/results/coverage/coverage - -# Don't collect or report code coverage from files matching these patterns. -omit = - */python*/dist-packages/* - */python*/site-packages/* - */python*/distutils - */pytest From 29861794cfb9ea29dca6f42c72223ac0e4baf951 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Mon, 15 May 2023 18:26:30 -0500 Subject: [PATCH 10/18] Update to 8.0.0~a3. --- .gitignore | 1 + ansible.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 74c40c0..90f39be 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,4 @@ /ansible-6.3.0.tar.gz /ansible-7.2.0.tar.gz /ansible-7.1.0.tar.gz +/ansible-8.0.0a3.tar.gz diff --git a/ansible.spec b/ansible.spec index 7e74c37..36353f7 100644 --- a/ansible.spec +++ b/ansible.spec @@ -20,7 +20,7 @@ BuildRequires: python%{python3_pkgversion}-rpm-macros Name: ansible Summary: Curated set of Ansible collections included in addition to ansible-core -Version: 7.2.0 +Version: 8.0.0~a3 %global uversion %(tr -d '~' <<< %{version}) Release: 1%{?dist} @@ -221,6 +221,9 @@ hardlink -v %{buildroot}%{ansible_licensedir} %{python3_sitelib}/ansible-%{uversion}-py%{python3_version}.egg-info/ %changelog +* Wed May 03 2023 Maxwell G - 8.0.0~a3-1 +- Update to 8.0.0~a3. + * Fri Feb 10 2023 Maxwell G - 7.2.0-1 - Update to 7.2.0. diff --git a/sources b/sources index 97311bc..fcd6ded 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-7.2.0.tar.gz) = 30d7f912cd6b2e41f1e5d880b014f00d332b4cc533512be8de885e95b63cf890ffb38a616de74c6b7fd9d6a961b7e2a1843bfe758fbcd9f3c962f1c856f20725 +SHA512 (ansible-8.0.0a3.tar.gz) = 8358caec95a2b8b7e6c45750e7e182b960b0b227030def02aae9ad1c19f263b8263ce1c545763efab8c46208e871f1f0a7ee0543d60a01d2fe0659f0730d52d1 From 3c9e7d2bcdd80c17c0b14a9e9897e6eb88d3ad7f Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 10 May 2023 04:38:33 +0000 Subject: [PATCH 11/18] move specfile scripting into separate files This makes the specfile more readable and makes it easier to sync the more complex parts across branches. This also refactors the license install logic. --- .gitignore | 132 +---------------------------------- ansible-install-licenses.sh | 42 +++++++++++ ansible-prep.sh | 63 +++++++++++++++++ ansible.spec | 135 ++++++++---------------------------- 4 files changed, 136 insertions(+), 236 deletions(-) create mode 100755 ansible-install-licenses.sh create mode 100755 ansible-prep.sh diff --git a/.gitignore b/.gitignore index 90f39be..a3dd11c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,130 +1,2 @@ -/ansible-1.5.3.tar.gz -/ansible-1.5.4.tar.gz -/ansible-1.5.5.tar.gz -/ansible-1.6.tar.gz -/ansible-1.6.1.tar.gz -/ansible-1.6.2.tar.gz -/ansible-1.6.3.tar.gz -/ansible-1.6.4.tar.gz -/ansible-1.6.5.tar.gz -/ansible-1.6.6.tar.gz -/ansible-1.6.7.tar.gz -/ansible-1.6.8.tar.gz -/ansible-1.6.9.tar.gz -/ansible-1.6.10.tar.gz -/ansible-1.7.tar.gz -/ansible-1.7.1.tar.gz -/ansible-1.7.2.tar.gz -/ansible-1.8.tar.gz -/ansible-1.8.1.tar.gz -/ansible-1.8.2.tar.gz -/ansible-1.8.3.tar.gz -/ansible-1.8.4.tar.gz -/ansible-1.9.0.tar.gz -/ansible-1.9.0.1.tar.gz -/ansible-1.9.1.tar.gz -/ansible-1.9.2.tar.gz -/ansible-1.9.3.tar.gz -/ansible-1.9.4.tar.gz -/ansible-2.0.0.1.tar.gz -/ansible-unittests.tar.xz -/ansible-2.0.0.2.tar.gz -/ansible-2.0.1.0.tar.gz -/ansible-unittests-2.0.1.0.tar.xz -/ansible-unittests-2.0.2.0.tar.xz -/ansible-2.0.2.0.tar.gz -/ansible-unittests-2.1.0.0.tar.xz -/ansible-2.1.0.0.tar.gz -/ansible-unittests-2.1.1.0.tar.xz -/ansible-2.1.1.0.tar.gz -/ansible-2.1.2.0.tar.gz -/ansible-unittests-2.1.2.0.tar.xz -/ansible-unittests-2.2.0.0.tar.xz -/ansible-2.2.0.0.tar.gz -/ansible-unittests-2.2.1.0.tar.xz -/ansible-2.2.1.0.tar.gz -/ansible-2.2.2.0-0.1.rc1.tar.gz -/ansible-unittests-2.2.2.0.tar.xz -/ansible-2.2.2.0.tar.gz -/ansible-2.3.0.0.tar.gz -/ansible-2.3.1.0.tar.gz -/ansible-2.3.2.0.tar.gz -/ansible-2.4.0.0.tar.gz -/ansible-2.4.1.0.tar.gz -/ansible-2.4.2.0.tar.gz -/ansible-2.4.3.0.tar.gz -/ansible-2.5.0.tar.gz -/ansible-2.5.1.tar.gz -/ansible-2.5.2.tar.gz -/ansible-2.5.3.tar.gz -/ansible-2.5.5.tar.gz -/ansible-2.6.0.tar.gz -/ansible-2.6.1.tar.gz -/ansible-2.6.2.tar.gz -/ansible-2.6.3.tar.gz -/ansible-2.6.4.tar.gz -/ansible-2.6.5.tar.gz -/ansible-2.7.0.tar.gz -/ansible-2.7.1.tar.gz -/ansible-2.7.2.tar.gz -/ansible-2.7.3.tar.gz -/ansible-2.7.4.tar.gz -/ansible-2.7.5.tar.gz -/ansible-2.7.6.tar.gz -/ansible-2.7.7.tar.gz -/ansible-2.7.8.tar.gz -/ansible-2.7.9.tar.gz -/ansible-2.7.10.tar.gz -/ansible-2.8.0b1.tar.gz -/ansible-2.8.0rc1.tar.gz -/ansible-2.8.0rc3.tar.gz -/ansible-2.8.0.tar.gz -/ansible-2.8.1.tar.gz -/ansible-2.8.2.tar.gz -/ansible-2.8.3.tar.gz -/ansible-2.8.4.tar.gz -/ansible-2.8.5.tar.gz -/ansible-2.8.6.tar.gz -/ansible-2.9.0.tar.gz -/ansible-2.9.1.tar.gz -/ansible-2.9.2.tar.gz -/ansible-2.9.3.tar.gz -/ansible-2.9.4.tar.gz -/ansible-2.9.5.tar.gz -/ansible-2.9.6.tar.gz -/ansible-2.9.7.tar.gz -/ansible-2.9.9.tar.gz -/ansible-2.9.10.tar.gz -/ansible-2.9.11.tar.gz -/ansible-2.9.12.tar.gz -/ansible-2.9.13.tar.gz -/ansible-2.9.14.tar.gz -/ansible-2.9.15.tar.gz -/ansible-2.9.16.tar.gz -/ansible-2.9.17.tar.gz -/ansible-2.9.18.tar.gz -/ansible-2.9.20.tar.gz -/ansible-2.9.21.tar.gz -/ansible-2.9.22.tar.gz -/ansible-2.9.23.tar.gz -/ansible-2.9.24.tar.gz -/ansible-2.9.25.tar.gz -/ansible-2.9.26.tar.gz -/ansible-2.9.27.tar.gz -/ansible-5.1.0.tar.gz -/ansible-5.2.0.tar.gz -/ansible-5.3.0.tar.gz -/ansible-5.4.0.tar.gz -/ansible-5.5.0.tar.gz -/ansible-5.6.0.tar.gz -/ansible-5.7.0.tar.gz -/ansible-5.8.0.tar.gz -/ansible-5.9.0.tar.gz -/ansible-6.0.0rc1.tar.gz -/ansible-6.0.0.tar.gz -/ansible-6.1.0.tar.gz -/ansible-6.2.0.tar.gz -/ansible-6.3.0.tar.gz -/ansible-7.2.0.tar.gz -/ansible-7.1.0.tar.gz -/ansible-8.0.0a3.tar.gz +/ansible-*.tar.gz +/ansible-*/ diff --git a/ansible-install-licenses.sh b/ansible-install-licenses.sh new file mode 100755 index 0000000..06051ee --- /dev/null +++ b/ansible-install-licenses.sh @@ -0,0 +1,42 @@ +#!/usr/bin/bash -x + +set -euo pipefail + +ansible_licensedir="${1}" +ansible_docdir="${2}" + +# Install docs and licenses +mkdir -p "${ansible_licensedir}" "${ansible_docdir}" + +# This finds the license file for each collection and moves it to +# `${ansible_licensedir}` + +for f in $(find -mindepth 3 -iname 'LICENSES' -type d -printf '%P\n') +do + dirname="$(dirname "${ansible_licensedir}/${f}")" + mkdir -p "${dirname}" + mv "${f}" "${ansible_licensedir}/${f}" +done + +for f in $( + find . -mindepth 3 -type f \ + \( -iname '*LICENSE*' -o -iname '*COPYING*' \) \ + -not -name '*.py' -not -name '*.pyc' \ + -not -name '*.license' -not -name '*.yaml' -not -name '*.yml' \ + -not -name '*.json' \ + -printf '%P\n' \ + | grep -vE '/docs/[^/]+_module\.rst$' +) +do + dirname="$(dirname "${ansible_licensedir}/${f}")" + mkdir -p "${dirname}" + mv "${f}" "${dirname}" +done + +# This does the same thing, but for READMEs. +for f in $(find . -mindepth 3 -type f -name 'README*' -printf '%P\n') +do + dirname="$(dirname "${ansible_docdir}/${f}")" + mkdir -p "${dirname}" + mv "${f}" "${dirname}" +done diff --git a/ansible-prep.sh b/ansible-prep.sh new file mode 100755 index 0000000..befc12f --- /dev/null +++ b/ansible-prep.sh @@ -0,0 +1,63 @@ +#!/usr/bin/bash -x + +set -euo pipefail + +# Fix wrong-script-end-of-line-encoding in azure.azcollection +find ansible_collections/azure/azcollection -type f -print -exec dos2unix -k '{}' \; + +# 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/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" + +### +# Fix various shebang related issues to appease brp-managle-shebangs +### +find ansible_collections/community/mongodb/roles/*/{files,templates} -type f '!' -executable -name '*.sh*' \ + -print -exec chmod a+x '{}' \; + +# ansible_collections/lowlydba/sqlserver thought it was a good idea to make +# *every* single file, in its repository executable, including .md, .yml, and +# .rst. :facepalm: +# +# TODO: File issue upstream +find ansible_collections/lowlydba/sqlserver/ -executable -type f -print -exec chmod a-x '{}' \; + +# 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}' diff --git a/ansible.spec b/ansible.spec index 36353f7..47457f2 100644 --- a/ansible.spec +++ b/ansible.spec @@ -1,9 +1,9 @@ # TODO: Re-enable docs and tests once possible %bcond_with docs %bcond_with tests -%global ansible_licensedir %{_defaultlicensedir}/ansible -%global ansible_docdir %{_defaultdocdir}/ansible -%global min_ansible_core 2.14.2 +%global min_ansible_core 2.15.0rc1 +# %%global rpm_min_ansible_core %{min_ansible_core} +%global rpm_min_ansible_core 2.15~rc1 # Roles' files and templates should not be mangled. # These files are installed on remote systems which may or may not have the @@ -43,6 +43,8 @@ Release: 1%{?dist} # PSF-license.txt License: GPL-3.0-or-later AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT AND MPL-2.0 AND PSF-2.0 Source0: %{pypi_source %{name} %{uversion}} +Source1: ansible-prep.sh +Source2: ansible-install-licenses.sh Url: https://ansible.com BuildArch: noarch @@ -51,7 +53,7 @@ BuildRequires: findutils BuildRequires: hardlink BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools -BuildRequires: %{py3_dist ansible-core} >= %{min_ansible_core} +BuildRequires: %{py3_dist ansible-core} >= %{rpm_min_ansible_core} %if %{with tests} # TODO build-requires @@ -74,7 +76,6 @@ to ansible-core. %prep %autosetup -p1 -n %{name}-%{uversion} -%if %{defined rhel} # Relax ansible-core dependency to avoid FTI bugs # # This is necessary, because the EPEL ansible maintainers don't have control @@ -84,79 +85,26 @@ to ansible-core. # to properly release and test new ansible major versions after RHEL rebases # ansible-core. The lower version constraints can stay in place. -sed -i "s|'ansible-core ~= 2.14\..*',$|'ansible-core >= %{min_ansible_core}',|" setup.py +sed "s|'ansible-core ~= %{min_ansible_core}.*',$|'ansible-core >= %{min_ansible_core}',|" \ + setup.py > setup.py.bak # Verify set -o pipefail -grep -B1 "'ansible-core >= %{min_ansible_core}'," setup.py | grep -F 'install_requires=[' +grep -B1 "'ansible-core >= %{min_ansible_core}'," setup.py.bak | grep -F 'install_requires=[' +%if %{defined rhel} +mv setup.py.bak setup.py %endif -# Fix wrong-script-end-of-line-encoding in azure.azcollection -find ansible_collections/azure/azcollection -type f -print -exec dos2unix -k '{}' \; +# ansible-prep.sh +%{S:1} -# 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" - -### -# Fix various shebang related issues to appease brp-managle-shebangs -### -find ansible_collections/community/mongodb/roles/*/{files,templates} -type f '!' -executable -name '*.sh*' \ - -print -exec chmod a+x '{}' \; - -# ansible_collections/lowlydba/sqlserver thought it was a good idea to make -# *every* single file, in its repository executable, including .md, .yml, and -# .rst. :facepalm: -# -# TODO: File issue upstream -find ansible_collections/lowlydba/sqlserver/ -executable -type f -print -exec chmod a-x '{}' \; - -# 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}' - -# This ensures that %%ansible_core_requires is set properly, when %%pyproject_buildrequires is defined. -# It also ensures that dependencies remain consistent. -%if %{undefined el8} -%generate_buildrequires -%pyproject_buildrequires -%endif +( +mkdir licenses docs +cd ansible_collections +# ansible-license-install.sh +%{S:2} \ + "$(readlink -f ../licenses)" \ + "$(readlink -f ../docs)" \ +) %build # disable the python -s shbang flag as we want to be able to find non system modules @@ -167,50 +115,25 @@ xargs -a non_exec -d'\n' sed -i -e '1{\@^#!.*@d}' %install %py3_install -%global filelist %{_builddir}/%{buildsubdir}/files.list -# Install docs and licenses -( - mkdir -p "%{buildroot}%{ansible_docdir}" "%{buildroot}%{ansible_licensedir}" - cd %{buildroot}%{python3_sitelib}/ansible_collections - # This finds the license file for each collection, moves it to - # `%%{ansible_licensedir}/collection_namespace/collection_name`, and then adds - # `%%license /path/to/license` to the %%files list. - # `-printf '%%P\n'` removes the trailing `./`. - for f in $(find . -mindepth 3 -type f \( -iname '*LICENSE*' -o -iname '*COPYING*' \) -not -name '*.py' -not -name '*.pyc' -printf '%%P\n' | grep -v '\.license$'); do - dirname="$(dirname %{buildroot}%{ansible_licensedir}/${f})" - mkdir -p "${dirname}" - mv "${f}" "${dirname}" - tee -a %{filelist} << EOF -%%license %%{ansible_licensedir}/${f} -EOF - done - for f in $(find -mindepth 3 -iname 'LICENSES' -type d); do - cp -rfp --parents ${f} %{buildroot}%{ansible_licensedir} - echo "%%license %%{ansible_licensedir}/${f}" >> %{filelist} - done +mkdir -p %{buildroot}%{_licensedir}/ansible %{buildroot}%{_docdir}/ansible +mv licenses %{buildroot}%{_licensedir}/ansible/ansible_collections +mv docs %{buildroot}%{_pkgdocdir}/ansible_collections - # This does the same thing, but for READMEs. - for f in $(find . -mindepth 3 -type f -name 'README*' -printf '%%P\n'); do - dirname="$(dirname %{buildroot}%{ansible_docdir}/${f})" - mkdir -p "${dirname}" - mv "${f}" "${dirname}" - tee -a %{filelist} << EOF -%%doc %%{ansible_docdir}/${f} -EOF - done -) hardlink -v %{buildroot}%{python3_sitelib}/ansible_collections -hardlink -v %{buildroot}%{ansible_licensedir} +hardlink -v %{buildroot}%{_licensedir}/ansible %check %if 0%{?with_tests} # TODO: Run tests %endif -%files -f files.list + +%files %license COPYING +%license %{_licensedir}/ansible/ansible_collections/ %doc README.rst PKG-INFO porting_guide_?.rst CHANGELOG-v?.rst +%doc %{_pkgdocdir}/ansible_collections/ %{_bindir}/ansible-community # Note (dmsimard): This ansible package installs collections to the python sitelib to mirror the UX # when installing the ansible package from PyPi. From 448402a2c9050a4b8c6195fde90ff1259922a885 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Mon, 15 May 2023 23:54:11 +0000 Subject: [PATCH 12/18] build wheel instead of using %py3_install --- ansible.spec | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ansible.spec b/ansible.spec index 47457f2..256cc45 100644 --- a/ansible.spec +++ b/ansible.spec @@ -1,9 +1,9 @@ # TODO: Re-enable docs and tests once possible %bcond_with docs %bcond_with tests -%global min_ansible_core 2.15.0rc1 -# %%global rpm_min_ansible_core %{min_ansible_core} -%global rpm_min_ansible_core 2.15~rc1 +%global min_ansible_core 2.15.0rc2 +# %%global rpm_min_ansible_core %%{min_ansible_core} +%global rpm_min_ansible_core 2.15~rc2 # Roles' files and templates should not be mangled. # These files are installed on remote systems which may or may not have the @@ -52,7 +52,9 @@ BuildRequires: dos2unix BuildRequires: findutils BuildRequires: hardlink BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-pip BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-wheel BuildRequires: %{py3_dist ansible-core} >= %{rpm_min_ansible_core} %if %{with tests} @@ -110,10 +112,14 @@ cd ansible_collections # disable the python -s shbang flag as we want to be able to find non system modules %global py3_shbang_opts %{nil} %py3_shebang_fix ansible_collections -%py3_build +%python3 -c 'from setuptools.build_meta import build_wheel; build_wheel("dist")' %install -%py3_install +%py3_install_wheel ansible-*-py3-none-any.whl + +DISTINFO=%{buildroot}%{python3_sitelib}/ansible-%{uversion}.dist-info +rm -rv "${DISTINFO}/RECORD" "${DISTINFO}/REQUESTED" +sed -i 's/pip/rpm/' "${DISTINFO}/INSTALLER" mkdir -p %{buildroot}%{_licensedir}/ansible %{buildroot}%{_docdir}/ansible @@ -141,7 +147,7 @@ hardlink -v %{buildroot}%{_licensedir}/ansible # or via standalone distribution packages to datadir (/usr/share). # Both will have precedence over the collections installed in the python sitelib. %{python3_sitelib}/ansible_collections/ -%{python3_sitelib}/ansible-%{uversion}-py%{python3_version}.egg-info/ +%{python3_sitelib}/ansible-%{uversion}.dist-info/ %changelog * Wed May 03 2023 Maxwell G - 8.0.0~a3-1 From b1b5b4794ba7bf1fa46617d10a4b753ef16bab4d Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 16 May 2023 04:15:27 +0000 Subject: [PATCH 13/18] add copyright headers Fedora specfiles are implicitly licensed under the MIT license as per the FPCA, but explicit is better than implicit. --- ansible-install-licenses.sh | 4 ++++ ansible-prep.sh | 4 ++++ ansible.spec | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/ansible-install-licenses.sh b/ansible-install-licenses.sh index 06051ee..f78c535 100755 --- a/ansible-install-licenses.sh +++ b/ansible-install-licenses.sh @@ -1,5 +1,9 @@ #!/usr/bin/bash -x +# SPDX-License-Identifier: MIT +# Copyright (C) Fedora Project Authors +# License Text: https://spdx.org/licenses/MIT.txt + set -euo pipefail ansible_licensedir="${1}" diff --git a/ansible-prep.sh b/ansible-prep.sh index befc12f..a0094c5 100755 --- a/ansible-prep.sh +++ b/ansible-prep.sh @@ -1,5 +1,9 @@ #!/usr/bin/bash -x +# SPDX-License-Identifier: MIT +# Copyright (C) Fedora Project Authors +# License Text: https://spdx.org/licenses/MIT.txt + set -euo pipefail # Fix wrong-script-end-of-line-encoding in azure.azcollection diff --git a/ansible.spec b/ansible.spec index 256cc45..6608b99 100644 --- a/ansible.spec +++ b/ansible.spec @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: MIT +# Copyright (C) Fedora Project Authors +# License Text: https://spdx.org/licenses/MIT.html + # TODO: Re-enable docs and tests once possible %bcond_with docs %bcond_with tests From 6230aa456e125abd0060647e54257e44c19a5409 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 16 May 2023 11:29:18 -0500 Subject: [PATCH 14/18] Update to 8.0.0~b1. --- ansible.spec | 9 ++++++--- sources | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ansible.spec b/ansible.spec index 6608b99..c56c3c0 100644 --- a/ansible.spec +++ b/ansible.spec @@ -5,9 +5,9 @@ # TODO: Re-enable docs and tests once possible %bcond_with docs %bcond_with tests -%global min_ansible_core 2.15.0rc2 +%global min_ansible_core 2.15.0 # %%global rpm_min_ansible_core %%{min_ansible_core} -%global rpm_min_ansible_core 2.15~rc2 +%global rpm_min_ansible_core 2.15 # Roles' files and templates should not be mangled. # These files are installed on remote systems which may or may not have the @@ -24,7 +24,7 @@ BuildRequires: python%{python3_pkgversion}-rpm-macros Name: ansible Summary: Curated set of Ansible collections included in addition to ansible-core -Version: 8.0.0~a3 +Version: 8.0.0~b1 %global uversion %(tr -d '~' <<< %{version}) Release: 1%{?dist} @@ -154,6 +154,9 @@ hardlink -v %{buildroot}%{_licensedir}/ansible %{python3_sitelib}/ansible-%{uversion}.dist-info/ %changelog +* Tue May 16 2023 Maxwell G - 8.0.0~b1-1 +- Update to 8.0.0~b1. + * Wed May 03 2023 Maxwell G - 8.0.0~a3-1 - Update to 8.0.0~a3. diff --git a/sources b/sources index fcd6ded..597065a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-8.0.0a3.tar.gz) = 8358caec95a2b8b7e6c45750e7e182b960b0b227030def02aae9ad1c19f263b8263ce1c545763efab8c46208e871f1f0a7ee0543d60a01d2fe0659f0730d52d1 +SHA512 (ansible-8.0.0b1.tar.gz) = 100d660051a45d75407f87db44b12b8e434a592838f7c040398765ad2c8eb5173b828b1f31d07d6f0e0565f21a2d0cfc54a7dcd8a1ef720e34f4919617475417 From f2d857bd8de2a84a4855846219350d7a4ff15ee3 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 19 May 2023 05:55:03 +0000 Subject: [PATCH 15/18] update excluded files list for 8.0.0~b1 --- ansible-prep.sh | 19 +++++++++++++++---- ansible.rpmlintrc | 4 ++-- ansible.spec | 5 +++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ansible-prep.sh b/ansible-prep.sh index a0094c5..95bc8ea 100755 --- a/ansible-prep.sh +++ b/ansible-prep.sh @@ -18,16 +18,25 @@ hidden_pattern=".*\.(DS_Store|all-contributorsrc|ansible-lint|azure-pipelines|ci 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/cisco/meraki/scripts/ +rm -rv ansible_collections/community/digitalocean/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/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/google/cloud/test-fixtures/ +rm -rv ansible_collections/google/cloud/scripts/ +rm -rv ansible_collections/grafana/grafana/tools/ rm -rv ansible_collections/netbox/netbox/hacking/ rm -rv ansible_collections/sensu/sensu_go/docker/ +rm -rv ansible_collections/sensu/sensu_go/tools/ + +rm -v ansible_collections/community/dns/update-docs-fragments.py rm -v ansible_collections/community/dns/update-psl.sh +rm -v ansible_collections/community/mysql/run_all_tests.py +rm -v ansible_collections/community/routeros/update-docs.py rm -v ansible_collections/cyberark/conjur/Jenkinsfile rm -v ansible_collections/dellemc/enterprise_sonic/rebuild.sh rm -v ansible_collections/ovirt/ovirt/build.sh @@ -56,12 +65,14 @@ find ansible_collections/community/mongodb/roles/*/{files,templates} -type f '!' # TODO: File issue upstream find ansible_collections/lowlydba/sqlserver/ -executable -type f -print -exec chmod a-x '{}' \; + # 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 +find ansible_collections -type f ! -executable -name '*.py' | tee non_exec +echo ansible_collections/community/sap_libs/plugins/module_utils/swpm2_parameters_inifile_generate.py >> 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}' diff --git a/ansible.rpmlintrc b/ansible.rpmlintrc index 1e73c2d..d5ffe46 100644 --- a/ansible.rpmlintrc +++ b/ansible.rpmlintrc @@ -4,6 +4,6 @@ addFilter("W: name-repeated-in-summary") addFilter("W: cross-directory-hard-link") # Roles' files and templates should not be mangled addFilter(r"E: env-script-interpreter.*ansible_collections/[^/]+/[^/]+/roles/[^/]+/(files|templates)/") -addFilter("W: deprecated-grep \['egrep'\]") +addFilter(r"E: non-executable-script.*ansible_collections/[^/]+/[^/]+/roles/[^/]+/(files|templates)/") addFilter("W: no-manual-page-for-binary ansible-community") -addFilter(r"E: zero-length /usr/lib/python3.\d+/site-packages/ansible_collections/community/zabbix/roles/zabbix_agent/vars/main.yml") +addFilter(r"E: zero-length") diff --git a/ansible.spec b/ansible.spec index c56c3c0..7a2015b 100644 --- a/ansible.spec +++ b/ansible.spec @@ -133,6 +133,11 @@ mv docs %{buildroot}%{_pkgdocdir}/ansible_collections hardlink -v %{buildroot}%{python3_sitelib}/ansible_collections hardlink -v %{buildroot}%{_licensedir}/ansible +# XXX: One of the build steps is messing with the permission. +# XXX: The file is 0755 in the source tarball. +chmod 0755 %{buildroot}%{python3_sitelib}/ansible_collections/ngine_io/cloudstack/scripts/inventory/cloudstack.py + + %check %if 0%{?with_tests} # TODO: Run tests From 2fee4eb3b41f2d3eebae7d4ec7ed241dfbe9b7a6 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 23 May 2023 22:39:24 -0500 Subject: [PATCH 16/18] Update to 8.0.0~rc1. --- ansible.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ansible.spec b/ansible.spec index 7a2015b..59e23ee 100644 --- a/ansible.spec +++ b/ansible.spec @@ -24,7 +24,7 @@ BuildRequires: python%{python3_pkgversion}-rpm-macros Name: ansible Summary: Curated set of Ansible collections included in addition to ansible-core -Version: 8.0.0~b1 +Version: 8.0.0~rc1 %global uversion %(tr -d '~' <<< %{version}) Release: 1%{?dist} @@ -159,6 +159,9 @@ chmod 0755 %{buildroot}%{python3_sitelib}/ansible_collections/ngine_io/cloudstac %{python3_sitelib}/ansible-%{uversion}.dist-info/ %changelog +* Tue May 23 2023 Maxwell G - 8.0.0~rc1-1 +- Update to 8.0.0~rc1. + * Tue May 16 2023 Maxwell G - 8.0.0~b1-1 - Update to 8.0.0~b1. diff --git a/sources b/sources index 597065a..89b25cc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-8.0.0b1.tar.gz) = 100d660051a45d75407f87db44b12b8e434a592838f7c040398765ad2c8eb5173b828b1f31d07d6f0e0565f21a2d0cfc54a7dcd8a1ef720e34f4919617475417 +SHA512 (ansible-8.0.0rc1.tar.gz) = 052efbdfe05de6088c2114f4000faa86cd8e63d60ebcb0a2d1bd2b486e17b1c9b4e0c1f8da8a2a1bae49b64bfbaaeed8db763a9a963744870cf351509d4ceda7 From 505dacb8d1aa1c45aebe1e5d910ac38b5920f0ab Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 24 May 2023 15:31:02 +0000 Subject: [PATCH 17/18] add tmt and gating tests --- .fmf/version | 1 + gating.yaml | 13 +++++++++++++ tests/smoke.fmf | 17 +++++++++++++++++ tests/smoke.sh | 7 +++++++ 4 files changed, 38 insertions(+) create mode 100644 .fmf/version create mode 100644 gating.yaml create mode 100644 tests/smoke.fmf create mode 100755 tests/smoke.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..1a03a59 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,13 @@ +# Copyright (C) 2023 Maxwell G +# SPDX-License-Identifier: MIT + +--- !Policy +product_versions: + - fedora-* +decision_contexts: + - bodhi_update_push_testing + - bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} +... diff --git a/tests/smoke.fmf b/tests/smoke.fmf new file mode 100644 index 0000000..a8f51cb --- /dev/null +++ b/tests/smoke.fmf @@ -0,0 +1,17 @@ +# Copyright (C) 2023 Maxwell G +# SPDX-License-Identifier: MIT + +summary: Run ansible-core smoke tests with ansible bundle installed +discover: + - name: Smoke tests with ansible + how: shell + tests: + - name: Run tests/smoke.sh + test: tests/smoke.sh + require: + - python3-dnf + - dnf-plugins-core + - ansible-core + - ansible +execute: + how: tmt diff --git a/tests/smoke.sh b/tests/smoke.sh new file mode 100755 index 0000000..903938a --- /dev/null +++ b/tests/smoke.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash -x +# Copyright (C) 2023 Maxwell G +# SPDX-License-Identifier: MIT + +set -euo pipefail + +curl -L https://src.fedoraproject.org/rpms/ansible-core/raw/rawhide/f/tests/smoke.sh | bash -x From 66edc5714eda7b34114b312b38ce52acfaa7bc8a Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 30 May 2023 17:13:27 -0500 Subject: [PATCH 18/18] Update to 8.0.0. --- ansible.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ansible.spec b/ansible.spec index 59e23ee..75e1ec1 100644 --- a/ansible.spec +++ b/ansible.spec @@ -24,7 +24,7 @@ BuildRequires: python%{python3_pkgversion}-rpm-macros Name: ansible Summary: Curated set of Ansible collections included in addition to ansible-core -Version: 8.0.0~rc1 +Version: 8.0.0 %global uversion %(tr -d '~' <<< %{version}) Release: 1%{?dist} @@ -159,6 +159,9 @@ chmod 0755 %{buildroot}%{python3_sitelib}/ansible_collections/ngine_io/cloudstac %{python3_sitelib}/ansible-%{uversion}.dist-info/ %changelog +* Tue May 30 2023 Maxwell G - 8.0.0-1 +- Update to 8.0.0. + * Tue May 23 2023 Maxwell G - 8.0.0~rc1-1 - Update to 8.0.0~rc1. diff --git a/sources b/sources index 89b25cc..03089ba 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-8.0.0rc1.tar.gz) = 052efbdfe05de6088c2114f4000faa86cd8e63d60ebcb0a2d1bd2b486e17b1c9b4e0c1f8da8a2a1bae49b64bfbaaeed8db763a9a963744870cf351509d4ceda7 +SHA512 (ansible-8.0.0.tar.gz) = 637304599ec2074b473902d767a9e42d4df17c8485e5d64b6a1ea8a3b8ad347f021aeb88ca5cdbd2eefc30f2d8d2870e8934fa2c4d9c192c03a1482b31cc1fc5