Define %python2 and %python3
See https://pagure.io/packaging-committee/issue/907 Redefine %__pythonX to change the behavior of %pythonX, %pythonX_version, etc. Use %pythonX in spec.
This commit is contained in:
parent
8f067ff385
commit
5905bccc30
@ -1,4 +1,9 @@
|
|||||||
|
# use the underscored macros to redefine the behavior of %%python2_version etc.
|
||||||
%__python2 /usr/bin/python2
|
%__python2 /usr/bin/python2
|
||||||
|
|
||||||
|
# use the non-underscored macros to refer to Python in spec, etc.
|
||||||
|
%python2 %__python2
|
||||||
|
|
||||||
%python2_sitelib %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
%python2_sitelib %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
||||||
%python2_sitearch %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
|
%python2_sitearch %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
|
||||||
%python2_version %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
|
%python2_version %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
|
# use the underscored macros to redefine the behavior of %%python3_version etc.
|
||||||
%__python3 /usr/bin/python3
|
%__python3 /usr/bin/python3
|
||||||
|
|
||||||
|
# use the non-underscored macros to refer to Python in spec, etc.
|
||||||
|
%python3 %__python3
|
||||||
|
|
||||||
%python3_sitelib %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
%python3_sitelib %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
||||||
%python3_sitearch %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
|
%python3_sitearch %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
|
||||||
%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3])")
|
%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3])")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Name: python-rpm-macros
|
Name: python-rpm-macros
|
||||||
Version: 3
|
Version: 3
|
||||||
Release: 37%{?dist}
|
Release: 38%{?dist}
|
||||||
Summary: The unversioned Python RPM macros
|
Summary: The unversioned Python RPM macros
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
@ -71,6 +71,9 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Sep 27 2019 Miro Hrončok <mhroncok@redhat.com> - 3-38
|
||||||
|
- Define %%python2 and %%python3
|
||||||
|
|
||||||
* Wed Aug 15 2018 Miro Hrončok <mhroncok@redhat.com> - 3-37
|
* Wed Aug 15 2018 Miro Hrončok <mhroncok@redhat.com> - 3-37
|
||||||
- Make %%py_byte_compile terminate build on SyntaxErrors (#1616219)
|
- Make %%py_byte_compile terminate build on SyntaxErrors (#1616219)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user