Add sanity check for new license files

This commit is contained in:
Maxwell G 2022-11-08 20:11:48 -06:00
parent bfeb92d7ad
commit 46737d61f4
No known key found for this signature in database
GPG Key ID: F79E4E25E8C661F8

View File

@ -206,6 +206,13 @@ cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/
# These files are needed for the unit tests, so we don't remove them in %%prep
find %{buildroot}/%{python3_sitelib} -name .travis.yml -type f -delete
# We install licenses in this manner so we don't miss new licenses:
# 1. Copy all files in licenses to %%{_pkglicensedir}.
# 2. List the files explicitly in %%files.
# 3. The build will fail with unpackaged file errors if license
# files aren't accounted for.
%global _pkglicensedir %{_licensedir}/ansible-core
install -Dpm 0644 licenses/* -t %{buildroot}%{_pkglicensedir}
%check
%if %{with tests}
@ -215,7 +222,8 @@ make PYTHON=%{python3} tests-py3
%files -f %{pyproject_files}
%license COPYING licenses/{Apache-License,MIT-license,PSF-license,simplified_bsd}.txt
%license COPYING
%license %{_pkglicensedir}/{Apache-License,MIT-license,PSF-license,simplified_bsd}.txt
%doc README.rst changelogs/CHANGELOG-v2.1?.rst
%dir %{_sysconfdir}/ansible/
%config(noreplace) %{_sysconfdir}/ansible/*