summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-01-02 11:45:30 +0000
committerCoprDistGit <infra@openeuler.org>2025-01-02 11:45:30 +0000
commit0c7cee0ded8e93647df65a46426e86d26e6be703 (patch)
tree6a521fe908c77a0b86341328e3cf424d98e686ac
parenta2858c41aefd6ade0911bb326602534f73ea2b28 (diff)
automatic import of galeraopeneuler24.09
-rw-r--r--.gitignore1
-rw-r--r--cmake_paths.patch119
-rw-r--r--docs.patch25
-rw-r--r--fix-garb-service.patch24
-rw-r--r--galera.spec107
-rw-r--r--network.patch19
-rw-r--r--sources1
7 files changed, 296 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..0022e41 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/galera-4-26.4.21.tar.gz
diff --git a/cmake_paths.patch b/cmake_paths.patch
new file mode 100644
index 0000000..ec4f06a
--- /dev/null
+++ b/cmake_paths.patch
@@ -0,0 +1,119 @@
+This patch has been offered upstream with slight typo fixes:
+ https://github.com/codership/galera/pull/614
+on 21/02/2022
+
+#----------------------
+
+
+1) Documentation files
+
+--- galera-26.4.11/CMakeLists.txt 2022-02-20 03:35:32.039968825 +0100
++++ galera-26.4.11/CMakeLists.txt_patched 2022-02-20 03:34:57.710641631 +0100
+@@ -109,14 +109,19 @@ add_subdirectory(galera)
+ add_subdirectory(scripts/packages)
+ add_subdirectory(wsrep/tests)
+
++# Make the intall destination for documentation files configurable
++if(NOT DEFINED INSTALL_DOCDIR)
++ set(INSTALL_DOCDIR "doc" CACHE STRING "path to install documentaion 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()
+
+
+
+2) Configuration file
+3) Executable files
+4) Systemd service file
+
+--- galera-26.4.8/garb/CMakeLists.txt 2021-06-10 03:54:55.482520883 +0200
++++ galera-26.4.8/garb/CMakeLists.txt_patched 2021-06-10 03:54:41.070274710 +0200
+@@ -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()
+
+
+
+5) Shared library path
+
+--- galera-26.4.8/galera/src/CMakeLists.txt 2021-06-10 03:13:05.465005845 +0200
++++ galera-26.4.8/galera/src/CMakeLists.txt_patched 2021-06-10 03:16:53.388699046 +0200
+@@ -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 garbd binary 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/docs.patch b/docs.patch
new file mode 100644
index 0000000..7a6bec5
--- /dev/null
+++ b/docs.patch
@@ -0,0 +1,25 @@
+The CMake prepares file AUTHORS for packing.
+It only contains one line, and isn't packed in any upstream-produced packagess.
+I don't find it useful and since upstream doesn't pack it either, stop packing it here.
+
+The README file contains infromation on how to build the project from sources, and thus isn't useful for the end users.
+
+On the other hand, the README-MySQL isn't prepared for packing by CMake, but contains useful information about the software usage and it is package in upstream-produced packages.
+
+Offered upstream:
+https://github.com/codership/galera/pull/666
+https://groups.google.com/g/codership-team/c/Cn4UO3MkNQs
+
+--- galera-26.4.18/CMakeLists.txt 2024-06-09 04:54:56.281408893 +0200
++++ galera-26.4.18/CMakeLists.txt_patched 2024-06-09 06:52:58.093217968 +0200
+@@ -118,9 +118,8 @@ endif()
+
+ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD")
+ install(FILES
+- ${PROJECT_SOURCE_DIR}/AUTHORS
+ ${PROJECT_SOURCE_DIR}/COPYING
+- ${PROJECT_SOURCE_DIR}/README
++ ${PROJECT_SOURCE_DIR}/scripts/packages/README-MySQL
+ DESTINATION ${INSTALL_DOCDIR} )
+ install(FILES ${PROJECT_SOURCE_DIR}/asio/LICENSE_1_0.txt
+ DESTINATION ${INSTALL_DOCDIR}
diff --git a/fix-garb-service.patch b/fix-garb-service.patch
new file mode 100644
index 0000000..d0435b4
--- /dev/null
+++ b/fix-garb-service.patch
@@ -0,0 +1,24 @@
+diff -Nur galera-4-26.4.21_bak/garb/files/garb.service galera-4-26.4.21/garb/files/garb.service
+--- galera-4-26.4.21_bak/garb/files/garb.service 2025-01-02 15:24:23.861654448 +0800
++++ galera-4-26.4.21/garb/files/garb.service 2025-01-02 15:25:03.043529992 +0800
+@@ -12,7 +12,7 @@
+
+ [Service]
+ User=nobody
+-ExecStart=/usr/bin/garb-systemd start
++ExecStart=/usr/sbin/garb-systemd start
+
+ # Use SIGINT because with the default SIGTERM
+ # garbd fails to reliably transition to 'destroyed' state
+diff -Nur galera-4-26.4.21_bak/garb/files/garb-systemd galera-4-26.4.21/garb/files/garb-systemd
+--- galera-4-26.4.21_bak/garb/files/garb-systemd 2025-01-02 15:24:23.861654448 +0800
++++ galera-4-26.4.21/garb/files/garb-systemd 2025-01-02 15:25:33.171434293 +0800
+@@ -13,7 +13,7 @@
+
+ program_start() {
+ echo "Starting garbd"
+- /usr/bin/garbd "$@"
++ /usr/sbin/garbd "$@"
+ }
+
+ start() {
diff --git a/galera.spec b/galera.spec
new file mode 100644
index 0000000..406bec2
--- /dev/null
+++ b/galera.spec
@@ -0,0 +1,107 @@
+Name: galera
+Version: 26.4.21
+Release: 1
+Summary: Synchronous multi-master replication library
+License: GPL-2.0-only
+URL: http://galeracluster.com/
+Source0: http://releases.galeracluster.com/%{name}-4.21/source/%{name}-4-%{version}.tar.gz
+
+Patch0: cmake_paths.patch
+Patch1: docs.patch
+Patch2: network.patch
+Patch3: fix-garb-service.patch
+
+BuildRequires: asio-devel boost-devel check-devel gcc-c++ openssl-devel cmake systemd
+Requires(pre): /usr/sbin/useradd
+Requires: nmap-ncat
+Requires: procps-ng
+
+%{?systemd_requires}
+
+%description
+This is Galera replication - Codership's implementation of the write set replication (wsrep) interface.
+
+%prep
+%autosetup -n %{name}-4-%{version} -p1
+
+%build
+%{set_build_flags}
+
+%cmake \
+ -DCMAKE_BUILD_TYPE="%{?with_debug:Debug}%{!?with_debug:RelWithDebInfo}" \
+ -DINSTALL_LAYOUT=RPM \
+ -DCMAKE_RULE_MESSAGES:BOOL=OFF \
+ \
+ -DBUILD_SHARED_LIBS:BOOL=OFF \
+ \
+ -DINSTALL_DOCDIR="share/doc/%{name}/" \
+ -DINSTALL_GARBD="sbin" \
+ -DINSTALL_GARBD-SYSTEMD="sbin" \
+ -DINSTALL_CONFIGURATION="/etc/sysconfig/" \
+ -DINSTALL_SYSTEMD_SERVICE="lib/systemd/system" \
+ -DINSTALL_LIBDIR="%{_lib}/galera" \
+ -DINSTALL_MANPAGE="share/man/man8"
+
+cmake -B %_vpath_builddir -LAH
+
+%cmake_build
+
+%install
+%cmake_install
+
+mv %{buildroot}%{_unitdir}/garb.service %{buildroot}%{_unitdir}/garbd.service
+
+%check
+%ctest
+
+%post
+/sbin/ldconfig
+%systemd_post garbd.service
+
+%preun
+%systemd_preun garbd.service
+
+%postun
+/sbin/ldconfig
+%systemd_postun_with_restart garbd.service
+
+%files
+%config(noreplace,missingok) %{_sysconfdir}/sysconfig/garb
+%dir %{_docdir}/galera
+%doc %{_docdir}/galera/*
+%dir %{_libdir}/galera
+%{_libdir}/galera/libgalera_smm.so
+%{_sbindir}/garbd*
+%{_unitdir}/garbd.service
+
+%attr(755, -, -) %{_sbindir}/garb-systemd
+%{_mandir}/man8/garbd.8*
+
+%changelog
+* Thu Jan 02 2025 wangkai <13474090681@163.com> - 26.4.21-1
+- Upgrade to 26.4.21
+- Switch scons build to cmake build
+
+* Wed Dec 06 2023 yaoxin <yao_xin001@hoperun.com> - 26.4.16-1
+- Upgrade to 26.4.16 and fix build error
+
+* Tue Oct 31 2023 wangkai <13474090681@163.com> - 26.4.14-1
+- Update to 26.4.14
+
+* Thu Dec 22 2022 wanglin <wangl29@chinatelecom.cn> - 26.4.8-2
+- Set strict_build_flags=0 and fix changelog date
+
+* Wed Aug 25 2021 lingsheng <lingsheng@huawei.com> - 26.4.8-1
+- Update to 26.4.8
+
+* Mon Aug 16 2021 lingsheng <lingsheng@huawei.com> - 25.3.26-5
+- Remove unsupported reload option
+
+* Wed Jul 21 2021 lingsheng <lingsheng@huawei.com> - 25.3.26-4
+- Remove unnecessary buildrequire gdb
+
+* Sat Mar 21 2020 songnannan <songnannan2@huawei.com> - 25.3.26-3
+- add gdb in buildrequires
+
+* Wed Mar 4 2020 zhouyihang<zhouyihang1@huawei.com> - 25.3.26-2
+- Pakcage init
diff --git a/network.patch b/network.patch
new file mode 100644
index 0000000..8d9f483
--- /dev/null
+++ b/network.patch
@@ -0,0 +1,19 @@
+Make sure the network is actually up at the moment of the service startup:
+https://systemd.io/NETWORK_ONLINE/
+
+Offered upstream:
+https://github.com/codership/galera/pull/667
+https://groups.google.com/g/codership-team/c/Cn4UO3MkNQs
+
+--- galera-26.4.18/garb/files/garb.service 2024-04-17 19:39:35.000000000 +0200
++++ galera-26.4.18/garb/files/garb.service_patched 2024-06-09 07:47:19.245480639 +0200
+@@ -4,7 +4,8 @@
+ Description=Galera Arbitrator Daemon
+ Documentation=man:garbd(8)
+ Documentation=https://galeracluster.com/library/documentation/arbitrator.html
+-After=network.target
++After=network-online.target
++Wants=network-online.target
+
+ [Install]
+ WantedBy=multi-user.target
diff --git a/sources b/sources
new file mode 100644
index 0000000..d63e307
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+ca213d73a4ec94fdbd9ae4bbe1bb7cf5 galera-4-26.4.21.tar.gz