From 46737d61f495f36024a01c3ee5f4036e7a53c71e Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 8 Nov 2022 20:11:48 -0600 Subject: [PATCH] Add sanity check for new license files --- ansible-core.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ansible-core.spec b/ansible-core.spec index 7e03a9e..7b19f8c 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -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/*