From ad8d7caeed9b2dd808e49574b92b8c836abb35b4 Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Mon, 21 Feb 2022 02:08:26 +0100 Subject: [PATCH 1/2] Sign off the CONTRIBUTOR_AGREEMENT.txt as in commit #7b59af73b59ecc --- CONTRIBUTORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 6fd1fb414..46d375c67 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -30,4 +30,5 @@ Other contributors: * Christian Hesse * Andrzej Godziuk * Otto Kekäläinen + * Michal Schorm [add name and email/username above this line, but leave this line intact] From 25092bf4d3417d6c2bb8102f8c1390c4319d6682 Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Mon, 21 Feb 2022 02:18:52 +0100 Subject: [PATCH 2/2] Make the following install destinations configurable: - documentation files - shared library - garbd binary - garbd-systemd wrapper script - garbd configuration file - garbd systemd service file - manpage --- CMakeLists.txt | 9 ++++++-- galera/src/CMakeLists.txt | 7 +++++- garb/CMakeLists.txt | 45 +++++++++++++++++++++++++++++++++++---- 3 files changed, 54 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 498c7f5e4..297b5789a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,14 +107,19 @@ add_subdirectory(galera) add_subdirectory(scripts/packages) add_subdirectory(wsrep/tests) +# Make the install destination for documentation files configurable +if(NOT DEFINED INSTALL_DOCDIR) + set(INSTALL_DOCDIR "doc" CACHE STRING "path to install documentation to") +endif() + if (NOT ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD") install(FILES ${PROJECT_SOURCE_DIR}/AUTHORS ${PROJECT_SOURCE_DIR}/COPYING ${PROJECT_SOURCE_DIR}/README - DESTINATION doc) + DESTINATION ${INSTALL_DOCDIR} ) install(FILES ${PROJECT_SOURCE_DIR}/asio/LICENSE_1_0.txt - DESTINATION doc + DESTINATION ${INSTALL_DOCDIR} RENAME LICENSE.asio) endif() diff --git a/galera/src/CMakeLists.txt b/galera/src/CMakeLists.txt index 09a45bfad..10fa8916b 100644 --- a/galera/src/CMakeLists.txt +++ b/galera/src/CMakeLists.txt @@ -112,7 +112,12 @@ endif() target_link_libraries(galera_smm galera ${GALERA_LINK_OPTIONS}) -install(TARGETS galera_smm DESTINATION lib) +# Make the install destination for the shared library configurable +if(NOT DEFINED INSTALL_LIBDIR) + set(INSTALL_LIBDIR "lib" CACHE STRING "path to install shared libraries to") +endif() + +install(TARGETS galera_smm DESTINATION ${INSTALL_LIBDIR}) # The following checks are guaranteed to work only # Linux platform, we skip them on others. diff --git a/garb/CMakeLists.txt b/garb/CMakeLists.txt index a60f48e29..68a171924 100644 --- a/garb/CMakeLists.txt +++ b/garb/CMakeLists.txt @@ -31,14 +31,51 @@ target_compile_options(garbd target_link_libraries(garbd gcs4garb gcomm gcache ${Boost_PROGRAM_OPTIONS_LIBRARIES}) -install(TARGETS garbd DESTINATION bin) +# Make the install destination for garbd binary configurable +if(NOT DEFINED INSTALL_GARBD) + set(INSTALL_GARBD "bin" CACHE STRING "path to install garbd binary to") +endif() + +install(TARGETS garbd + DESTINATION ${INSTALL_GARBD}) + if (NOT ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD") + + # Make the install destination for garbd-systemd wrapper script configurable + if(NOT DEFINED INSTALL_GARBD-SYSTEMD) + set(INSTALL_GARBD-SYSTEMD "share" CACHE STRING "path to install garbd-systemd wrapper script to") + endif() + + install(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/files/garb-systemd + DESTINATION ${INSTALL_GARBD-SYSTEMD}) + + # Make the install destination for garbd configuration file configurable + if(NOT DEFINED INSTALL_CONFIGURATION) + set(INSTALL_CONFIGURATION "share" CACHE STRING "path to install garbd configuration to") + endif() + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/files/garb.cnf + DESTINATION ${INSTALL_CONFIGURATION} + RENAME garb) + + # Make the install destination for garbd systemd service file configurable + if(NOT DEFINED INSTALL_SYSTEMD_SERVICE) + set(INSTALL_SYSTEMD_SERVICE "share" CACHE STRING "path to install garbd Systemd service to") + endif() + + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/files/garb.service - ${CMAKE_CURRENT_SOURCE_DIR}/files/garb-systemd - DESTINATION share) + DESTINATION ${INSTALL_SYSTEMD_SERVICE}) + + # Make the install destination for manpage configurable + if(NOT DEFINED INSTALL_MANPAGE) + set(INSTALL_MANPAGE "man/man8" CACHE STRING "path to install manpage to") + endif() + install(FILES ${PROJECT_SOURCE_DIR}/man/garbd.8 - DESTINATION man/man8) + DESTINATION ${INSTALL_MANPAGE}) + endif()