From 5645c1f150dbd73eec8a759468bf6e33a69754d1 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Wed, 16 Jun 2021 08:43:19 -0700 Subject: [PATCH] Update system roles for RHEL7 (1970165) Avoid dynamically using the license macro since the license macro is replaced with the value of License directive in the older rpmbuild. Needs to list excluded files in this hardcoded style since when format_item_for_files is executed, brp-python-bytecompile is not executed yet. Resolves: rhbz#1961404 --- linux-system-roles.spec | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/linux-system-roles.spec b/linux-system-roles.spec index 658c7cf..4a47b3e 100644 --- a/linux-system-roles.spec +++ b/linux-system-roles.spec @@ -502,9 +502,9 @@ format_item_for_files() { else echo "%doc $files_item" fi - elif [[ "$item" == */COPYING* ]] || [[ "$item" == */LICENSE* ]]; then - echo "%%license $files_item" - else + elif [[ "$item" != */COPYING* ]] && [[ "$item" != */LICENSE* ]]; then + # Avoid dynamically using the license macro since the license macro + # is replaced with the value of License directive in the older rpmbuild. echo "$files_item" fi } @@ -575,6 +575,22 @@ fi %{_pkgdocdir}/collection/roles/*/README.html %endif %license %{_pkglicensedir}/* +%license %{installbase}/*/COPYING* +%license %{installbase}/*/LICENSE* +%license %{ansible_collection_files}/%{collection_name}/COPYING* +%license %{ansible_collection_files}/%{collection_name}/LICENSE* +%if 0%{?rhel} < 8 +# Needs to list excluded files in this hardcoded style since when +# format_item_for_files is executed, brp-python-bytecompile is not +# executed yet. +%exclude %{installbase}/*/*.py? +%exclude %{installbase}/*/*/*.py? +%exclude %{installbase}/*/*/*/*.py? +%exclude %{installbase}/*/*/*/*/*.py? +%exclude %{ansible_collection_files}/%{collection_name}/*/*/*.py? +%exclude %{ansible_collection_files}/%{collection_name}/*/*/*/*.py? +%exclude %{ansible_collection_files}/%{collection_name}/*/*/*/*/*.py? +%endif %if %{with collection_artifact} %files collection-artifact