| |
@@ -1,22 +1,3 @@
|
| |
- # Define the Python interpreter paths in the SRPM macros so that
|
| |
- # - they can be used in Build/Requires
|
| |
- # - they can be used in non-Python packages where requiring pythonX-devel would
|
| |
- # be an overkill
|
| |
-
|
| |
- # use the underscored macros to redefine the behavior of %%python3_version etc.
|
| |
- %__python2 /usr/bin/python2
|
| |
- %__python3 /usr/bin/python3
|
| |
-
|
| |
- # use the non-underscored macros to refer to Python in spec, etc.
|
| |
- %python2 %__python2
|
| |
- %python3 %__python3
|
| |
-
|
| |
- # See https://fedoraproject.org/wiki/Changes/PythonMacroError
|
| |
- %__python %{error:attempt to use unversioned python, define %%__python to %{__python2} or %{__python3} explicitly}
|
| |
-
|
| |
- # Users can use %%python only if they redefined %%__python (e.g. to %%__python3)
|
| |
- %python %__python
|
| |
-
|
| |
# There are multiple Python 3 versions packaged, but only one can be the "main" version
|
| |
# That means that it owns the "python3" namespace:
|
| |
# - python3 package name
|
| |
@@ -49,6 +30,25 @@
|
| |
# Alternatively, it can be overridden in spec (e.g. to "3.8") when building for alternate Python stacks.
|
| |
%python3_pkgversion 3
|
| |
|
| |
+ # Define the Python interpreter paths in the SRPM macros so that
|
| |
+ # - they can be used in Build/Requires
|
| |
+ # - they can be used in non-Python packages where requiring pythonX-devel would
|
| |
+ # be an overkill
|
| |
+
|
| |
+ # use the underscored macros to redefine the behavior of %%python3_version etc.
|
| |
+ %__python2 /usr/bin/python2
|
| |
+ %__python3 /usr/bin/python%{python3_pkgversion}
|
| |
+
|
| |
+ # use the non-underscored macros to refer to Python in spec, etc.
|
| |
+ %python2 %__python2
|
| |
+ %python3 %__python3
|
| |
+
|
| |
+ # See https://fedoraproject.org/wiki/Changes/PythonMacroError
|
| |
+ %__python %{error:attempt to use unversioned python, define %%__python to %{__python2} or %{__python3} explicitly}
|
| |
+
|
| |
+ # Users can use %%python only if they redefined %%__python (e.g. to %%__python3)
|
| |
+ %python %__python
|
| |
+
|
| |
# Define where Python wheels will be stored and the prefix of -wheel packages
|
| |
# - In Fedora we want wheel subpackages named e.g. `python-pip-wheel` that
|
| |
# install packages into `/usr/share/python-wheels`. Both names are not
|
| |
I.e. when %python3_pkgversion is 3.12, %__python3 is /usr/bin/python3.12
We assume that when packagers pacakge for Python 3.X, they want to change both
%python3_pkgversion and %__python3 value.
Hence instead of copy-pasting this:
They just need to do:
Packagers who want to change the value of %__python3 without touching
%python3_pkgversion can still do it:
Related to https://bugzilla.redhat.com/1821489