Compare commits

...
Sign in to create a new pull request.

30 commits

Author SHA1 Message Date
Maxwell G
aaf7f039f5
Build for Python 3.9
ansible-core in RHEL 9.3 is going back to python3.9

(cherry picked from commit 330f77d3e2)

Relates: https://bugzilla.redhat.com/2221820
2023-11-07 02:11:03 +00:00
Maxwell G
a2076bfeed
Downgrade to 7.7.0.
(cherry picked from commit c48a055af8)
2023-11-07 02:11:02 +00:00
Maxwell G
b81600ed96
remove unused .coveragerc file
(cherry picked from commit fc81424050)
2023-11-07 02:11:01 +00:00
Maxwell G
20d967d0f5
Update to 8.0.0.
(cherry picked from commit 43d9344813)
2023-11-07 02:11:00 +00:00
Maxwell G
bd1a191033
add tmt and gating tests
(cherry picked from commit fb066e03ec)
2023-11-07 02:10:59 +00:00
Maxwell G
dd86b8e656
Update to 8.0.0~rc1.
(cherry picked from commit d5ea4542c9)
2023-11-07 02:10:58 +00:00
Maxwell G
6944aab305
update excluded files list for 8.0.0~b1
(cherry picked from commit c2e409cc77)
2023-11-07 02:10:57 +00:00
Maxwell G
a01dd00317
Update to 8.0.0~b1.
(cherry picked from commit 10f6b04abf)
2023-11-07 02:10:55 +00:00
Maxwell G
40c2c4fbef
add copyright headers
Fedora specfiles are implicitly licensed under the MIT license as per
the FPCA, but explicit is better than implicit.

(cherry picked from commit f489f343c7)
2023-11-07 02:10:54 +00:00
Maxwell G
5d170643ff
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.

(cherry picked from commit 282053d3e1)
2023-11-07 02:10:53 +00:00
Maxwell G
799e59087b
modernize specfile for EPEL 9 and Fedora
I'll maintain a separate specfile for EPEL 8.

(cherry picked from commit fccbd6ed03)
2023-11-07 02:10:51 +00:00
Maxwell G
4f00cd0cd4
Update to 8.0.0~a3.
(cherry picked from commit 58277e4f22)
2023-11-07 02:10:50 +00:00
Maxwell G
4c78ffade1
Update to 8.0.0~a2.
(cherry picked from commit 63070568b7)
2023-11-07 02:10:49 +00:00
Maxwell G
70164d320c
Update to 8.0.0~a1.
(cherry picked from commit 8a5fe04367)
2023-11-07 02:10:49 +00:00
Maxwell G
efc6953035
Update to 7.4.0.
(cherry picked from commit c4edd5fdca)
2023-11-07 02:10:48 +00:00
Maxwell G
8288c5424d
Update to 7.3.0.
(cherry picked from commit dafa29f748)
2023-11-07 02:10:47 +00:00
Maxwell G
a2bd69906f
simplify gitignore by using globs
(cherry picked from commit 0cd8ef9fba)
2023-11-07 02:10:45 +00:00
Maxwell G
8b3e6a6c25
Use more precise globs in %files 2023-05-09 14:16:41 +00:00
Maxwell G
a9d7c28806
Build for 3.11 on RHEL 8 and 9 2023-05-09 14:16:41 +00:00
Maxwell G
7a6b29deea
Add back specfile comment about find(1) syntax
This was accidentally removed at some point.
2023-05-09 14:16:40 +00:00
Maxwell G
30676986ca
Update to 7.2.0. 2023-05-09 14:16:40 +00:00
Maxwell G
4f667d7439
Update to 7.1.0. 2023-02-22 17:53:46 -06:00
Maxwell G
59ab1ad4de
Remove duplicate code 2023-02-02 15:51:22 -06:00
Maxwell G
9cffb313fb
Rebuild to fix epel9-next sorting issue 2022-12-12 09:37:51 -06:00
Maxwell G
8535fba3a0
Remove outdated comments 2022-11-19 15:18:08 -06:00
Maxwell G
fcd24a8988
Don't mangle cyberark/conjur/Jenkinsfile shebang
This file is removed later in the file, so there's no need to remove the
shebang.
2022-11-19 15:18:08 -06:00
Maxwell G
b93ba9e8c9
Update to 6.3.0 and spring cleaning.
- 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

- Move filelist %{buildsubdir} so it gets cleaned up

- Remove more unnecessary files

- Don't use `| tee /dev/stderr`

    This does not work properly in a mock chroot.

    Fixes: 6ebad0c

- Overhaul handling of shebangs

    * Don't mangle shebangs in roles' files and templates. This has the
      potential to cause issues with Ansible targets that have different
      filepaths than Fedora.
    * Remove %py3_shebang_fix. Ansible modules are not executable and
      don't need shebangs. Overriding them to /usr/bin/python3.9 has the
      potential to cause issues. Also, removing %py3_shebang_fix makes
      it easier to find development files that need to be removed.
      Upstream development scripts often have `/usr/bin/env python`
      shebangs, so brp-mangle-shebangs's warnings alert us to their
      presence.

- Use 'find|xargs' instead of 'find -exec'

    This takes up a fraction of the time, as it avoids spawning a bunch
    of sed processes.

- Relax version constraint

- Fixes: rhbz#2141351

- Use %py3_dist in %ansible_core_requires

    This ensures that ansible-core and ansible's Python versions match.
2022-11-19 15:18:08 -06:00
Kevin Fenzi
aded640ae5 Relax ansible-core dependency. 2022-11-13 14:37:10 -08:00
Maxwell G
b599d83174
Relax version constraint 2022-11-12 23:07:12 -06:00
Maxwell G
dfb2f215a7 Ensure correct version of ansible-core is available at buildtime.
Implement support for epel8.
2022-05-10 16:53:32 -05:00
11 changed files with 343 additions and 208 deletions

View file

@ -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

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

119
.gitignore vendored
View file

@ -1,117 +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-*.tar.gz
/ansible-*/

46
ansible-install-licenses.sh Executable file
View file

@ -0,0 +1,46 @@
#!/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}"
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

77
ansible-prep.sh Executable file
View file

@ -0,0 +1,77 @@
#!/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
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/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/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/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
# 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 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}'

View file

@ -1,5 +1,9 @@
addFilter("E: non-executable-script")
addFilter("W: files-duplicate")
addFilter("E: files-duplicated-waste")
addFilter("W: name-repeated-in-summary")
# This is not egrep, it's "find -regextype posix-egrep"
addFilter("W: deprecated-grep")
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(r"E: non-executable-script.*ansible_collections/[^/]+/[^/]+/roles/[^/]+/(files|templates)/")
addFilter("W: no-manual-page-for-binary ansible-community")
addFilter(r"E: zero-length")

View file

@ -1,31 +1,77 @@
# SPDX-License-Identifier: MIT
# Copyright (C) Fedora Project Authors
# License Text: https://spdx.org/licenses/MIT.html
# Compatibility #
#############################################################################
# This specfile should remain compatible with EPEL 9 and stable Fedoras. #
# The EPEL 8 specfile is separately maintained, #
# but the ansible-prep.sh and ansible-install-license.sh scripts are shared #
# across branches. #
#############################################################################
# TODO: Re-enable docs and tests once possible
%global with_docs 0
%global with_tests 0
%global ansible_licensedir %{_defaultlicensedir}/ansible
%global ansible_docdir %{_defaultdocdir}/ansible
%bcond docs 0
%bcond tests 0
# disable the python -s shbang flag as we want to be able to find non system modules
# NB: We cannot use https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_py3_shebang_S on RHEL 9.
%global py3_shebang_flags %(echo %{py3_shebang_flags} | sed 's|s||')
# 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}
Name: ansible
Summary: Curated set of Ansible collections included in addition to ansible-core
Version: 5.4.0
%if %{defined el9}
# https://bugzilla.redhat.com/2221820 :(
Epoch: 1
%endif
Version: 7.7.0
%global uversion %{version_no_tilde %{quote:%nil}}
Release: 1%{?dist}
License: GPLv3+
Source0: %{pypi_source}
# In addition to GPL-3.0-or-later, the following licenses apply.
# License text that solely exists in file headers were not considered.
# Instead, the overall license was determined by searching for license files
# This is the only the practical way to handle license scanning for a project
# of this size.
# All collections must be primarily licensed under GPL-3.0-or-later, so top
# level license files are excluded.
# find /usr/share/licenses/ansible -type f | grep -vEe '(COPYING|LICENSE)(\.(txt|md))?$' -e 'GPL' | xargs -n1 basename | sort -u
#
# Apache-2.0.txt
# Apache-license.txt
# BSD-2-Clause.txt
# BSD-3-Clause.txt
# MIT.txt
# MPL-2.0.txt
# PSF-2.0.txt
# 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
BuildRequires: dos2unix
BuildRequires: findutils
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: hardlink
BuildRequires: python%{python3_pkgversion}-devel
%if 0%{?with_tests}
%if %{with tests}
# TODO build-requires
%endif
%if 0%{?with_docs}
%if %{with docs}
# TODO build-requires
%endif
%description
Ansible is a radically simple model-driven configuration management,
multi-node deployment, and remote task execution system. Ansible works
@ -36,78 +82,141 @@ are transferred to managed machines automatically.
This package provides a curated set of Ansible collections included in addition
to ansible-core.
%prep
%autosetup
%autosetup -p1 -n %{name}-%{uversion}
# 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"
# Relax ansible-core dependency to avoid FTI bugs on EPEL
#
# 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.
# 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)$"
find ansible_collections -regextype posix-egrep -regex "${hidden_pattern}" -print -depth -exec rm -rf {} \;
sed "s|ansible-core ~=|ansible-core >=|" setup.py > setup.py.bak
# Verify
set -o pipefail
grep -B1 "ansible-core >=" setup.py.bak | grep -F 'install_requires=['
%if %{defined rhel}
mv setup.py.bak setup.py
%endif
# TODO: Delete (bulky) tests for now but we should run sanity and unit tests soon.
find ansible_collections -type d -wholename "*tests/integration" -print -depth -exec rm -rf {} \;
find ansible_collections -type d -wholename "*tests/unit" -print -depth -exec rm -rf {} \;
find ansible_collections -type d -wholename "*tests/sanity" -print -depth -exec rm -rf {} \;
find ansible_collections -type d -wholename "*tests/regression" -print -depth -exec rm -rf {} \;
# ansible-prep.sh
%{S:1}
# https://github.com/ansible-collections/kubernetes.core/pull/298
rm -rf ansible_collections/kubernetes/core/molecule
# 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 -f ansible_collections/community/zabbix/roles/zabbix_agent/files/win_sample/doSomething.ps1
echo "[END] Delete unnecessary files and directories"
%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
# Install docs and licenses
(
mkdir -p "%{buildroot}%{ansible_docdir}" "%{buildroot}%{ansible_licensedir}"
cd ansible_collections
# This finds the license file for each collection, copies it to
# `%%{ansible_licensedir}/collection_namespace/collection_name`, and then adds
# `%%license /path/to/license` to the %%files list. See `man find` for more info.
# The extra percent signs are needed to escape RPM.
find . -mindepth 3 -type f \( -name LICENSE -o -name COPYING \) \
-exec cp -p --parents '{}' '%{buildroot}%{ansible_licensedir}' \; \
-printf '%%%%license %%%%{ansible_licensedir}/%%P\n' | tee -a ../files.list
# This does the same thing, but for READMEs.
find . -mindepth 3 -type f -name 'README.*' \
-exec cp -p --parents '{}' '%{buildroot}%{ansible_docdir}' \; \
-printf '%%%%doc %%%%{ansible_docdir}/%%P\n' | tee -a ../files.list
mkdir licenses docs
cd ansible_collections
# ansible-license-install.sh
%{S:2} \
"$(readlink -f ../licenses)" \
"$(readlink -f ../docs)" \
)
%generate_buildrequires
%pyproject_buildrequires
%build
%py3_shebang_fix ansible_collections
%pyproject_wheel
%install
%pyproject_install
# This adds over a minute to the build due to the size of the ansible package.
# It's better to manually specify the paths in %%files...
# %%pyproject_save_files ansible_collections
mkdir -p %{buildroot}%{_licensedir}/ansible %{buildroot}%{_docdir}/ansible
mv licenses %{buildroot}%{_licensedir}/ansible/ansible_collections
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}
%if %{with tests}
# TODO: Run tests
%endif
%files -f files.list
%files
%license COPYING
%doc README.rst PKG-INFO porting_guide_5.rst CHANGELOG-v5.rst
%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.
# 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}.dist-info/
%changelog
* Tue Jul 18 2023 Maxwell G <maxwell@gtmx.me> - 1:7.7.0-1
- Downgrade to 7.7.0.
- Build for python3.9.
- Relates: rhbz#2221820
* Tue May 30 2023 Maxwell G <maxwell@gtmx.me> - 8.0.0-1
- Update to 8.0.0.
* Tue May 23 2023 Maxwell G <maxwell@gtmx.me> - 8.0.0~rc1-1
- Update to 8.0.0~rc1.
* Tue May 16 2023 Maxwell G <maxwell@gtmx.me> - 8.0.0~b1-1
- Update to 8.0.0~b1.
* Wed May 03 2023 Maxwell G <maxwell@gtmx.me> - 8.0.0~a3-1
- Update to 8.0.0~a3.
* Thu Apr 27 2023 Maxwell G <maxwell@gtmx.me> - 8.0.0~a2-1
- Update to 8.0.0~a2.
* Thu Apr 20 2023 Maxwell G <maxwell@gtmx.me> - 8.0.0~a1-1
- Update to 8.0.0~a1.
* Wed Mar 29 2023 Maxwell G <maxwell@gtmx.me> - 7.4.0-1
- Update to 7.4.0.
* Wed Mar 01 2023 Maxwell G <maxwell@gtmx.me> - 7.3.0-1
- Update to 7.3.0.
* Fri Feb 10 2023 Maxwell G <gotmax@e.email> - 7.2.0-1
- Update to 7.2.0.
* Thu Feb 02 2023 Maxwell G <gotmax@e.email> - 7.1.0-1
- Update to 7.1.0.
* Mon Dec 12 2022 Maxwell G <gotmax@e.email> - 6.3.0-2
- Rebuild to fix epel9-next sorting issue
* Thu Nov 17 2022 Maxwell G <gotmax@e.email> - 6.3.0-1
- Update to 6.3.0.
- 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
* Sun Nov 13 2022 Kevin Fenzi <kevin@scrye.com> - 5.4.0-3
- Relax ansible-core dependency.
* Mon Apr 25 2022 Maxwell G <gotmax@e.email> - 5.4.0-2
- Ensure correct version of ansible-core is available at buildtime.
- Implement support for epel8.
* Tue Feb 22 2022 David Moreau-Simard <moi@dmsimard.com> - 5.4.0-1
- Update to latest upstream release

13
gating.yaml Normal file
View file

@ -0,0 +1,13 @@
# Copyright (C) 2023 Maxwell G <maxwell@gtmx.me>
# 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}
...

View file

@ -1 +1 @@
SHA512 (ansible-5.4.0.tar.gz) = 7065c7d16a3bb13db27a3ec99c33c48e9d4abb4bec8267751e3d8df89da7d0948a8415b50b8fabd05f6a97fba661714f08f8473ae145fcb323dd83f6c7349a6d
SHA512 (ansible-7.7.0.tar.gz) = 7da6845c9a68f2b8c10cf3e4cc6ea347861d5b59daa6ac895731ac79b733c6724d234345054fe9e3bf4ea460345b9026492fda42dce22bfbc027c9b4de093fd9

17
tests/smoke.fmf Normal file
View file

@ -0,0 +1,17 @@
# Copyright (C) 2023 Maxwell G <maxwell@gtmx.me>
# 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

7
tests/smoke.sh Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/bash -x
# Copyright (C) 2023 Maxwell G <maxwell@gtmx.me>
# SPDX-License-Identifier: MIT
set -euo pipefail
curl -L https://src.fedoraproject.org/rpms/ansible-core/raw/rawhide/f/tests/smoke.sh | bash -x