From ae2fc1c0436586c7307266799ef50fec5e2edb8d Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Mon, 6 Feb 2012 11:28:14 +0100 Subject: [PATCH] use newly installed python for byte compiling (#787498) the macros.pybytecompile way Signed-off-by: Thomas Spura --- python3.spec | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index 76fad62..46112d6 100644 --- a/python3.spec +++ b/python3.spec @@ -917,10 +917,16 @@ iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.co # Do bytecompilation with the newly installed interpreter. # This is similar to the script in macros.pybytecompile +# compile *.pyo find %{buildroot} -type f -a -name "*.py" -print0 | \ - LD_LIBRARY_PATH="%{buildroot}/%{dynload_dir}/:%{buildroot}/%{_libdir}" \ - PYTHONPATH="%{buildroot}/%{_libdir}python%{pybasever} %{buildroot}/%{_libdir}python%{pybasever}/site-packages" \ + LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \ + PYTHONPATH="%{buildroot}%{_libdir}python%{pybasever} %{buildroot}/%{_libdir}python%{pybasever}/site-packages" \ xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in sys.argv[1:]]' || : +# compile *.pyc +find %{buildroot} -type f -a -name "*.py" -print0 | \ + LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \ + PYTHONPATH="%{buildroot}%{_libdir}python%{pybasever} %{buildroot}/%{_libdir}python%{pybasever}/site-packages" \ + xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=0) for f in sys.argv[1:]]' || : # Fixup permissions for shared libraries from non-standard 555 to standard 755: find %{buildroot} \ @@ -1404,8 +1410,8 @@ rm -fr %{buildroot} # ====================================================== %changelog -* Mon Feb 6 2012 Thomas Spura - 3.2.2-13 -- use newly installed python for byte compiling (#787498) +* Thu Feb 9 2012 Thomas Spura - 3.2.2-13 +- use newly installed python for byte compiling (now for real) * Sun Feb 5 2012 Thomas Spura - 3.2.2-12 - use newly installed python for byte compiling (#787498)