From: Kefu Chai Date: Thu, 4 Aug 2022 13:52:43 +0000 (+0800) Subject: cmake,debian: install pure python module to deb_system path X-Git-Tag: v16.2.11~358^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bcfe4fb8dc1fc0210ea261f7410e7092fe560f48;p=ceph.git cmake,debian: install pure python module to deb_system path in ubuntu 22.04 and debian unstable, the layout (scheme) for system python module is named "deb_system", the default one is 'posix_local'. and 'posix_local' installs python modules into paths like usr/local/lib/python3.10/dist-packages/. hence dh_install fails when it tries to find the files to be packaged under directory of usr/lib/python3*/site-packages/. in this change, the "deb_system" scheme is used if it is available, and fall back to "posix_prefix" to be backward compatible with older debian (derivative) distros. also, update the source directories of pure python's installation from `site-packages` to `*-packages`, to be compatible with ubuntu focal and ubuntu jammy. as we are now using the specified scheme instead of the default one. Signed-off-by: Kefu Chai (cherry picked from commit 04967404ed682835f81c1a5e51f94d09805d38b3) Conflicts: apply the same change to debian/python3-cephfs.install, which was remove in main branch, but we need to preserve it in pacific. --- diff --git a/debian/python3-ceph-argparse.install b/debian/python3-ceph-argparse.install index d3339be76909..52479f93535e 100755 --- a/debian/python3-ceph-argparse.install +++ b/debian/python3-ceph-argparse.install @@ -1,4 +1,4 @@ #! /usr/bin/dh-exec -usr/lib/python3*/site-packages/ceph_argparse.py /usr/lib/python3/dist-packages/ -usr/lib/python3*/site-packages/ceph_daemon.py /usr/lib/python3/dist-packages/ +usr/lib/python3*/*-packages/ceph_argparse.py /usr/lib/python3/dist-packages/ +usr/lib/python3*/*-packages/ceph_daemon.py /usr/lib/python3/dist-packages/ diff --git a/debian/python3-cephfs.install b/debian/python3-cephfs.install old mode 100644 new mode 100755 index 6eb8836707f8..ac88db2211e6 --- a/debian/python3-cephfs.install +++ b/debian/python3-cephfs.install @@ -1,3 +1,5 @@ -usr/lib/python3*/dist-packages/ceph_volume_client.py +#! /usr/bin/dh-exec + +usr/lib/python3*/*-packages/ceph_volume_client.py /usr/lib/python3/dist-packages/ usr/lib/python3*/dist-packages/cephfs-*.egg-info usr/lib/python3*/dist-packages/cephfs.cpython*.so diff --git a/src/pybind/CMakeLists.txt b/src/pybind/CMakeLists.txt index 942af6e4966c..8b4cbf12cb67 100644 --- a/src/pybind/CMakeLists.txt +++ b/src/pybind/CMakeLists.txt @@ -36,6 +36,7 @@ execute_process( "import sysconfig;\ print(\ sysconfig.get_path(\ + scheme='deb_system' in sysconfig.get_scheme_names() and 'deb_system' or 'posix_prefix',\ name='purelib',\ vars=\ {'base': '${PYTHON_INSTALL_TEMPLATE}',\