From 71aea12bac1620a45ad58b8721952f2bcabf27c8 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 20 Feb 2021 11:43:21 +0800 Subject: [PATCH] ceph.spec.in: s/%cmake/cmake/ this change partially reverts da7030db79c5dbd480040eb249a76638caf52707 which use %cmake rpm macro in the place of "cmake". but %cmake sets BUILD_SHARED_LIBS=ON. so quite a few internal libraries defined using add_library() are now compiled into shared libraries which are not installed or packagesd. when we are installing the rpm packages compiled with this option, rpm compiles because the linked libraries are missing, for instance, `libgmock.so.1.10.0` was compiled as a static library before da7030db79c5dbd480040eb249a76638caf52707, and was included by the test executables. but after that change it's compiled as a shared library. so we need to either package the linked shared libraries or just link against them statically. at this moment, the latter approach is simpler, albeit larger size of exectuable and dbg symbols. Fixes: https://tracker.ceph.com/issues/49395 Signed-off-by: Kefu Chai --- ceph.spec.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ceph.spec.in b/ceph.spec.in index f9516fc2de765..c813681971b52 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -1214,7 +1214,8 @@ env | sort mkdir build cd build -%cmake .. \ +cmake .. \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \ -DCMAKE_INSTALL_LIBEXECDIR:PATH=%{_libexecdir} \ -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=%{_localstatedir} \ -- 2.39.5