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