|
|
|
@ -20,6 +20,11 @@
|
|
|
|
|
%python2 %__python2
|
|
|
|
|
%python3 %__python3
|
|
|
|
|
|
|
|
|
|
# Simplified version backported from Fedora
|
|
|
|
|
%py_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python} %{py_shbang_opts}"}
|
|
|
|
|
%py2_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python2} %{py2_shbang_opts}"}
|
|
|
|
|
%py3_shebang_fix %{expand:/usr/bin/pathfix.py -pni "%{__python3} %{py3_shbang_opts}"}
|
|
|
|
|
|
|
|
|
|
# Users can use %%python only if they redefined %%__python (e.g. to %%__python3)
|
|
|
|
|
%python() %{lua:\
|
|
|
|
|
__python = rpm.expand("%__python")\
|
|
|
|
@ -45,6 +50,32 @@
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# This is intended for Python 3 only, hence also no Python version in the name.
|
|
|
|
|
%__pytest /usr/bin/pytest-3
|
|
|
|
|
%pytest %{expand:\\\
|
|
|
|
|
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
|
|
|
|
|
PATH="%{buildroot}%{_bindir}:$PATH"\\\
|
|
|
|
|
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\
|
|
|
|
|
PYTHONDONTWRITEBYTECODE=1\\\
|
|
|
|
|
%__pytest}
|
|
|
|
|
|
|
|
|
|
%py_provides() %{lua:
|
|
|
|
|
local name = rpm.expand('%1')
|
|
|
|
|
if name == '%1' then
|
|
|
|
|
rpm.expand('%{error:%%py_provides requires at least 1 argument, the name to provide}')
|
|
|
|
|
end
|
|
|
|
|
local evr = rpm.expand('%2')
|
|
|
|
|
if evr == '%2' then
|
|
|
|
|
evr = rpm.expand('%{?epoch:%{epoch}:}%{version}-%{release}')
|
|
|
|
|
end
|
|
|
|
|
print('Provides: ' .. name .. ' = ' .. evr .. '\\n')
|
|
|
|
|
-- NB: dash needs to be escaped!
|
|
|
|
|
if name:match('^python3%-') then
|
|
|
|
|
replaced = name:gsub('^python3%-', 'python-')
|
|
|
|
|
print('Provides: ' .. replaced .. ' = ' .. evr .. '\\n')
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# gpgverify verifies signed sources. There is documentation in the script.
|
|
|
|
|
%gpgverify %{_rpmconfigdir}/gpgverify
|
|
|
|
|
|
|
|
|
|