From 5ab449a6d83c60952fc3cf6000a777eb639f18cd Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 30 Jun 2016 18:53:02 +0800 Subject: [PATCH 1/5] cmake: install ceph_test_keyvaluedb qa task rados/objectstore/keyvaluedb.yaml uses it. Signed-off-by: Kefu Chai --- src/test/objectstore/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/objectstore/CMakeLists.txt b/src/test/objectstore/CMakeLists.txt index 87b6a5754702e..9bff68144c434 100644 --- a/src/test/objectstore/CMakeLists.txt +++ b/src/test/objectstore/CMakeLists.txt @@ -41,6 +41,8 @@ target_link_libraries(ceph_test_keyvaluedb ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ) +install(TARGETS ceph_test_keyvaluedb + DESTINATION ${CMAKE_INSTALL_BINDIR}) # ceph_test_objectstore_workloadgen add_executable(ceph_test_objectstore_workloadgen From 41061ce7698513db4382f78e4d326b9430b709bd Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 30 Jun 2016 16:01:08 +0800 Subject: [PATCH 2/5] cmake: install systemd files add an option "WITH_SYSTEMD", off by default Signed-off-by: Kefu Chai --- CMakeLists.txt | 6 ++++++ systemd/CMakeLists.txt | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 systemd/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 7da12959b0b41..acd4b38144986 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -398,3 +398,9 @@ add_subdirectory(doc) if(WITH_MANPAGE) add_subdirectory(man) endif(WITH_MANPAGE) + +option(WITH_SYSTEMD "install systemd target and service files" OFF) +if(WITH_SYSTEMD) + add_subdirectory(systemd) +endif() + diff --git a/systemd/CMakeLists.txt b/systemd/CMakeLists.txt new file mode 100644 index 0000000000000..31767d6d019d5 --- /dev/null +++ b/systemd/CMakeLists.txt @@ -0,0 +1,16 @@ +install(FILES + ceph.target + ceph-osd.target + ceph-mon.target + ceph-mds.target + ceph-radosgw.target + ceph-rbd-mirror.target + ceph-mds@.service + ceph-mon@.service + ceph-create-keys@.service + ceph-osd@.service + ceph-radosgw@.service + ceph-rbd-mirror@.service + ceph-disk@.service + rbdmap.service + DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/systemd/system) From 0b002223dddba11736e1787c80150e34e5c78d20 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 30 Jun 2016 15:39:52 +0800 Subject: [PATCH 3/5] cmake: install libs into ${CMAKE_INSTALL_LIBDIR} this address rpm build failures on amd64 platforms: Directory not found: /srv/autobuild-ceph/gitbuilder.git/build/rpmbuild/BUILDROOT/ceph-11.0.0-119.gcd3ee3c.x86_64/usr/lib64/rados-classes File not found by glob: /srv/autobuild-ceph/gitbuilder.git/build/rpmbuild/BUILDROOT/ceph-11.0.0-119.gcd3ee3c.x86_64/usr/lib64/rados-classes/* File not found by glob: /srv/autobuild-ceph/gitbuilder.git/build/rpmbuild/BUILDROOT/ceph-11.0.0-119.gcd3ee3c.x86_64/usr/lib64/libos_tp.so* File not found by glob: /srv/autobuild-ceph/gitbuilder.git/build/rpmbuild/BUILDROOT/ceph-11.0.0-119.gcd3ee3c.x86_64/usr/lib64/libosd_tp.so* Signed-off-by: Kefu Chai --- src/cls/CMakeLists.txt | 30 ++++++++++++++++-------------- src/tracing/CMakeLists.txt | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/cls/CMakeLists.txt b/src/cls/CMakeLists.txt index 1c3f55c427576..659662726c855 100644 --- a/src/cls/CMakeLists.txt +++ b/src/cls/CMakeLists.txt @@ -1,20 +1,22 @@ ## Rados object classes +set(cls_dir ${CMAKE_INSTALL_LIBDIR}/rados-classes) + # cls_hello add_library(cls_hello SHARED hello/cls_hello.cc) set_target_properties(cls_hello PROPERTIES VERSION "1.0.0" SOVERSION "1") -install(TARGETS cls_hello DESTINATION lib/rados-classes) +install(TARGETS cls_hello DESTINATION ${cls_dir}) # cls_numops add_library(cls_numops SHARED numops/cls_numops.cc) set_target_properties(cls_numops PROPERTIES VERSION "1.0.0" SOVERSION "1") -install(TARGETS cls_numops DESTINATION lib/rados-classes) +install(TARGETS cls_numops DESTINATION ${cls_dir}) # cls_rbd if (WITH_RBD) add_library(cls_rbd SHARED rbd/cls_rbd.cc rbd/cls_rbd_types.cc) set_target_properties(cls_rbd PROPERTIES VERSION "1.0.0" SOVERSION "1") - install(TARGETS cls_rbd DESTINATION lib/rados-classes) + install(TARGETS cls_rbd DESTINATION ${cls_dir}) add_library(cls_rbd_client STATIC rbd/cls_rbd_client.cc rbd/cls_rbd_types.cc) endif (WITH_RBD) @@ -22,7 +24,7 @@ endif (WITH_RBD) # cls_lock add_library(cls_lock SHARED lock/cls_lock.cc) set_target_properties(cls_lock PROPERTIES VERSION "1.0.0" SOVERSION "1") -install(TARGETS cls_lock DESTINATION lib/rados-classes) +install(TARGETS cls_lock DESTINATION ${cls_dir}) add_library(cls_lock_client STATIC lock/cls_lock_client.cc @@ -36,7 +38,7 @@ add_library(cls_refcount SHARED ${CMAKE_SOURCE_DIR}/src/common/ceph_json.cc) target_link_libraries(cls_refcount json_spirit) set_target_properties(cls_refcount PROPERTIES VERSION "1.0.0" SOVERSION "1") -install(TARGETS cls_refcount DESTINATION lib/rados-classes) +install(TARGETS cls_refcount DESTINATION ${cls_dir}) add_library(cls_refcount_client STATIC refcount/cls_refcount_client.cc @@ -45,7 +47,7 @@ add_library(cls_refcount_client STATIC # cls_version add_library(cls_version SHARED version/cls_version.cc) set_target_properties(cls_version PROPERTIES VERSION "1.0.0" SOVERSION "1") -install(TARGETS cls_version DESTINATION lib/rados-classes) +install(TARGETS cls_version DESTINATION ${cls_dir}) add_library(cls_version_client STATIC version/cls_version_client.cc @@ -54,28 +56,28 @@ add_library(cls_version_client STATIC # cls_log add_library(cls_log SHARED log/cls_log.cc) set_target_properties(cls_log PROPERTIES VERSION "1.0.0" SOVERSION "1") -install(TARGETS cls_log DESTINATION lib/rados-classes) +install(TARGETS cls_log DESTINATION ${cls_dir}) add_library(cls_log_client STATIC log/cls_log_client.cc) # cls_statelog add_library(cls_statelog SHARED statelog/cls_statelog.cc) set_target_properties(cls_statelog PROPERTIES VERSION "1.0.0" SOVERSION "1") -install(TARGETS cls_statelog DESTINATION lib/rados-classes) +install(TARGETS cls_statelog DESTINATION ${cls_dir}) add_library(cls_statelog_client STATIC statelog/cls_statelog_client.cc) # cls_timeindex add_library(cls_timeindex SHARED timeindex/cls_timeindex.cc) set_target_properties(cls_timeindex PROPERTIES VERSION "1.0.0" SOVERSION "1") -install(TARGETS cls_timeindex DESTINATION lib/rados-classes) +install(TARGETS cls_timeindex DESTINATION ${cls_dir}) add_library(cls_timeindex_client STATIC timeindex/cls_timeindex_client.cc) # cls_replica_log add_library(cls_replica_log SHARED replica_log/cls_replica_log.cc) set_target_properties(cls_replica_log PROPERTIES VERSION "1.0.0" SOVERSION "1") -install(TARGETS cls_replica_log DESTINATION lib/rados-classes) +install(TARGETS cls_replica_log DESTINATION ${cls_dir}) add_library(cls_replica_log_client STATIC replica_log/cls_replica_log_types.cc @@ -85,7 +87,7 @@ add_library(cls_replica_log_client STATIC # cls_user add_library(cls_user SHARED user/cls_user.cc) set_target_properties(cls_user PROPERTIES VERSION "1.0.0" SOVERSION "1") -install(TARGETS cls_user DESTINATION lib/rados-classes) +install(TARGETS cls_user DESTINATION ${cls_dir}) add_library(cls_user_client STATIC user/cls_user_client.cc @@ -97,7 +99,7 @@ add_library(cls_journal SHARED journal/cls_journal.cc journal/cls_journal_types.cc) set_target_properties(cls_journal PROPERTIES VERSION "1.0.0" SOVERSION "1") -install(TARGETS cls_journal DESTINATION lib/rados-classes) +install(TARGETS cls_journal DESTINATION ${cls_dir}) add_library(cls_journal_client STATIC journal/cls_journal_client.cc @@ -112,7 +114,7 @@ if (WITH_RADOSGW) ${CMAKE_SOURCE_DIR}/src/common/ceph_json.cc) target_link_libraries(cls_rgw json_spirit) set_target_properties(cls_rgw PROPERTIES VERSION "1.0.0" SOVERSION "1") - install(TARGETS cls_rgw DESTINATION lib/rados-classes) + install(TARGETS cls_rgw DESTINATION ${cls_dir}) add_library(cls_rgw_client STATIC rgw/cls_rgw_client.cc @@ -125,7 +127,7 @@ if (WITH_CEPHFS) add_library(cls_cephfs SHARED cephfs/cls_cephfs.cc) set_target_properties(cls_cephfs PROPERTIES VERSION "1.0.0" SOVERSION "1") - install(TARGETS cls_cephfs DESTINATION lib/rados-classes) + install(TARGETS cls_cephfs DESTINATION ${cls_dir}) add_library(cls_cephfs_client STATIC cephfs/cls_cephfs_client.cc) diff --git a/src/tracing/CMakeLists.txt b/src/tracing/CMakeLists.txt index 0b223c812a4d2..2bc837b870fc1 100644 --- a/src/tracing/CMakeLists.txt +++ b/src/tracing/CMakeLists.txt @@ -48,5 +48,5 @@ add_tracing_library(rados_tp librados.tp 2.0.0) add_tracing_library(rbd_tp librbd.tp 1.0.0) add_tracing_library(os_tp objectstore.tp 1.0.0) -install(TARGETS rados_tp osd_tp rbd_tp os_tp DESTINATION lib) +install(TARGETS rados_tp osd_tp rbd_tp os_tp DESTINATION ${CMAKE_INSTALL_LIBDIR}) From 5850687875e15ee8f6605ca963aba9771f25140d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 30 Jun 2016 13:10:58 +0800 Subject: [PATCH 4/5] cmake: use selinux/devel/Makefile for building selinux policy was using selinux/devel/include/Makefile, which was wrong. Signed-off-by: Kefu Chai --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index acd4b38144986..9f549600f52c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -367,7 +367,7 @@ find_package(Threads REQUIRED) option(WITH_SELINUX "build SELinux policy" OFF) if(WITH_SELINUX) - find_file(SELINUX_MAKEFILE selinux/devel/include/Makefile + find_file(SELINUX_MAKEFILE selinux/devel/Makefile PATH /usr/share) if(NOT SELINUX_MAKEFILE) message(FATAL_ERROR "Can't find selinux's Makefile") From e50460b69e809b4541cdc3b7c760bdd18fa4b312 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 30 Jun 2016 22:41:49 +0800 Subject: [PATCH 5/5] cmake: install rbd-replay-many and its manpage rpm packaging needs it explicitly. Signed-off-by: Kefu Chai --- doc/man/8/CMakeLists.txt | 1 + src/CMakeLists.txt | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/man/8/CMakeLists.txt b/doc/man/8/CMakeLists.txt index 87e2419913428..677319a05d867 100644 --- a/doc/man/8/CMakeLists.txt +++ b/doc/man/8/CMakeLists.txt @@ -61,6 +61,7 @@ if(WITH_RBD) ceph-rbdnamer.rst rbd-mirror.rst rbd-nbd.rst + rbd-replay-many.rst rbd-replay-prep.rst rbd-replay.rst rbdmap.rst diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 48cdf981fb5b2..201b1be2e059e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1327,8 +1327,11 @@ if(${WITH_RBD}) ${Boost_REGEX_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) install(TARGETS rbd rbd-nbd rbd-mirror DESTINATION bin) - install(PROGRAMS ${CMAKE_SOURCE_DIR}/src/ceph-rbdnamer DESTINATION bin) - install(PROGRAMS ${CMAKE_SOURCE_DIR}/src/rbdmap DESTINATION bin) + install(PROGRAMS + ${CMAKE_SOURCE_DIR}/src/ceph-rbdnamer + ${CMAKE_SOURCE_DIR}/src/rbd-replay-many + ${CMAKE_SOURCE_DIR}/src/rbdmap + DESTINATION ${CMAKE_INSTALL_BINDIR}) add_subdirectory(rbd_replay) endif(${WITH_RBD})