2024-01-05 16:58:53 +01:00
|
|
|
%__python312 /usr/bin/python3.12
|
2024-01-05 16:58:53 +01:00
|
|
|
#------------------------------------------------------------------------
|
|
|
|
# python(...) configuration.
|
|
|
|
#
|
|
|
|
# Path to scripts to autogenerate python package dependencies,
|
|
|
|
#
|
|
|
|
# Note: Used iff _use_internal_dependency_generator is non-zero. The
|
|
|
|
# helpers are also used by %{_usrlibrpm}/rpmdeps {--provides|--requires}.
|
2024-01-05 16:58:53 +01:00
|
|
|
%__python312_provides %{_usrlibrpm}/pythondeps312.sh --provides
|
|
|
|
%__python312_requires %{_usrlibrpm}/pythondeps312.sh --requires
|
2024-01-05 16:58:53 +01:00
|
|
|
|
|
|
|
# Useful macros for building *.rpm python packages (for python > 1.6).
|
|
|
|
#
|
2024-01-05 16:58:53 +01:00
|
|
|
%python312_sitearch %(%{__python312} -c "from sysconfig import get_paths; print(get_paths()['platlib'])")
|
|
|
|
%python312_sitelib %(%{__python312} -c "from sysconfig import get_paths; print(get_paths()['purelib'])")
|
|
|
|
%python312_inc %(%{__python312} -c "from sysconfig import get_paths; print(get_paths()['include'])")
|
|
|
|
%python312_version %(%{__python312} -c "import sys; print(sys.version[0:4])")
|
2024-01-05 16:58:53 +01:00
|
|
|
|
2024-01-05 16:58:53 +01:00
|
|
|
%py312_compile(O) \
|
2024-01-05 16:58:53 +01:00
|
|
|
find %1 -name '*.pyc' -name '*.pyo' -exec rm -f {} \\; \
|
2024-01-05 16:58:53 +01:00
|
|
|
%{__python312} %{?O:-O} -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \
|
2024-01-05 16:58:53 +01:00
|
|
|
|
2024-01-05 16:58:53 +01:00
|
|
|
%py312_requires(d) \
|
|
|
|
%define maxver %(%{__python312} -c "import sys; a,b=sys.version_info[:2]; print('%%d.%%d'%%(a,b+1))" 2>/dev/null || echo PYTHON-NOT-FOUND) \
|
|
|
|
BuildRequires: python312, libpython312-devel \
|
|
|
|
Requires(pre): python312 >= %{python312_version}, python312 < %{maxver}
|