Refactor %ansible_collection_install

This change removes %ansible_collection_install's dependence on the
%collection_namespace and %collection_name macros. Now, the macro uses
the new helper script which extracts this information from galaxy.yml.

Parsing the galaxy.yml instead of using %{version} to determine the
collection version also lends another benefit: it allows us to package
pre-releases. Previously, discrepancies between %{version} and the
upstream version (eg. "3.0.0~rc1" vs "3.0.0-rc1") broke the macro.
epel8
Maxwell G 2 years ago
parent bc337bd8e4
commit deee147c95
No known key found for this signature in database
GPG Key ID: F79E4E25E8C661F8

@ -1,9 +1,18 @@
# Stores ephemeral data that's created by %%ansible_collection_install
# and used by other macros.
%__ansible_builddir %{_builddir}/%{?buildsubdir:%{buildsubdir}/}.ansible-packaging
%ansible_roles_dir %{_datadir}/ansible/roles
%ansible_collections_dir %{_datadir}/ansible/collections/ansible_collections
%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_install() %{shrink:
%{_rpmconfigdir}/ansible_collection.py install
--collections-dir %{buildroot}%{ansible_collections_dir}
--filelist %{ansible_collection_filelist}
}
%ansible_test_unit() %{expand:\\\
mkdir -p ../ansible_collections/%{collection_namespace}

Loading…
Cancel
Save