%global collection_namespace community %global collection_name docker %global forgeurl https://github.com/ansible-collections/%{collection_namespace}.%{collection_name} # Only run tests where %%generate_buildrequires and test deps are available. %if 0%{?fedora} %bcond_without tests %else %bcond_with tests %endif Name: ansible-collection-%{collection_namespace}-%{collection_name} Version: 2.5.1 %global tag %{version} %forgemeta Release: 1%{?dist} Summary: Ansible modules and plugins for working with Docker # All files are GPLv3+ except plugins/module_utils/_version.py. License: GPLv3+ and Python URL: %{ansible_collection_url} Source0: %{forgesource} Source1: %{name}.rpmlintrc Patch0: build_ignore-unnecessary-files.patch BuildArch: noarch # Needed for %%py3_shebang_fix. Buildrequires: python3-devel BuildRequires: ansible-packaging # The new ansible-core, specifically, is required for the `build_ignore:` patch and ansible-test to work properly. # Therefore, we cannot rely on ansible-packaging which might pull in ansible 2.9. BuildRequires: ansible-core %if %{with tests} BuildRequires: /usr/bin/ansible-test %endif %description %{name} provides the %{collection_namespace}.%{collection_name} Ansible collection. The collection includes Ansible modules and plugins for working with Docker. %prep %forgeautosetup -p1 %global py3_shbang_opts %{nil} %py3_shebang_fix . # Patch out python3-mock, as per https://fedoraproject.org/wiki/Changes/DeprecatePythonMock. ( files="$(grep -lEr '^(\s*)import mock' || :)" if [ -n "${files}" ]; then xargs sed -i 's|^\(\s*\)import mock|\1from unittest import mock|' <<< ${files} fi ) ( files="$(grep -lEr '^(\s*)from mock import ' || :)" if [ -n "${files}" ]; then xargs sed -i 's|^\(\s*\)from mock import |\1from unittest.mock import |' <<< ${files} fi ) %if %{with tests} %generate_buildrequires temp=$(mktemp) grep -v '^mock$' %{python3_sitelib}/ansible_test/_data/requirements/units.txt > ${temp} %pyproject_buildrequires -N tests/unit/requirements.txt ${temp} %endif %build %ansible_collection_build %install %ansible_collection_install %check %if %{with tests} mkdir -p ../ansible_collections/%{collection_namespace} cp -a $(pwd) ../ansible_collections/%{collection_namespace}/%{collection_name} pushd ../ansible_collections/%{collection_namespace}/%{collection_name} # mkdir -p ansible_collections/%%{collection_namespace} # ln -sr . ansible_collections/%%{collection_namespace}/%%{collection_name} # pushd ansible_collections/%%{collection_namespace}/%%{collection_name} ansible-test units --python-interpreter %{__python3} --local popd %endif %files %license COPYING PSF-license.txt %doc README.md CHANGELOG.rst %{ansible_collection_files} %changelog * Mon May 16 2022 Maxwell G - 2.5.1-1 - Update to 2.5.1. Fixes rhbz#2086832. - Change license from `GPLv3+` > `GPLv3+ and Python` * Sat May 14 2022 Maxwell G - 2.5.0-1 - Update to 2.5.0. Fixes rhbz#2086185. - Run unit tests. - Rebuild for new ansible-packaging. * Mon Apr 25 2022 Maxwell G - 2.4.0-1 - Update to 2.4.0. * Wed Apr 06 2022 Maxwell G - 2.3.0-1 - Preform initial import (rhbz#2028702). * Fri Apr 01 2022 Maxwell G - 2.3.0-0 - Update to 2.3.0. * Mon Feb 21 2022 Maxwell G - 2.2.0-1 - Update to 2.2.0. Fix shebangs. Switch to ansible-packaging. * Thu Dec 16 2021 Maxwell G - 2.0.2-1 - Update to 2.0.2. * Thu Dec 02 2021 Maxwell G - 2.0.1-1 - Initial package