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
This commit is contained in:
Noriko Hosoi 2021-06-16 08:43:19 -07:00
parent b3d4ab2c64
commit 5645c1f150

View File

@ -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