diff --git a/brp-python-bytecompile b/brp-python-bytecompile index 4727feb..f8ca447 100755 --- a/brp-python-bytecompile +++ b/brp-python-bytecompile @@ -1,6 +1,15 @@ #!/bin/bash errors_terminate=$2 + +# Usage of %_python_bytecompile_extra is not allowed anymore +# See: https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_3 +# Therefore $1 ($default_python) is not needed and is invoked with "" by default. +# $default_python stays in the arguments for backward compatibility and $extra for the following check: extra=$3 +if [ 0$extra -eq 1 ]; then + echo -e "%_python_bytecompile_extra is discontinued, use %py_byte_compile instead.\nSee: https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_3" >/dev/stderr + exit 1 +fi # If using normal root, avoid changing anything. if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then @@ -110,35 +119,3 @@ do exit 1 fi done - - -# Handle other locations in the filesystem using the default python implementation -# if extra is set to 0, don't do this -if [ 0$extra -eq 0 ]; then - exit 0 -fi - -# If we don't have a default python interpreter, we cannot proceed -default_python=${1:-/usr/bin/python} -if [ ! -x "$default_python" ]; then - exit 0 -fi - -# Figure out if there are files to be bytecompiled with the default_python at all -# this prevents unnecessary default_python invocation -find "$RPM_BUILD_ROOT" -type f -name "*.py" | grep -Ev "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" || exit 0 - -# Generate normal (.pyc) byte-compiled files. -python_bytecompile "" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/" -if [ $? -ne 0 -a 0$errors_terminate -ne 0 ]; then - # One or more of the files had a syntax error - exit 1 -fi - -# Generate optimized (.pyo) byte-compiled files. -python_bytecompile "-O" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/" -if [ $? -ne 0 -a 0$errors_terminate -ne 0 ]; then - # One or more of the files had a syntax error - exit 1 -fi -exit 0 diff --git a/macros b/macros index 0aa06ec..8a6c7c9 100644 --- a/macros +++ b/macros @@ -232,7 +232,7 @@ print(result) %__brp_strip_lto /usr/lib/rpm/redhat/brp-strip-lto %{__strip} %__brp_strip_comment_note /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} %__brp_strip_static_archive /usr/lib/rpm/brp-strip-static-archive %{__strip} -%__brp_python_bytecompile /usr/lib/rpm/redhat/brp-python-bytecompile "%{__python}" "%{?_python_bytecompile_errors_terminate_build}" "%{?_python_bytecompile_extra}" +%__brp_python_bytecompile /usr/lib/rpm/redhat/brp-python-bytecompile "" "%{?_python_bytecompile_errors_terminate_build}" "%{?_python_bytecompile_extra}" %__brp_python_hardlink /usr/lib/rpm/brp-python-hardlink # __brp_mangle_shebangs_exclude - shebangs to exclude # __brp_mangle_shebangs_exclude_file - file from which to get shebangs to exclude diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 7414291..3ab3da9 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -6,7 +6,7 @@ Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config -Version: 160 +Version: 161 Release: 1%{?dist} # No version specified. License: GPL+ @@ -207,6 +207,10 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua %{_rpmconfigdir}/macros.d/macros.kmp %changelog +* Mon Jun 15 2020 Lumír Balhar - 161-1 +- No more automagic Python bytecompilation (phase 3) + https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_3 + * Thu Jun 04 2020 Igor Raits - 160-1 - Fix broken %%configure