30d4ec
This patch has been offered upstream with slight typo fixes:
30d4ec
  https://github.com/codership/galera/pull/614
30d4ec
on 21/02/2022
30d4ec
30d4ec
#----------------------
30d4ec
30d4ec
f3a1c8
1) Documentation files
f3a1c8
30d4ec
--- galera-26.4.11/CMakeLists.txt	2022-02-20 03:35:32.039968825 +0100
30d4ec
+++ galera-26.4.11/CMakeLists.txt_patched	2022-02-20 03:34:57.710641631 +0100
30d4ec
@@ -109,14 +109,19 @@ add_subdirectory(galera)
f3a1c8
 add_subdirectory(scripts/packages)
f3a1c8
 add_subdirectory(wsrep/tests)
f3a1c8
 
f3a1c8
+# Make the intall destination for documentation files configurable
f3a1c8
+if(NOT DEFINED INSTALL_DOCDIR)
f3a1c8
+  set(INSTALL_DOCDIR "doc" CACHE STRING "path to install documentaion to")
f3a1c8
+endif()
f3a1c8
+
f3a1c8
 if (NOT ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD")
f3a1c8
   install(FILES
30d4ec
     ${PROJECT_SOURCE_DIR}/AUTHORS
30d4ec
     ${PROJECT_SOURCE_DIR}/COPYING
30d4ec
     ${PROJECT_SOURCE_DIR}/README
f3a1c8
-    DESTINATION doc)
f3a1c8
+    DESTINATION ${INSTALL_DOCDIR} )
30d4ec
   install(FILES ${PROJECT_SOURCE_DIR}/asio/LICENSE_1_0.txt
f3a1c8
-    DESTINATION doc
f3a1c8
+    DESTINATION ${INSTALL_DOCDIR}
f3a1c8
     RENAME LICENSE.asio)
f3a1c8
 endif()
f3a1c8
 
f3a1c8
f3a1c8
f3a1c8
2) Configuration file
f3a1c8
3) Executable files
f3a1c8
4) Systemd service file
f3a1c8
f3a1c8
--- galera-26.4.8/garb/CMakeLists.txt	2021-06-10 03:54:55.482520883 +0200
f3a1c8
+++ galera-26.4.8/garb/CMakeLists.txt_patched	2021-06-10 03:54:41.070274710 +0200
f3a1c8
@@ -31,14 +31,51 @@ target_compile_options(garbd
f3a1c8
 target_link_libraries(garbd gcs4garb gcomm gcache
f3a1c8
   ${Boost_PROGRAM_OPTIONS_LIBRARIES})
f3a1c8
 
f3a1c8
-install(TARGETS garbd DESTINATION bin)
f3a1c8
+# Make the install destination for garbd binary configurable
f3a1c8
+if(NOT DEFINED INSTALL_GARBD)
f3a1c8
+  set(INSTALL_GARBD "bin" CACHE STRING "path to install garbd binary to")
f3a1c8
+endif()
f3a1c8
+
f3a1c8
+install(TARGETS garbd
f3a1c8
+  DESTINATION ${INSTALL_GARBD})
f3a1c8
+
f3a1c8
 if (NOT ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD")
f3a1c8
+
f3a1c8
+  # Make the install destination for garbd-systemd wrapper script configurable
f3a1c8
+  if(NOT DEFINED INSTALL_GARBD-SYSTEMD)
f3a1c8
+    set(INSTALL_GARBD-SYSTEMD "share" CACHE STRING "path to install garbd-systemd wrapper script to")
f3a1c8
+  endif()
f3a1c8
+
f3a1c8
+  install(FILES
f3a1c8
+    ${CMAKE_CURRENT_SOURCE_DIR}/files/garb-systemd
f3a1c8
+    DESTINATION ${INSTALL_GARBD-SYSTEMD})
f3a1c8
+
f3a1c8
+  # Make the install destination for garbd configuration file configurable
f3a1c8
+  if(NOT DEFINED INSTALL_CONFIGURATION)
f3a1c8
+    set(INSTALL_CONFIGURATION "share" CACHE STRING "path to install garbd configuration to")
f3a1c8
+  endif()
f3a1c8
+
f3a1c8
   install(FILES
f3a1c8
     ${CMAKE_CURRENT_SOURCE_DIR}/files/garb.cnf
f3a1c8
+    DESTINATION ${INSTALL_CONFIGURATION}
f3a1c8
+    RENAME garb)
f3a1c8
+
f3a1c8
+  # Make the install destination for garbd systemd service file configurable
f3a1c8
+  if(NOT DEFINED INSTALL_SYSTEMD_SERVICE)
f3a1c8
+    set(INSTALL_SYSTEMD_SERVICE "share" CACHE STRING "path to install garbd Systemd service to")
f3a1c8
+  endif()
f3a1c8
+
f3a1c8
+  install(FILES
f3a1c8
     ${CMAKE_CURRENT_SOURCE_DIR}/files/garb.service
f3a1c8
-    ${CMAKE_CURRENT_SOURCE_DIR}/files/garb-systemd
f3a1c8
-    DESTINATION share)
f3a1c8
+    DESTINATION ${INSTALL_SYSTEMD_SERVICE})
f3a1c8
+
f3a1c8
+  # Make the install destination for manpage configurable
f3a1c8
+  if(NOT DEFINED INSTALL_MANPAGE)
f3a1c8
+    set(INSTALL_MANPAGE "man/man8" CACHE STRING "path to install manpage to")
f3a1c8
+  endif()
f3a1c8
+
f3a1c8
   install(FILES
30d4ec
     ${PROJECT_SOURCE_DIR}/man/garbd.8
f3a1c8
-    DESTINATION man/man8)
f3a1c8
+    DESTINATION ${INSTALL_MANPAGE})
f3a1c8
+
f3a1c8
 endif()
f3a1c8
f3a1c8
f3a1c8
f3a1c8
5) Shared library path
f3a1c8
f3a1c8
--- galera-26.4.8/galera/src/CMakeLists.txt	2021-06-10 03:13:05.465005845 +0200
f3a1c8
+++ galera-26.4.8/galera/src/CMakeLists.txt_patched	2021-06-10 03:16:53.388699046 +0200
f3a1c8
@@ -112,7 +112,12 @@ endif()
f3a1c8
 
f3a1c8
 target_link_libraries(galera_smm galera ${GALERA_LINK_OPTIONS})
f3a1c8
 
f3a1c8
-install(TARGETS galera_smm DESTINATION lib)
f3a1c8
+# Make the install destination for garbd binary configurable
f3a1c8
+if(NOT DEFINED INSTALL_LIBDIR)
f3a1c8
+  set(INSTALL_LIBDIR "lib" CACHE STRING "path to install shared libraries to")
f3a1c8
+endif()
f3a1c8
+
f3a1c8
+install(TARGETS galera_smm DESTINATION ${INSTALL_LIBDIR})
f3a1c8
 
f3a1c8
 # The following checks are guaranteed to work only
f3a1c8
 # Linux platform, we skip them on others.
f3a1c8