From ee86364f9aa39bff527cc5b46307c7bd68840311 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 9 Aug 2018 10:17:32 +0800 Subject: [PATCH] cmake: install script and egg-info files of cephfs-shell egg-info offers requires.txt, which is parsed by dh_python3 to prepare the dependencies for the cephfs-shell packaging. also, the meta-info in the .egg allows user to use eggs if they wish. see https://wiki.debian.org/Python/FAQ#How_should_we_package_Python_eggs.3F . Fixes: http://tracker.ceph.com/issues/26852 Signed-off-by: Kefu Chai --- cmake/modules/Distutils.cmake | 2 +- src/tools/cephfs/CMakeLists.txt | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake index d6e9f3817c3d7..672b56385e9c6 100644 --- a/cmake/modules/Distutils.cmake +++ b/cmake/modules/Distutils.cmake @@ -27,7 +27,7 @@ function(distutils_install_module name) endif() execute_process( COMMAND ${PYTHON${PYTHON_VERSION}_EXECUTABLE} - setup.py install \${options} + setup.py install \${options} --single-version-externally-managed WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\")") endfunction(distutils_install_module) diff --git a/src/tools/cephfs/CMakeLists.txt b/src/tools/cephfs/CMakeLists.txt index c9339ce8ac618..2cca8dc034c85 100644 --- a/src/tools/cephfs/CMakeLists.txt +++ b/src/tools/cephfs/CMakeLists.txt @@ -37,3 +37,13 @@ install(TARGETS cephfs-table-tool cephfs-data-scan DESTINATION bin) + +option(WITH_CEPHFS_SHELL "install cephfs-shell" OFF) +if(WITH_CEPHFS_SHELL) + if(NOT WITH_PYTHON3) + message(SEND_ERROR "Please enable WITH_PYTHON3 for cephfs-shell") + endif() + set(PYTHON_VERSION 3) + include(Distutils) + distutils_install_module(cephfs-shell) +endif() -- 2.39.5