From ba4fd4f69c551da58680d03fdc7035d7068b4c7c12916d3f9cc8e79b0f08fed4 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 2 Oct 2024 16:19:39 +0000 Subject: [PATCH] - Drop .pyc files from docdir for reproducible builds OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python311?expand=0&rev=144 --- python311.changes | 5 +++++ python311.spec | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/python311.changes b/python311.changes index 20ce575..f4a51d8 100644 --- a/python311.changes +++ b/python311.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Oct 2 16:18:29 UTC 2024 - Matej Cepl + +- Drop .pyc files from docdir for reproducible builds + ------------------------------------------------------------------- Mon Sep 9 16:53:07 UTC 2024 - Matej Cepl diff --git a/python311.spec b/python311.spec index 158d033..8ca6d89 100644 --- a/python311.spec +++ b/python311.spec @@ -792,6 +792,11 @@ LD_LIBRARY_PATH=. ./python -O -c "from py_compile import compile; compile('$FAIL echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-import-failed-hooks.pth %endif +# For the purposes of reproducibility, it is necessary to eliminate any *.pyc files inside documentation dirs +if [ -d %{buildroot}%{_defaultdocdir} ] ; then +find %{buildroot}%{_defaultdocdir} -type f -name \*.pyc -ls -exec rm -vf '{}' \; +fi + %if %{with general} %files -n %{python_pkg_name}-tk %{sitedir}/tkinter