22efa1
1) Documentation files
22efa1
22efa1
--- galera-26.4.8/CMakeLists.txt	2021-04-08 08:05:44.000000000 +0200
22efa1
+++ galera-26.4.8/CMakeLists.txt_patched	2021-06-10 01:40:26.886770832 +0200
22efa1
@@ -106,17 +106,23 @@
22efa1
 add_subdirectory(scripts/packages)
22efa1
 add_subdirectory(wsrep/tests)
22efa1
22efa1
+
22efa1
+# Make the intall destination for documentation files configurable
22efa1
+if(NOT DEFINED INSTALL_DOCDIR)
22efa1
+  set(INSTALL_DOCDIR "doc" CACHE STRING "path to install documentaion to")
22efa1
+endif()
22efa1
+
22efa1
 if (NOT ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD")
22efa1
   install(FILES
22efa1
     ${CMAKE_SOURCE_DIR}/AUTHORS
22efa1
     ${CMAKE_SOURCE_DIR}/COPYING
22efa1
     ${CMAKE_SOURCE_DIR}/README
22efa1
-    DESTINATION doc)
22efa1
+    DESTINATION ${INSTALL_DOCDIR})
22efa1
   install(FILES ${CMAKE_SOURCE_DIR}/asio/LICENSE_1_0.txt
22efa1
-    DESTINATION doc
22efa1
+    DESTINATION ${INSTALL_DOCDIR}
22efa1
     RENAME LICENSE.asio)
22efa1
   install(FILES ${CMAKE_SOURCE_DIR}/chromium/LICENSE
22efa1
-    DESTINATION doc
22efa1
+    DESTINATION ${INSTALL_DOCDIR}
22efa1
     RENAME LICENSE.chromium)
22efa1
 endif()
22efa1
22efa1
22efa1
22efa1
2) Configuration file
22efa1
3) Executable files
22efa1
4) Systemd service file
22efa1
22efa1
--- galera-26.4.8/garb/CMakeLists.txt	2021-06-10 03:54:55.482520883 +0200
22efa1
+++ galera-26.4.8/garb/CMakeLists.txt_patched	2021-06-10 03:54:41.070274710 +0200
22efa1
@@ -31,14 +31,51 @@ target_compile_options(garbd
22efa1
 target_link_libraries(garbd gcs4garb gcomm gcache
22efa1
   ${Boost_PROGRAM_OPTIONS_LIBRARIES})
22efa1
 
22efa1
-install(TARGETS garbd DESTINATION bin)
22efa1
+# Make the install destination for garbd binary configurable
22efa1
+if(NOT DEFINED INSTALL_GARBD)
22efa1
+  set(INSTALL_GARBD "bin" CACHE STRING "path to install garbd binary to")
22efa1
+endif()
22efa1
+
22efa1
+install(TARGETS garbd
22efa1
+  DESTINATION ${INSTALL_GARBD})
22efa1
+
22efa1
 if (NOT ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD")
22efa1
+
22efa1
+  # Make the install destination for garbd-systemd wrapper script configurable
22efa1
+  if(NOT DEFINED INSTALL_GARBD-SYSTEMD)
22efa1
+    set(INSTALL_GARBD-SYSTEMD "share" CACHE STRING "path to install garbd-systemd wrapper script to")
22efa1
+  endif()
22efa1
+
22efa1
+  install(FILES
22efa1
+    ${CMAKE_CURRENT_SOURCE_DIR}/files/garb-systemd
22efa1
+    DESTINATION ${INSTALL_GARBD-SYSTEMD})
22efa1
+
22efa1
+  # Make the install destination for garbd configuration file configurable
22efa1
+  if(NOT DEFINED INSTALL_CONFIGURATION)
22efa1
+    set(INSTALL_CONFIGURATION "share" CACHE STRING "path to install garbd configuration to")
22efa1
+  endif()
22efa1
+
22efa1
   install(FILES
22efa1
     ${CMAKE_CURRENT_SOURCE_DIR}/files/garb.cnf
22efa1
+    DESTINATION ${INSTALL_CONFIGURATION}
22efa1
+    RENAME garb)
22efa1
+
22efa1
+  # Make the install destination for garbd systemd service file configurable
22efa1
+  if(NOT DEFINED INSTALL_SYSTEMD_SERVICE)
22efa1
+    set(INSTALL_SYSTEMD_SERVICE "share" CACHE STRING "path to install garbd Systemd service to")
22efa1
+  endif()
22efa1
+
22efa1
+  install(FILES
22efa1
     ${CMAKE_CURRENT_SOURCE_DIR}/files/garb.service
22efa1
-    ${CMAKE_CURRENT_SOURCE_DIR}/files/garb-systemd
22efa1
-    DESTINATION share)
22efa1
+    DESTINATION ${INSTALL_SYSTEMD_SERVICE})
22efa1
+
22efa1
+  # Make the install destination for manpage configurable
22efa1
+  if(NOT DEFINED INSTALL_MANPAGE)
22efa1
+    set(INSTALL_MANPAGE "man/man8" CACHE STRING "path to install manpage to")
22efa1
+  endif()
22efa1
+
22efa1
   install(FILES
22efa1
     ${CMAKE_SOURCE_DIR}/man/garbd.8
22efa1
-    DESTINATION man/man8)
22efa1
+    DESTINATION ${INSTALL_MANPAGE})
22efa1
+
22efa1
 endif()
22efa1
22efa1
22efa1
22efa1
5) Shared library path
22efa1
22efa1
--- galera-26.4.8/galera/src/CMakeLists.txt	2021-06-10 03:13:05.465005845 +0200
22efa1
+++ galera-26.4.8/galera/src/CMakeLists.txt_patched	2021-06-10 03:16:53.388699046 +0200
22efa1
@@ -112,7 +112,12 @@ endif()
22efa1
 
22efa1
 target_link_libraries(galera_smm galera ${GALERA_LINK_OPTIONS})
22efa1
 
22efa1
-install(TARGETS galera_smm DESTINATION lib)
22efa1
+# Make the install destination for garbd binary configurable
22efa1
+if(NOT DEFINED INSTALL_LIBDIR)
22efa1
+  set(INSTALL_LIBDIR "lib" CACHE STRING "path to install shared libraries to")
22efa1
+endif()
22efa1
+
22efa1
+install(TARGETS galera_smm DESTINATION ${INSTALL_LIBDIR})
22efa1
 
22efa1
 # The following checks are guaranteed to work only
22efa1
 # Linux platform, we skip them on others.
22efa1