diff --git a/ansible-2.9.27-oracle.patch b/ansible-2.9.27-oracle.patch new file mode 100644 index 0000000..ad15a67 --- /dev/null +++ b/ansible-2.9.27-oracle.patch @@ -0,0 +1,12 @@ +diff --color -Nur ansible-2.9.27.orig/lib/ansible/config/base.yml ansible-2.9.27/lib/ansible/config/b +ase.yml +--- ansible-2.9.27.orig/lib/ansible/config/base.yml 2021-10-11 08:18:55.681846900 -0700 ++++ ansible-2.9.27/lib/ansible/config/base.yml 2021-11-01 10:40:38.928873116 -0700 +@@ -1450,6 +1450,7 @@ + '8': /usr/libexec/platform-python + fedora: + '23': /usr/bin/python3 ++ oracle: *rhelish + redhat: *rhelish + rhel: *rhelish + ubuntu: diff --git a/ansible-generator b/ansible-generator deleted file mode 100755 index b7450b1..0000000 --- a/ansible-generator +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/python3 - -import argparse -import json -import re -import sys - - -def main(): - parser = argparse.ArgumentParser() - group = parser.add_mutually_exclusive_group(required=True) - group.add_argument( - "-P", "--provides", action="store_const", const="provides", dest="action" - ) - group.add_argument( - "-R", "--requires", action="store_const", const="requires", dest="action" - ) - args = parser.parse_args() - - files = sys.stdin.read().splitlines() - - for f in files: - with open(f, "r") as fobj: - info = json.load(fobj)["collection_info"] - if args.action == "provides": - print( - f"ansible-collection({info['namespace']}.{info['name']}) = {info['version']}" - ) - if args.action == "requires": - print("(ansible >= 2.9.0 or ansible-base > 2.10.0)") - for dep, req in info.get("dependencies", {}).items(): - print(f"ansible-collection({dep})", end="") - if req == "*": - print() - continue - m = re.match(r"^>=(\d+\.\d+\.\d+)$", req) - if m: - print(f" >= {m.group(1)}") - continue - raise NotImplementedError( - "Generation of dependencies different than '*' or '>=' is not supported yet" - ) - - -if __name__ == "__main__": - main() diff --git a/ansible.attr b/ansible.attr deleted file mode 100644 index 997dafa..0000000 --- a/ansible.attr +++ /dev/null @@ -1,3 +0,0 @@ -%__ansible_provides %{_rpmconfigdir}/ansible-generator --provides -%__ansible_requires %{_rpmconfigdir}/ansible-generator --requires -%__ansible_path ^%{_datadir}/ansible/collections/ansible_collections/[^/]+/[^/]+/MANIFEST.json$ diff --git a/ansible.spec b/ansible.spec index d733091..b62fe8b 100644 --- a/ansible.spec +++ b/ansible.spec @@ -1,11 +1,11 @@ # Note to maintainers: main and all fedora branches can be merged. -# epel8 and epel7 and should be updated seperately. +# epel8 and epel7 and should be updated seperately. # in Fedora and EPEL8 build with docs and tests by default %global with_docs 1 -# Disable tests on f29/f30 and epel8 for now. -# epel8 is missing 2 required packages. +# Disable tests on f29/f30 and epel8 for now. +# epel8 is missing 2 required packages. # fedora29 and fedora30 have too old pytest %if 0%{?fedora} < 31 || 0%{?rhel} >= 8 %global with_tests 0 @@ -16,14 +16,15 @@ Name: ansible Summary: SSH-based configuration management, deployment, and task execution system Version: 2.9.27 -Release: 1%{?dist} +Release: 4%{?dist} -License: GPLv3+ +# The main license is GPLv3+. Many of the files in lib/ansible/module_utils +# are BSD licensed. There are various files scattered throughout the codebase +# containing code under different licenses. +# SPDX-License-Identifier: GPL-3.0-or-later and BSD-2-Clause and PSF-2.0 and MIT and Apache-2.0 +License: GPLv3+ and BSD and Python and MIT and ASL 2.0 Source0: https://releases.ansible.com/ansible/%{name}-%{version}.tar.gz -Source1: ansible.attr -Source2: ansible-generator -Source3: macros.ansible -Url: http://ansible.com +Url: https://ansible.com BuildArch: noarch # add patch for Rocky linux: rhbz#1968728 @@ -44,8 +45,38 @@ Patch5: ansible-2.9.27-pyyaml-6-compat.patch # compatibility with openssl v3 Patch6: ansible-2.9.27-openssl-3-compat.patch +# add patch for Oracle linux: rhbz#2018369 +Patch7: ansible-2.9.27-oracle.patch +# Virtual provides for bundled libraries +# Search for `_BUNDLED_METADATA` to find them + +# lib/ansible/module_utils/urls.py +# SPDX-License-Identifier: BSD-2-Clause and PSF-2.0 +# Fedora-License-Identifier: BSD and Python +Provides: bundled(python3dist(backports-ssl-match-hostname)) = 3.7.0.1 + +# lib/ansible/module_utils/distro/* +# SPDX-License-Identifier: Apache-2.0 +# Fedora-License-Identifier: ASL 2.0 +Provides: bundled(python3dist(distro)) = 1.4.0 + +# lib/ansible/module_utils/six/* +# SPDX-License-Identifier: MIT +# Fedora-License-Identifier: MIT +Provides: bundled(python3dist(six)) = 1.12.0 + +# lib/ansible/module_utils/compat/selectors.py +# SPDX-License-Identifier: GPL-3.0-or-later +# Fedora-License-Identifier: GPLv3+ +Provides: bundled(python3dist(selectors2)) = 1.1.1 + +# lib/ansible/module_utils/compat/ipaddress.py +# SPDX-License-Identifier: PSF-2.0 +# Fedora-License-Identifier: Python +Provides: bundled(python3dist(ipaddress)) = 1.0.22 + # We used to have a ansible-python3 package that a number of other things -# started depending on, so we should now provide/obsolete it until they +# started depending on, so we should now provide/obsolete it until they # can all adjust to just needing ansible. Provides: ansible-python3 = %{version}-%{release} Obsoletes: ansible-python3 < %{version}-%{release} @@ -162,7 +193,6 @@ developed for ansible. %prep %autosetup -p1 -cp -a %{S:1} %{S:2} %{S:3} . %build @@ -218,27 +248,23 @@ if [ "$SYSTEM_LOCATIONS" != "$UPSTREAM_SYSTEM_LOCATIONS" ] ; then exit 1 fi -mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/plugins/ +mkdir -p %{buildroot}%{_datadir}/ansible/plugins/ for location in $DATADIR_LOCATIONS ; do - mkdir $RPM_BUILD_ROOT"$location" + mkdir %{buildroot}"$location" done -mkdir -p $RPM_BUILD_ROOT/etc/ansible/ -mkdir -p $RPM_BUILD_ROOT/etc/ansible/roles/ +mkdir -p %{buildroot}%{_sysconfdir}/ansible/ +mkdir -p %{buildroot}%{_sysconfdir}/ansible/roles/ -cp examples/hosts $RPM_BUILD_ROOT/etc/ansible/ -cp examples/ansible.cfg $RPM_BUILD_ROOT/etc/ansible/ -mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1 -cp -v docs/man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1/ +cp examples/hosts %{buildroot}%{_sysconfdir}/ansible/ +cp examples/ansible.cfg %{buildroot}%{_sysconfdir}/ansible/ +mkdir -p %{buildroot}%{_mandir}/man1 +cp -v docs/man/man1/*.1 %{buildroot}%{_mandir}/man1/ cp -pr docs/docsite/rst . %if 0%{?with_docs} cp -pr docs/docsite/_build/html %{_builddir}/%{name}-%{version}/html %endif -install -Dpm0644 -t %{buildroot}%{_fileattrsdir} ansible.attr -install -Dpm0644 -t %{buildroot}%{_rpmmacrodir} macros.ansible -install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} ansible-generator - %check %if 0%{?with_tests} @@ -256,6 +282,10 @@ make PYTHON=/usr/bin/python3 tests-py3 %files %license COPYING +%license licenses/Apache-License.txt +%license licenses/MIT-license.txt +%license licenses/PSF-license.txt +%license licenses/simplified_bsd.txt %doc README.rst PKG-INFO changelogs/CHANGELOG-v2.9.rst %doc %{_mandir}/man1/ansible* %config(noreplace) %{_sysconfdir}/ansible/ @@ -264,9 +294,6 @@ make PYTHON=/usr/bin/python3 tests-py3 %{python3_sitelib}/ansible %{python3_sitelib}/ansible_test %{python3_sitelib}/*egg-info -%{_fileattrsdir}/ansible.attr -%{_rpmmacrodir}/macros.ansible -%{_rpmconfigdir}/ansible-generator %exclude %{_bindir}/ansible-test %exclude %{python3_sitelib}/ansible_test @@ -281,6 +308,18 @@ make PYTHON=/usr/bin/python3 tests-py3 %{python3_sitelib}/ansible_test %changelog +* Sun Sep 25 2022 Maxwell G - 2.9.27-4 +- Remove ansible-packaging dependency +- Related: #2121892 and #2126557. + +* Sun Jan 16 2022 Maxwell G - 2.9.27-3 +- Remove macros in favor of `ansible-packaging` +- Add virtual provides for bundled libraries and add missing licenses +- Minor cleanup + +* 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 - Update to 2.9.27. Fixes rhbz#2012918 diff --git a/macros.ansible b/macros.ansible deleted file mode 100644 index c8c91fb..0000000 --- a/macros.ansible +++ /dev/null @@ -1,7 +0,0 @@ -%ansible_collection_url() https://galaxy.ansible.com/%{collection_namespace}/%{collection_name} - -%ansible_collection_build() ansible-galaxy collection build - -%ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{version}.tar.gz - -%ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/