Blob Blame History Raw
# Helper macros originally from macros.ansible by Igor Raits <ignatenkobrain>
# On RHEL, not available, so we must define those macros locally
# On Fedora, provided by ansible-packaging
# ansible-core is available on RHEL 8.6 and newer at buildtime.

Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{collection_version}

# Untar and copy everything instead of galaxy-installing the built artifact when ansible is not available
%define ansible_collection_build() tar -cf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz .
%define ansible_collection_install() mkdir -p %{buildroot}%{ansible_collection_files}%{collection_name}; (cd %{buildroot}%{ansible_collection_files}%{collection_name}; tar -xf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz)

%define ansible_roles_dir %{_datadir}/ansible/roles
%define ansible_collections_dir %{_datadir}/ansible/collections/ansible_collections

%global ansible_collection_files %{ansible_collections_dir}/%{collection_namespace}/

# the python3 macro is not defined on rhel7 so define it here
%global python3 python3