From 53b0e554d689a804c685bd68431a1d985faf6167 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 22 2022 10:06:49 +0000 Subject: import rh-mariadb105-galera-26.4.9-3.el7 --- diff --git a/.gitignore b/.gitignore index 32ab765..ee20991 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/galera-26.4.7.tar.gz +SOURCES/galera-26.4.9.tar.gz diff --git a/.rh-mariadb105-galera.metadata b/.rh-mariadb105-galera.metadata index bcf1650..26b3560 100644 --- a/.rh-mariadb105-galera.metadata +++ b/.rh-mariadb105-galera.metadata @@ -1 +1 @@ -88296dbfb7f63bb1179ed735492742400dfb3374 SOURCES/galera-26.4.7.tar.gz +3c9925963811319563163a5364c36871ca25c556 SOURCES/galera-26.4.9.tar.gz diff --git a/SOURCES/cmake_paths.patch b/SOURCES/cmake_paths.patch new file mode 100644 index 0000000..e341b09 --- /dev/null +++ b/SOURCES/cmake_paths.patch @@ -0,0 +1,112 @@ +1) Documentation files + +--- galera-26.4.8/CMakeLists.txt 2021-04-08 08:05:44.000000000 +0200 ++++ galera-26.4.8/CMakeLists.txt_patched 2021-06-10 01:40:26.886770832 +0200 +@@ -106,14 +106,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 + ${CMAKE_SOURCE_DIR}/AUTHORS + ${CMAKE_SOURCE_DIR}/COPYING + ${CMAKE_SOURCE_DIR}/README +- DESTINATION doc) ++ DESTINATION ${INSTALL_DOCDIR} ) + install(FILES ${CMAKE_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 + ${CMAKE_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/SOURCES/galera-python3.patch b/SOURCES/galera-python3.patch deleted file mode 100644 index 59bb4f1..0000000 --- a/SOURCES/galera-python3.patch +++ /dev/null @@ -1,17 +0,0 @@ -Upstream PR: -https://github.com/codership/galera/pull/512 - -diff -up galera-25.3.23/SConstruct.bak galera-25.3.23/SConstruct ---- galera-25.3.23/SConstruct.bak 2018-07-13 15:14:49.059835554 +0200 -+++ galera-25.3.23/SConstruct 2018-07-13 15:19:07.717967794 +0200 -@@ -194,8 +194,8 @@ if link != 'default': - env.Replace(LINK = link) - - # Get compiler name/version, CXX may be set to "c++" which may be clang or gcc --cc_version = str(read_first_line(env['CC'].split() + ['--version'])) --cxx_version = str(read_first_line(env['CXX'].split() + ['--version'])) -+cc_version = str(read_first_line(env['CC'].split() + ['--version']).decode()) -+cxx_version = str(read_first_line(env['CXX'].split() + ['--version']).decode()) - - print('Using C compiler executable: ' + env['CC']) - print('C compiler version is: ' + cc_version) diff --git a/SPECS/galera.spec b/SPECS/galera.spec index 6635416..76d4bc5 100644 --- a/SPECS/galera.spec +++ b/SPECS/galera.spec @@ -1,3 +1,10 @@ +# Use main python interpretter version +%if 0%{?fedora} || 0%{?rhel} > 7 +%define __python /usr/bin/python3 +%else +%define __python /usr/bin/python2 +%endif + %global scl rh-mariadb105 %{?scl:%scl_package galera} %{!?scl:%global pkg_name %{name}} @@ -6,11 +13,12 @@ %global scl_upper %{lua:print(string.upper(string.gsub(rpm.expand("%{scl}"), "-", "_")))} %endif + %global daemon_name %{?scl_prefix}garbd Name: %{?scl_prefix}galera -Version: 26.4.7 -Release: 1%{?dist} +Version: 26.4.9 +Release: 3%{?dist} Summary: Synchronous multi-master wsrep provider (replication engine) License: GPLv2 @@ -22,12 +30,14 @@ Source0: http://releases.galeracluster.com/source/%{pkg_name}-%{version}. Patch1: galera-paths.patch Patch2: galera-init-start.patch -Patch3: galera-python3.patch +Patch3: cmake_paths.patch BuildRequires: boost-devel -BuildRequires: check-devel openssl-devel scons +BuildRequires: check-devel openssl-devel cmake systemd Requires: nmap-ncat +Requires: procps-ng + %{?systemd_requires} %description @@ -60,7 +70,25 @@ done %{?scl:scl enable %{scl} - << "EOF"} set -xe export CPPFLAGS="%{optflags}" -scons %{?_smp_mflags} strict_build_flags=0 extra_sysroot=%{_prefix} \ +%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="%{_docdir}/galera/" \ + -DINSTALL_GARBD="%{_bindir}" \ + -DINSTALL_GARBD-SYSTEMD="%{_bindir}" \ + -DINSTALL_CONFIGURATION="%{_sysconfdir}/sysconfig/" \ + -DINSTALL_SYSTEMD_SERVICE="lib/systemd/system" \ + -DINSTALL_LIBDIR="%{_lib}/galera" \ + -DINSTALL_MANPAGE="share/man/man8" + +cmake . -LAH + +make VERBOSE=1 %{?_smp_mflags} + %if 0%{?rhel} < 7 bpostatic=%{_libdir}/libboost_program_options.so %endif @@ -70,17 +98,14 @@ scons %{?_smp_mflags} strict_build_flags=0 extra_sysroot=%{_prefix} \ %install %{?scl:scl enable %{scl} - << "EOF"} set -xe -install -D -m 644 garb/files/garb.service %{buildroot}%{_unitdir}/%{daemon_name}.service -install -D -m 755 garb/files/garb-systemd %{buildroot}%{_bindir}/garb-systemd -install -D -m 755 garb/garbd %{buildroot}%{_bindir}/garbd -install -D -m 755 libgalera_smm.so %{buildroot}%{_libdir}/galera/libgalera_smm.so -install -D -m 644 garb/files/garb.cnf %{buildroot}%{_sysconfdir}/sysconfig/garb -install -D -m 644 COPYING %{buildroot}%{_docdir}/galera/COPYING -install -D -m 644 asio/LICENSE_1_0.txt %{buildroot}%{_docdir}/galera/LICENSE.asio -install -D -m 644 scripts/packages/README %{buildroot}%{_docdir}/galera/README -install -D -m 644 scripts/packages/README-MySQL %{buildroot}%{_docdir}/galera/README-MySQL +make install DESTDIR=%{buildroot} %{?scl:EOF} +mkdir -p %{buildroot}/usr/lib/systemd/system/ + +# Rename the systemd unit file +%{?scl:mv %{buildroot}%{_prefix}/lib/systemd/system/garb.service %{buildroot}/usr/lib/systemd/system/%{?scl_prefix}garbd.service} + %if 0%{?scl:1} # generate a configuration file for daemon cat << EOF | tee -a %{buildroot}%{?_scl_scripts}/garbd-service-environment @@ -94,6 +119,8 @@ cat << EOF | tee -a %{buildroot}%{?_scl_scripts}/garbd-service-environment EOF %endif #scl +%pre +/usr/sbin/useradd -M -r -d /dev/null -s /sbin/nologin -c "Galera Arbitrator Daemon" garb >/dev/null 2>&1 || : %post /sbin/ldconfig @@ -127,25 +154,49 @@ fi %files %config(noreplace,missingok) %{_sysconfdir}/sysconfig/garb + %dir %{_docdir}/galera %dir %{_libdir}/galera + %{_bindir}/garbd %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 -%{_bindir}/garb-systemd + +# PATCH 3: +# Make sure the wrapper script is executable +%attr(755, -, -) %{_bindir}/garb-systemd + +%{_mandir}/man8/garbd.8* + %{_unitdir}/%{daemon_name}.service + %else %{?scl:%_root_sysconfdir}%{!?scl:%_sysconfdir}/rc.d/init.d/%{daemon_name} %endif + %if 0%{?scl:1} %{?_scl_scripts}/garbd-service-environment %endif + %{_libdir}/galera/libgalera_smm.so + +%doc %{_docdir}/galera/AUTHORS %doc %{_docdir}/galera/COPYING %doc %{_docdir}/galera/LICENSE.asio %doc %{_docdir}/galera/README -%doc %{_docdir}/galera/README-MySQL +#%doc %{_docdir}/galera/README-MySQL %changelog +* Wed Jan 19 2022 Lukas Javorsky - 26.4.9-3 +- Explicitly require the 'procps-ng' package +- Otherwise it will not require it in the lightweight systems (e.g. containers) +- and Galera won't work properly + +* Wed Jan 19 2022 Michal Schorm - 26.4.9-2 +- Switch from SCONS build tooling to CMAKE build tooling + +* Wed Jan 19 2022 Lukas Javorsky - 26.4.9-1 +- Rebase to 26.4.9 + * Fri Mar 26 2021 Michal Schorm - 26.4.7-1 - Rebase to 26.4.7