use newly installed python for byte compiling (#787498) the macros.pybytecompile way

Signed-off-by: Thomas Spura <thomas.spura@gmail.com>
This commit is contained in:
Thomas Spura 2012-02-06 11:28:14 +01:00
parent 7ddc1a8526
commit 4bba1dcb4a

View File

@ -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 <tomspur@fedoraproject.org> - 3.2.1-4
- use newly installed python for byte compiling (now for real)
* Sun Feb 5 2012 Thomas Spura <tomspur@fedoraproject.org> - 3.2.1-3
- use newly installed python for byte compiling (#787498)