| |
@@ -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
|
| |
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.
After:
Before:
Relates: https://lists.fedoraproject.org/archives/list/epel-devel@lists.fedoraproject.org/thread/RE3PG72B5AX7NTACPDSBGOWCMN7I3OQJ/
CC: @churchyard