Define and use %{_py3_shebang_s} in the shebang macros for easier opt-out

This is in-line with https://fedoraproject.org/wiki/Changes/PythonSafePath#Opting_out

Backported from https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/141
This commit is contained in:
Miro Hrončok 2022-07-19 16:34:01 +02:00
commit d83a32823c
4 changed files with 12 additions and 2 deletions

View file

@ -12,7 +12,8 @@
%python_cache_tag %(RPM_BUILD_ROOT= %{__python} -Esc "import sys; print(sys.implementation.cache_tag)")
%py_setup setup.py
%py_shbang_opts -s
%_py_shebang_s s
%py_shbang_opts -%{?_py_shebang_s}
%py_shbang_opts_nodash %(opts=%{py_shbang_opts}; echo ${opts#-})
%py_shebang_flags %(opts=%{py_shbang_opts}; echo ${opts#-})
%py_shebang_fix %{expand:\\\