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