From 4bba1dcb4ac8fa5d92b69ec3848d0f24835d78f6 Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Feb 09 2012 21:17:57 +0000 Subject: use newly installed python for byte compiling (#787498) the macros.pybytecompile way Signed-off-by: Thomas Spura --- diff --git a/python3.spec b/python3.spec index 51377dd..ee9b319 100644 --- a/python3.spec +++ b/python3.spec @@ -118,7 +118,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -767,9 +767,17 @@ iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.co # character encodings within python source code # Do bytecompilation with the newly installed interpreter. -LD_LIBRARY_PATH=%{buildroot}/%{dynload_dir}/ \ - PYTHONPATH="%{buildroot}/%{_libdir}python%{pybasever} %{buildroot}/%{_libdir}python%{pybasever}/site-packages" \ - /usr/lib/rpm/brp-python-bytecompile %{buildroot}%{_bindir}/python%{pybasever} +# 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" \ + 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} \ @@ -1310,6 +1318,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Feb 9 2012 Thomas Spura - 3.2.1-4 +- use newly installed python for byte compiling (now for real) + * Sun Feb 5 2012 Thomas Spura - 3.2.1-3 - use newly installed python for byte compiling (#787498)