2016-12-02 16:37:55 +01:00
|
|
|
# legacy macros. commented but kept for the sake of possible recovery of their values
|
2019-11-12 15:04:49 +01:00
|
|
|
%py_prefix %(python -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND)
|
|
|
|
%py_libdir %{py_prefix}/%{_lib}/python%{py_ver}
|
|
|
|
%py_incdir %{py_prefix}/include/python%{py_ver}
|
|
|
|
%py_sitedir %{py_libdir}/site-packages
|
2016-12-02 16:37:55 +01:00
|
|
|
|
|
|
|
# these might be still in use somewhere
|
|
|
|
%py_compile(O) \
|
|
|
|
find %1 -name '*.pyc' -exec rm -f {} \\; \
|
2017-11-03 15:32:45 +01:00
|
|
|
python2 -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 \
|
2016-12-02 16:37:55 +01:00
|
|
|
%{-O: \
|
|
|
|
find %1 -name '*.pyo' -exec rm -f {} \\; \
|
2017-11-03 15:32:45 +01:00
|
|
|
python2 -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 \
|
2016-12-02 16:37:55 +01:00
|
|
|
}
|
|
|
|
%py_requires(d) \
|
|
|
|
BuildRequires: /usr/bin/python %{-d:python-devel} \
|
|
|
|
PreReq: python = %{py_ver}
|
|
|
|
|
|
|
|
# new-style macros relying on python-rpm-macros package
|
|
|
|
%have_python2 1
|
|
|
|
%python2_package_prefix python2
|