diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 597f835..927f010 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 33 +Release: 34 Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -112,6 +112,9 @@ install -Dpm 644 %{SOURCE150} \ %changelog +* Tue Nov 08 2022 Maxwell G - 8-34 +- Set %%__python3 to /usr/bin/python3.6 by default + * Wed Aug 24 2022 Iñaki Úcar - 8-33 - Backport java_arches macro from Fedora diff --git a/macros.zzz-epel-override b/macros.zzz-epel-override index d26c90e..bf79bff 100644 --- a/macros.zzz-epel-override +++ b/macros.zzz-epel-override @@ -9,7 +9,23 @@ # and the default is /usr/libexec/platform-python. # Usually, we don't want EPEL packages to use platform-python. # Packages that want to do that can explicitly override this. -%__python3 /usr/bin/python%{_python3_pkgversion_with_dot} +# +# When %%python3_pkgveresion is set to 3 (i.e. the default), we override +# %%__python3 to /usr/bin/python3.6 to ensure that programs are always run with +# python3.6, even if /usr/bin/python3 is a symlink to a different interpreter. +# +# See https://lists.fedoraproject.org/archives/list/epel-devel@lists.fedoraproject.org/thread/RE3PG72B5AX7NTACPDSBGOWCMN7I3OQJ/ + +%__python3 %{lua: +local bin = "/usr/bin/python" +if rpm.expand("%python3_pkgversion") == "3" then + bin = bin .. "3.6" +else + bin = bin .. rpm.expand("%{_python3_pkgversion_with_dot}") +end +print(bin) +} + # RHEL 8's %%pytest does not work properly on non-default Python versions. # Backported from https://src.fedoraproject.org/rpms/python-rpm-macros/c/02536540768555dde6d675935db45df81bcab7bf?branch=rawhide