From e9de674184fd6d2c273dded046f1552f6283e116 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Nov 18 2022 00:52:08 +0000 Subject: fix "Move filelist %{buildsubdir} so it gets cleaned up" The previous implementation didn't actually work; %{buildsubdir} was undefined when %filelist was defined. Fixes: 97dd8c8d95aa88b3000b954664df880d63f431f4 --- diff --git a/ansible.spec b/ansible.spec index 9daeea3..8da9381 100644 --- a/ansible.spec +++ b/ansible.spec @@ -18,8 +18,6 @@ %global __brp_mangle_shebangs_exclude_from ^%{python3_sitelib}/ansible_collections/[^/]+/[^/]+/roles/[^/]+/(files|templates)/.*$ %global __requires_exclude_from %{?__requires_exclude_from:%__requires_exclude_from|}%{__brp_mangle_shebangs_exclude_from} -%global filelist %{_builddir}%{?buildsubdir:/%{buildsubdir}}/files.list - %if 0%{?rhel} == 8 # RHEL 8's ansible-core package is built using Python 3.8, which is not the default version. %define python3_pkgversion 39 @@ -157,6 +155,8 @@ find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{ %install %py3_install +%global filelist %{_builddir}/%{buildsubdir}/files.list + # Install docs and licenses ( mkdir -p "%{buildroot}%{ansible_docdir}" "%{buildroot}%{ansible_licensedir}" @@ -169,13 +169,13 @@ find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{ dirname="$(dirname %{buildroot}%{ansible_licensedir}/${f})" mkdir -p "${dirname}" mv "${f}" "${dirname}" - tee -a %{_builddir}/files.list << EOF + tee -a %{filelist} << EOF %%license %%{ansible_licensedir}/${f} EOF done for f in $(find -mindepth 3 -iname 'LICENSES' -type d); do cp -rfp --parents ${f} %{buildroot}%{ansible_licensedir} - echo "%%license %%{ansible_licensedir}/${f}" >> %{_builddir}/files.list + echo "%%license %%{ansible_licensedir}/${f}" >> %{filelist} done # This does the same thing, but for READMEs. @@ -183,7 +183,7 @@ EOF dirname="$(dirname %{buildroot}%{ansible_docdir}/${f})" mkdir -p "${dirname}" mv "${f}" "${dirname}" - tee -a %{_builddir}/files.list << EOF + tee -a %{filelist} << EOF %%doc %%{ansible_docdir}/${f} EOF done @@ -196,7 +196,7 @@ hardlink -v %{buildroot}%{ansible_licensedir} # TODO: Run tests %endif -%files -f %{filelist} +%files -f files.list %license COPYING %doc README.rst PKG-INFO porting_guide_?.rst CHANGELOG-v?.rst %{_bindir}/ansible-community