Skip to content

Commit e772f5b

Browse files
committed
pyzfs: Adapt python lib directory evaluation from ax_python_devel.m4
71216b9 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. Closes: #16155 Signed-off-by: Martin Rüegg <[email protected]>
1 parent 0b93957 commit e772f5b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

rpm/generic/zfs.spec.in

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,19 @@
8787
%define __python %{__use_python}
8888
%define __python_pkg_version %{__use_python_pkg_version}
8989
%endif
90-
%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'))")
90+
%define __python_sitelib %(%{__python} -Esc "
91+
import sysconfig;
92+
if hasattr(sysconfig, 'get_default_scheme'):
93+
scheme = sysconfig.get_default_scheme()
94+
else:
95+
scheme = sysconfig._get_default_scheme()
96+
if scheme == 'posix_local':
97+
scheme = 'posix_prefix'
98+
prefix = '%{_prefix}'
99+
if prefix == 'NONE':
100+
prefix = '%{ac_default_prefix}'
101+
sitedir = sysconfig.get_path('purelib', scheme, vars={'base': prefix})
102+
print(sitedir);" 2>/dev/null || %{__python} -Esc "from distutils import sysconfig; print(sysconfig.get_python_lib(0,0))")
91103

92104
Name: @PACKAGE@
93105
Version: @VERSION@

0 commit comments

Comments
 (0)