| |
@@ -1,6 +1,6 @@
|
| |
Name: galera
|
| |
- Version: 26.4.8
|
| |
- Release: 1%{?dist}
|
| |
+ Version: 26.4.9
|
| |
+ Release: 2%{?dist}
|
| |
Summary: Synchronous multi-master wsrep provider (replication engine)
|
| |
|
| |
License: GPLv2
|
| |
@@ -15,10 +15,12 @@
|
| |
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
|
| |
|
| |
%{?systemd_requires}
|
| |
|
| |
@@ -34,48 +36,77 @@
|
| |
%setup -q
|
| |
%patch0 -p1
|
| |
|
| |
- # Fix for BZ#1959484
|
| |
- # The script is checking the version without the wsrep API number (the first number separated by dot)
|
| |
- # This could be caused by wrongly providing the version from wsrep_load function
|
| |
- # Issue is already reported here: https://github.com/codership/galera/issues/596
|
| |
- # So we can temporary remove API version from the test to make it work, however, we will wait for the upstream's
|
| |
- # solution in the issue linked above
|
| |
- sed -i '/^GALERA_VER/s/API + //' wsrep/tests/SConscript
|
| |
-
|
| |
%build
|
| |
%{set_build_flags}
|
| |
|
| |
- # Print help:
|
| |
- # scons-3 --help
|
| |
- # scons-3 -H
|
| |
|
| |
- # Possibly usefull arguments:
|
| |
- # --debug=findlibs
|
| |
- # --debug=stacktrace
|
| |
- # --warn=all
|
| |
- # debug=0
|
| |
+ %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"
|
| |
|
| |
- # Workaround for version 26.4.7
|
| |
- export CXXFLAGS="$CXXFLAGS -Wno-error=format-extra-args"
|
| |
- # ... and for 32 bit arches
|
| |
- export CXXFLAGS="$CXXFLAGS -Wno-error=format"
|
| |
- export CFLAGS="$CFLAGS -Wno-error=format-extra-args -Wno-error=format"
|
| |
- # end of workaroound
|
| |
+ cmake -B %_vpath_builddir -LAH
|
| |
|
| |
- scons-3 %{?_smp_mflags} strict_build_flags=1
|
| |
+ %cmake_build
|
| |
|
| |
|
| |
%install
|
| |
- 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 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
|
| |
-
|
| |
+ %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/lib/systemd/system/garb.service %{buildroot}/usr/lib/systemd/system/garbd.service
|
| |
+ sed -i 's/Alias=garbd.service/Alias=garb.service/g' %{buildroot}/usr/lib/systemd/system/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/lib/systemd/system/garbd.service
|
| |
+ # In the wrapper script:
|
| |
+ sed -i 's;/usr/bin/garbd;/usr/sbin/garbd;g' %{buildroot}/usr/sbin/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/lib/systemd/system/garbd.service
|
| |
+
|
| |
+ %pre
|
| |
+ /usr/sbin/useradd -M -r -d /dev/null -s /sbin/nologin -c "Galera Arbitrator Daemon" garb >/dev/null 2>&1 || :
|
| |
|
| |
%post
|
| |
/sbin/ldconfig
|
| |
@@ -91,19 +122,43 @@
|
| |
|
| |
%files
|
| |
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/garb
|
| |
+
|
| |
%dir %{_docdir}/galera
|
| |
%dir %{_libdir}/galera
|
| |
+
|
| |
%{_sbindir}/garbd
|
| |
- %{_sbindir}/garbd-wrapper
|
| |
+ #%{_sbindir}/garbd-wrapper
|
| |
+
|
| |
+ # PATCH 3:
|
| |
+ # Make sure the wrapper script is executable
|
| |
+ %attr(755, -, -) %{_sbindir}/garb-systemd
|
| |
+
|
| |
+ %{_mandir}/man8/garbd.8*
|
| |
+
|
| |
%{_unitdir}/garbd.service
|
| |
+
|
| |
%{_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
|
| |
+ * Fri Nov 19 2021 Lukas Javorsky <ljavorsk@redhat.com> - 26.4.9-2
|
| |
+ - 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
|
| |
+
|
| |
+ * Sat Aug 07 2021 Michal Schorm <mschorm@redhat.com> - 26.4.9-1
|
| |
+ - Rebase to 26.4.9
|
| |
+
|
| |
+ * Thu Jul 15 2021 Michal Schorm <mschorm@redhat.com> - 26.4.8-2
|
| |
+ - Switch from SCONS build tooling to CMAKE build tooling
|
| |
+ - Use upstream variants of Systemd service file and Systemd service file wrapper srcipt
|
| |
+
|
| |
* Thu Jun 03 2021 Lukas Javorsky <ljavorsk@redhat.com> - 26.4.8-1
|
| |
- Rebase to 26.4.8
|
| |
|
| |
Also, rebase to version 26.4.9 which is a version built-in MariaDB-10.4.21 (currently in 10.4 MariaDB Fedora branch)