Skip to content

Commit

Permalink
Merge pull request #10872 from rjfd/wip-16776
Browse files Browse the repository at this point in the history
Enable builds without ceph-test subpackage

Reviewed-by: Nathan Cutler <ncutler@suse.com>
Reviewed-by: Ken Dreyer <kdreyer@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Sep 11, 2016
2 parents 864f2ac + d3ac8d1 commit 64d8a79
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -371,6 +371,8 @@ option(HAVE_LIBZFS "LibZFS is enabled" OFF)
option(ENABLE_COVERAGE "Coverage is enabled" OFF)
option(PG_DEBUG_REFS "PG Ref debugging is enabled" OFF)

option(WITH_TESTS "enable the build of ceph-test package scripts/binaries" ON)

if(LINUX)
add_definitions(-D__linux__)
endif(LINUX)
Expand Down
18 changes: 15 additions & 3 deletions ceph.spec.in
Expand Up @@ -16,7 +16,12 @@
#
%bcond_with ocf
%bcond_without cephfs_java
%bcond_with tests
%if 0%{?suse_version}
%bcond_with ceph_test_package
%else
%bcond_without ceph_test_package
%endif
%bcond_with make_check
%bcond_with xio
%ifnarch s390 s390x
%bcond_without tcmalloc
Expand Down Expand Up @@ -560,6 +565,7 @@ well as the RESTful interface. These have to do with querying the daemons for
command-description information, validating user command input against those
descriptions, and submitting the command to the appropriate daemon.

%if 0%{with ceph_test_package}
%package -n ceph-test
Summary: Ceph benchmarks and test tools
Group: System Environment/Libraries
Expand All @@ -568,6 +574,7 @@ Requires: ceph-common
Requires: xmlstarlet
%description -n ceph-test
This package contains Ceph benchmarks and test tools.
%endif

%if 0%{with cephfs_java}

Expand Down Expand Up @@ -680,6 +687,9 @@ cmake .. \
%if 0%{with xio}
-DWITH_XIO=ON \
%endif
%if 0%{without ceph_test_package}
-DWITH_TESTS=OFF \
%endif
%if 0%{with cephfs_java}
-DWITH_CEPHFS_JAVA=ON \
%endif
Expand Down Expand Up @@ -707,7 +717,7 @@ cmake .. \
make %{?_smp_mflags}


%if 0%{with tests}
%if 0%{with make_check}
%check
# run in-tree unittests
cd build
Expand Down Expand Up @@ -788,7 +798,6 @@ rm -rf %{buildroot}
%{_bindir}/osdmaptool
%{_bindir}/ceph-run
%{_bindir}/ceph-detect-init
%{_bindir}/ceph-client-debug
%{_unitdir}/ceph-create-keys@.service
%{_libexecdir}/systemd/system-preset/50-ceph.preset
%{_sbindir}/ceph-create-keys
Expand Down Expand Up @@ -1394,8 +1403,10 @@ ln -sf %{_libdir}/librbd.so.1 /usr/lib64/qemu/librbd.so.1
%{python3_sitelib}/ceph_daemon.py
%{python3_sitelib}/__pycache__/ceph_daemon.cpython*.py*

%if 0%{with ceph_test_package}
%files -n ceph-test
%defattr(-,root,root,-)
%{_bindir}/ceph-client-debug
%{_bindir}/ceph_bench_log
%{_bindir}/ceph_kvstorebench
%{_bindir}/ceph_multi_stress_watch
Expand Down Expand Up @@ -1428,6 +1439,7 @@ ln -sf %{_libdir}/librbd.so.1 /usr/lib64/qemu/librbd.so.1
%{_mandir}/man8/ceph-debugpack.8*
%dir %{_libdir}/ceph
%{_libdir}/ceph/ceph-monstore-update-crush.sh
%endif

%if 0%{with cephfs_java}
%files -n libcephfs_jni1
Expand Down
1 change: 0 additions & 1 deletion debian/ceph-base.install
Expand Up @@ -21,4 +21,3 @@ usr/share/man/man8/osdmaptool.8
usr/lib/python*/dist-packages/ceph_detect_init*
usr/share/man/man8/ceph-detect-init.8
usr/share/man/man8/ceph-create-keys.8
usr/bin/ceph-client-debug
1 change: 1 addition & 0 deletions debian/ceph-test.install
@@ -1,3 +1,4 @@
usr/bin/ceph-client-debug
usr/bin/ceph-coverage
usr/bin/ceph_bench_log
usr/bin/ceph_kvstorebench
Expand Down
5 changes: 4 additions & 1 deletion doc/man/8/CMakeLists.txt
Expand Up @@ -13,8 +13,11 @@ set(server_srcs
ceph-run.rst
mount.ceph.rst
ceph-create-keys.rst
ceph-rest-api.rst
ceph-rest-api.rst)
if(WITH_TESTS)
list(APPEND server_srcs
ceph-debugpack.rst)
endif(WITH_TESTS)

set(osd_srcs
ceph-clsinfo.rst
Expand Down
12 changes: 10 additions & 2 deletions src/CMakeLists.txt
Expand Up @@ -650,18 +650,21 @@ install(TARGETS ceph-mds DESTINATION bin)
add_subdirectory(erasure-code)

# Support/Tools
if(WITH_TESTS)
add_subdirectory(googletest/googlemock)

add_subdirectory(test)
endif(WITH_TESTS)

add_subdirectory(compressor)
add_subdirectory(tools)

if(WITH_TESTS)
configure_file(${CMAKE_SOURCE_DIR}/src/ceph-coverage.in
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage @ONLY)

configure_file(${CMAKE_SOURCE_DIR}/src/ceph-debugpack.in
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack @ONLY)
endif(WITH_TESTS)

configure_file(${CMAKE_SOURCE_DIR}/src/ceph.in
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph @ONLY)
Expand All @@ -675,10 +678,15 @@ configure_file(${CMAKE_SOURCE_DIR}/src/init-ceph.in
configure_file(ceph-post-file.in
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file @ONLY)

if(WITH_TESTS)
install(PROGRAMS
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage
DESTINATION bin)
endif(WITH_TESTS)

install(PROGRAMS
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-crush-location
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file
${CMAKE_SOURCE_DIR}/src/ceph-run
Expand Down
2 changes: 2 additions & 0 deletions src/rgw/CMakeLists.txt
@@ -1,3 +1,4 @@
if(WITH_TESTS)
add_executable(ceph_rgw_jsonparser
rgw_jsonparser.cc)
target_link_libraries(ceph_rgw_jsonparser
Expand All @@ -14,6 +15,7 @@ install(TARGETS
ceph_rgw_jsonparser
ceph_rgw_multiparser
DESTINATION bin)
endif(WITH_TESTS)


set(rgw_a_srcs
Expand Down
8 changes: 8 additions & 0 deletions src/tools/CMakeLists.txt
Expand Up @@ -8,6 +8,7 @@ add_executable(rados ${rados_srcs})
target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} radosstriper)
install(TARGETS rados DESTINATION bin)

if(WITH_TESTS)
add_executable(ceph_scratchtool scratchtool.c)
target_link_libraries(ceph_scratchtool librados global)
install(TARGETS ceph_scratchtool DESTINATION bin)
Expand All @@ -30,6 +31,7 @@ install(TARGETS ceph-monstore-tool DESTINATION bin)
install(PROGRAMS
ceph-monstore-update-crush.sh
DESTINATION ${CMAKE_INSTALL_LIBDIR}/ceph)
endif(WITH_TESTS)

add_executable(ceph-objectstore-tool
ceph_objectstore_tool.cc
Expand All @@ -41,14 +43,18 @@ endif(WITH_FUSE)
install(TARGETS ceph-objectstore-tool DESTINATION bin)

if(WITH_LIBCEPHFS)
if(WITH_TESTS)
add_executable(ceph-client-debug ceph-client-debug.cc)
target_link_libraries(ceph-client-debug cephfs global client)
install(TARGETS ceph-client-debug DESTINATION bin)
endif(WITH_TESTS)
endif(WITH_LIBCEPHFS)

if(WITH_TESTS)
add_executable(ceph-kvstore-tool ceph_kvstore_tool.cc)
target_link_libraries(ceph-kvstore-tool os global)
install(TARGETS ceph-kvstore-tool DESTINATION bin)
endif(WITH_TESTS)

set(ceph_conf_srcs ceph_conf.cc)
add_executable(ceph-conf ${ceph_conf_srcs})
Expand All @@ -70,10 +76,12 @@ add_executable(osdmaptool ${osdomaptool_srcs})
target_link_libraries(osdmaptool global)
install(TARGETS osdmaptool DESTINATION bin)

if(WITH_TESTS)
set(ceph_psim_srcs psim.cc)
add_executable(ceph_psim ${ceph_psim_srcs})
target_link_libraries(ceph_psim global)
install(TARGETS ceph_psim DESTINATION bin)
endif(WITH_TESTS)

set(ceph_authtool_srcs ceph_authtool.cc)
add_executable(ceph-authtool ${ceph_authtool_srcs})
Expand Down

0 comments on commit 64d8a79

Please sign in to comment.