summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKefu Chai <kchai@redhat.com>2018-08-09 04:17:32 +0200
committerKefu Chai <kchai@redhat.com>2018-08-09 11:55:24 +0200
commitee86364f9aa39bff527cc5b46307c7bd68840311 (patch)
treee0a1ba3fc39491f4a3c9da59f4e929742362293c
parenttools/cephfs: add setup.py for cephfs-shell (diff)
downloadceph-ee86364f9aa39bff527cc5b46307c7bd68840311.tar.xz
ceph-ee86364f9aa39bff527cc5b46307c7bd68840311.zip
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 <kchai@redhat.com>
-rw-r--r--cmake/modules/Distutils.cmake2
-rw-r--r--src/tools/cephfs/CMakeLists.txt10
2 files changed, 11 insertions, 1 deletions
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()