import galera-25.3.34-4.module+el8.5.0+14124+14ced695

This commit is contained in:
CentOS Sources 2022-04-26 09:53:01 -04:00 committed by Stepan Oksanichenko
parent f3562de379
commit bcdb7c667a
5 changed files with 220 additions and 47 deletions

View File

@ -1 +1 @@
8f915b0e053999e7963f15b3f4364ca774e843d9 SOURCES/galera-25.3.32.tar.gz
606d24508034b96a839396fd0e1a8a44c3e7ac9a SOURCES/galera-25.3.34.tar.gz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/galera-25.3.32.tar.gz
SOURCES/galera-25.3.34.tar.gz

117
SOURCES/cmake_paths.patch Normal file
View File

@ -0,0 +1,117 @@
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,17 +106,23 @@
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)
install(FILES ${CMAKE_SOURCE_DIR}/chromium/LICENSE
- DESTINATION doc
+ DESTINATION ${INSTALL_DOCDIR}
RENAME LICENSE.chromium)
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.

View File

@ -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.26/SConstruct.bak 2018-07-13 15:14:49.059835554 +0200
+++ galera-25.3.26/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)

View File

@ -1,6 +1,6 @@
Name: galera
Version: 25.3.32
Release: 1%{?dist}
Version: 25.3.34
Release: 4%{?dist}
Summary: Synchronous multi-master wsrep provider (replication engine)
License: GPLv2
@ -8,17 +8,19 @@ URL: http://galeracluster.com/
# Actually, the truth is, we do use galera source tarball provided by MariaDB on
# following URL (without macros):
# https://archive.mariadb.org/mariadb-10.3.26/galera-25.3.31/src/galera-25.3.31.tar.gz
# https://archive.mariadb.org/mariadb-10.3.32/galera-25.3.34/src/galera-25.3.34.tar.gz
Source0: http://releases.galeracluster.com/source/%{name}-%{version}.tar.gz
Source1: garbd.service
Source2: garbd-wrapper
Patch0: galera-python3.patch
Patch0: cmake_paths.patch
BuildRequires: boost-devel check-devel openssl-devel python3-scons systemd gcc-c++ asio-devel
BuildRequires: boost-devel check-devel openssl-devel cmake systemd gcc-c++ asio-devel
Requires(pre): /usr/sbin/useradd
Requires: nmap-ncat
Requires: procps-ng
Requires(post): systemd
@ -40,36 +42,77 @@ replication engine see http://www.codership.com.
%build
%{set_build_flags}
# Print help:
# scons-3 --help
# scons-3 -H
%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="share/doc/galera" \
-DINSTALL_CONFIGURATION="/etc/sysconfig/" \
-DINSTALL_SYSTEMD_SERVICE="share/doc/galera" \
-DINSTALL_LIBDIR="%{_lib}/galera" \
-DINSTALL_MANPAGE="share/man/man8"
# Possibly usefull arguments:
# --debug=findlibs
# --debug=stacktrace
# --warn=all
# debug=0
%ifarch i686
scons-3 %{?_smp_mflags} strict_build_flags=0
%else
scons-3 %{?_smp_mflags} strict_build_flags=1
%endif
cmake -B %_vpath_builddir -LAH
%cmake_build
%install
%cmake_install
# PATCH 1:
# Change the Systemd service name from "garb" to "garbd"
#
# The Galera upstream uses name "garb" for the service while providing "garbd" alias
# Fedora downstream packaging historically used "garbd" name for the service.
#
# Let's stick with the Fedora legacy naming, AND provide an alias to the Galera upstream name
mv %{buildroot}/usr/share/doc/galera/garb.service %{buildroot}/usr/share/doc/galera/garbd.service
sed -i 's/Alias=garbd.service/Alias=garb.service/g' %{buildroot}/usr/share/doc/galera/garbd.service
# PATCH 2:
# Fix the hardcoded paths
# In the Systemd service file:
sed -i 's;/usr/bin/garb-systemd;/usr/sbin/garb-systemd;g' %{buildroot}/usr/share/doc/galera/garbd.service
# In the wrapper script:
sed -i 's;/usr/bin/garbd;/usr/sbin/garbd;g' %{buildroot}/usr/share/doc/galera/garb-systemd
# PATCH 4:
# Use a dedicated user for the Systemd service
# To fix an security issue reported by Systemd:
#
## systemd[1]: /usr/lib/systemd/system/garb.service:14: Special user nobody configured, this is not safe!
## Subject: Special user nobody configured, this is not safe!
## Defined-By: systemd
## Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
## Documentation: https://systemd.io/UIDS-GIDS
##
## The unit garb.service is configured to use User=nobody.
##
## This is not safe. The nobody user's main purpose on Linux-based
## operating systems is to be the owner of files that otherwise cannot be mapped
## to any local user. It's used by the NFS client and Linux user namespacing,
## among others. By running a unit's processes under the identity of this user
## they might possibly get read and even write access to such files that cannot
## otherwise be mapped.
##
## It is strongly recommended to avoid running services under this user identity,
## in particular on systems using NFS or running containers. Allocate a user ID
## specific to this service, either statically via systemd-sysusers or dynamically
## via the DynamicUser= service setting.
sed -i 's/User=nobody/User=garb/g' %{buildroot}/usr/share/doc/galera/garbd.service
# Install old service and wrapper to maintain compatibility
install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/garbd.service
install -D -m 755 %{SOURCE2} %{buildroot}%{_sbindir}/garbd-wrapper
install -D -m 755 garb/garbd %{buildroot}%{_sbindir}/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 chromium/LICENSE %{buildroot}%{_docdir}/galera/LICENSE.chromium
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
%pre
/usr/sbin/useradd -M -r -d /dev/null -s /sbin/nologin -c "Galera Arbitrator Daemon" garb >/dev/null 2>&1 || :
%post
/sbin/ldconfig
@ -85,20 +128,50 @@ install -D -m 644 scripts/packages/README-MySQL %{buildroot}%{_docdir}/galera/RE
%files
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/garb
%dir %{_docdir}/galera
%dir %{_libdir}/galera
%{_sbindir}/garbd
%{_sbindir}/garbd-wrapper
# PATCH 3:
# Make sure the wrapper script is executable
%attr(755, -, -) %{_docdir}/galera/garb-systemd
%{_mandir}/man8/garbd.8*
%{_unitdir}/garbd.service
%{_docdir}/galera/garbd.service
%{_libdir}/galera/libgalera_smm.so
%doc %{_docdir}/galera/AUTHORS
%doc %{_docdir}/galera/COPYING
%doc %{_docdir}/galera/LICENSE.asio
%doc %{_docdir}/galera/LICENSE.chromium
%doc %{_docdir}/galera/README
%doc %{_docdir}/galera/README-MySQL
#%doc %{_docdir}/galera/README-MySQL
%changelog
* Thu Feb 03 2022 Lukas Javorsky <ljavorsk@redhat.com> - 25.3.34-4
- 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
* Fri Jan 28 2022 Lukas Javorsky <ljavorsk@redhat.com> - 25.3.34-3
- Use downstream garbd-wrapper and garbd.service to ensure compatibility
- Add upstream versions of garbd-wrapper (called garbd-systemd) and garbd.service
in case user want's to use them
* Wed Jan 19 2022 Michal Schorm <mschorm@redhat.com> - 25.3.34-2
- Switch from SCONS build tooling to CMAKE build tooling
* Wed Jan 19 2022 Zuzana Miklankova <zmiklank@redhat.com> - 25.3.34-1
- Rebase to 25.3.34
Resolves: #2042298
* Tue Mar 23 2021 Michal Schorm <mschorm@redhat.com> - 25.3.32-1
- Rebase to 25.3.32