pyzfs: Adapt python lib directory evaluation from ax_python_devel.m4

71216b91d2 introduced a regression
on debian/ubuntu systems during build.

The reason being, that building the RPM for pyzfs was using
a different library path than building the library itself.
This is now harmonized.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Martin Rüegg <martin.rueegg@metaworx.ch>
Closes #16155
Closes #17480
This commit is contained in:
Martin Rüegg 2025-06-21 18:55:19 +03:00 committed by Brian Behlendorf
parent 74b539d3dc
commit 6c1130a730

View File

@ -87,7 +87,19 @@
%define __python %{__use_python} %define __python %{__use_python}
%define __python_pkg_version %{__use_python_pkg_version} %define __python_pkg_version %{__use_python_pkg_version}
%endif %endif
%define __python_sitelib %(%{__python} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib())" 2>/dev/null || %{__python} -Esc "import sysconfig; print(sysconfig.get_path('purelib'))") %define __python_sitelib %(%{__python} -Esc "
import sysconfig;
if hasattr(sysconfig, 'get_default_scheme'):
scheme = sysconfig.get_default_scheme()
else:
scheme = sysconfig._get_default_scheme()
if scheme == 'posix_local':
scheme = 'posix_prefix'
prefix = '%{_prefix}'
if prefix == 'NONE':
prefix = '%{ac_default_prefix}'
sitedir = sysconfig.get_path('purelib', scheme, vars={'base': prefix})
print(sitedir);" 2>/dev/null || %{__python} -Esc "from distutils import sysconfig; print(sysconfig.get_python_lib(0,0))")
Name: @PACKAGE@ Name: @PACKAGE@
Version: @VERSION@ Version: @VERSION@