From: Kefu Chai Date: Thu, 9 Aug 2018 02:17:32 +0000 (+0800) Subject: cmake: install script and egg-info files of cephfs-shell X-Git-Tag: v14.0.1~616^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ee86364f9aa39bff527cc5b46307c7bd68840311;p=ceph-ci.git 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 --- diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake index d6e9f3817c3..672b56385e9 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 c9339ce8ac6..2cca8dc034c 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()