c8d6b6
Name:           galera
2b94ae
Version:        26.4.11
2b94ae
Release:        1%{?dist}
c8d6b6
Summary:        Synchronous multi-master wsrep provider (replication engine)
c8d6b6
c8d6b6
License:        GPLv2
c8d6b6
URL:            http://galeracluster.com/
c8d6b6
c8d6b6
# Actually, the truth is, we do use galera source tarball provided by MariaDB on
c8d6b6
# following URL (without macros):
c8d6b6
#   https://archive.mariadb.org/mariadb-10.4.16/galera-26.4.6/src/galera-26.4.6.tar.gz
c8d6b6
c8d6b6
Source0:        http://releases.galeracluster.com/source/%{name}-%{version}.tar.gz
c8d6b6
c8d6b6
Source1:        garbd.service
c8d6b6
Source2:        garbd-wrapper
c8d6b6
c8d6b6
Patch0:         cmake_paths.patch
c8d6b6
c8d6b6
BuildRequires:  boost-devel check-devel openssl-devel cmake systemd gcc-c++ asio-devel
c8d6b6
Requires(pre):  /usr/sbin/useradd
c8d6b6
Requires:       nmap-ncat
c8d6b6
Requires:       procps-ng
c8d6b6
c8d6b6
%{?systemd_requires}
c8d6b6
c8d6b6
c8d6b6
%description
2b94ae
Galera is a fast synchronous multimaster wsrep provider (replication engine)
c8d6b6
for transactional databases and similar applications. For more information
2b94ae
about wsrep API see https://github.com/codership/wsrep-API repository. For a
2b94ae
description of Galera replication engine see https://www.galeracluster.com web.
c8d6b6
c8d6b6
c8d6b6
%prep
c8d6b6
%setup -q
c8d6b6
%patch0 -p1
c8d6b6
c8d6b6
%build
c8d6b6
%{set_build_flags}
c8d6b6
c8d6b6
2b94ae
%cmake \
c8d6b6
       -DCMAKE_BUILD_TYPE="%{?with_debug:Debug}%{!?with_debug:RelWithDebInfo}" \
c8d6b6
       -DINSTALL_LAYOUT=RPM \
c8d6b6
       -DCMAKE_RULE_MESSAGES:BOOL=OFF \
c8d6b6
       \
c8d6b6
       -DBUILD_SHARED_LIBS:BOOL=OFF \
c8d6b6
       \
c8d6b6
       -DINSTALL_DOCDIR="share/doc/%{name}/" \
c8d6b6
       -DINSTALL_GARBD="sbin" \
c8d6b6
       -DINSTALL_GARBD-SYSTEMD="sbin" \
c8d6b6
       -DINSTALL_CONFIGURATION="/etc/sysconfig/" \
c8d6b6
       -DINSTALL_SYSTEMD_SERVICE="lib/systemd/system" \
c8d6b6
       -DINSTALL_LIBDIR="%{_lib}/galera" \
c8d6b6
       -DINSTALL_MANPAGE="share/man/man8"
c8d6b6
c8d6b6
cmake -B %_vpath_builddir -LAH
c8d6b6
c8d6b6
%cmake_build
c8d6b6
c8d6b6
c8d6b6
%install
c8d6b6
%cmake_install
c8d6b6
c8d6b6
# PATCH 1:
c8d6b6
#   Change the Systemd service name from "garb" to "garbd"
c8d6b6
#
c8d6b6
#   The Galera upstream uses name "garb" for the service while providing "garbd" alias
c8d6b6
#   Fedora downstream packaging historically used "garbd" name for the service.
c8d6b6
#
c8d6b6
#   Let's stick with the Fedora legacy naming, AND provide an alias to the Galera upstream name
c8d6b6
mv %{buildroot}/usr/lib/systemd/system/garb.service %{buildroot}/usr/lib/systemd/system/garbd.service
c8d6b6
sed -i 's/Alias=garbd.service/Alias=garb.service/g' %{buildroot}/usr/lib/systemd/system/garbd.service
c8d6b6
c8d6b6
# PATCH 2:
c8d6b6
#   Fix the hardcoded paths
c8d6b6
#     In the Systemd service file:
c8d6b6
sed -i 's;/usr/bin/garb-systemd;/usr/sbin/garb-systemd;g' %{buildroot}/usr/lib/systemd/system/garbd.service
c8d6b6
#     In the wrapper script:
c8d6b6
sed -i 's;/usr/bin/garbd;/usr/sbin/garbd;g' %{buildroot}/usr/sbin/garb-systemd
c8d6b6
c8d6b6
# PATCH 4:
c8d6b6
#  Use a dedicated user for the Systemd service
c8d6b6
#  To fix an security issue reported by Systemd:
c8d6b6
#
c8d6b6
## systemd[1]: /usr/lib/systemd/system/garb.service:14: Special user nobody configured, this is not safe!
c8d6b6
##   Subject: Special user nobody configured, this is not safe!
c8d6b6
##   Defined-By: systemd
c8d6b6
##   Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
c8d6b6
##   Documentation: https://systemd.io/UIDS-GIDS
c8d6b6
##
c8d6b6
##   The unit garb.service is configured to use User=nobody.
c8d6b6
##
c8d6b6
##   This is not safe. The nobody user's main purpose on Linux-based
c8d6b6
##   operating systems is to be the owner of files that otherwise cannot be mapped
c8d6b6
##   to any local user. It's used by the NFS client and Linux user namespacing,
c8d6b6
##   among others. By running a unit's processes under the identity of this user
c8d6b6
##   they might possibly get read and even write access to such files that cannot
c8d6b6
##   otherwise be mapped.
c8d6b6
##
c8d6b6
##   It is strongly recommended to avoid running services under this user identity,
c8d6b6
##   in particular on systems using NFS or running containers. Allocate a user ID
c8d6b6
##   specific to this service, either statically via systemd-sysusers or dynamically
c8d6b6
##   via the DynamicUser= service setting.
c8d6b6
sed -i 's/User=nobody/User=garb/g' %{buildroot}/usr/lib/systemd/system/garbd.service
c8d6b6
2b94ae
2b94ae
%check
2b94ae
%ctest
2b94ae
2b94ae
c8d6b6
%pre
c8d6b6
/usr/sbin/useradd -M -r -d /dev/null -s /sbin/nologin -c "Galera Arbitrator Daemon" garb >/dev/null 2>&1 || :
c8d6b6
c8d6b6
%post
c8d6b6
/sbin/ldconfig
c8d6b6
%systemd_post garbd.service
c8d6b6
c8d6b6
%preun
c8d6b6
%systemd_preun garbd.service
c8d6b6
c8d6b6
%postun
c8d6b6
/sbin/ldconfig
c8d6b6
%systemd_postun_with_restart garbd.service
c8d6b6
c8d6b6
c8d6b6
%files
c8d6b6
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/garb
c8d6b6
c8d6b6
%dir %{_docdir}/galera
c8d6b6
%dir %{_libdir}/galera
c8d6b6
c8d6b6
%{_sbindir}/garbd
c8d6b6
#%{_sbindir}/garbd-wrapper
c8d6b6
c8d6b6
# PATCH 3:
c8d6b6
#   Make sure the wrapper script is executable
c8d6b6
%attr(755, -, -) %{_sbindir}/garb-systemd
c8d6b6
c8d6b6
%{_mandir}/man8/garbd.8*
c8d6b6
c8d6b6
%{_unitdir}/garbd.service
c8d6b6
c8d6b6
%{_libdir}/galera/libgalera_smm.so
c8d6b6
c8d6b6
%doc %{_docdir}/galera/AUTHORS
c8d6b6
%doc %{_docdir}/galera/COPYING
c8d6b6
%doc %{_docdir}/galera/LICENSE.asio
c8d6b6
%doc %{_docdir}/galera/README
c8d6b6
#%doc %{_docdir}/galera/README-MySQL
c8d6b6
c8d6b6
c8d6b6
%changelog
2b94ae
* Sun Feb 20 2022 Michal Schorm <mschorm@redhat.com> - 26.4.11-1
2b94ae
- Rebase to 26.4.11
2b94ae
c8d6b6
* Fri Nov 19 2021 Lukas Javorsky <ljavorsk@redhat.com> - 26.4.9-2
c8d6b6
- Explicitly require the 'procps-ng' package
c8d6b6
- Otherwise it will not require it in the lightweight systems (e.g. containers)
c8d6b6
- and Galera won't work properly
c8d6b6
c8d6b6
* Tue Aug 17 2021 Michal Schorm <mschorm@redhat.com> - 26.4.9-1
c8d6b6
- Rebase to 26.4.9
c8d6b6
c8d6b6
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com>
c8d6b6
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
c8d6b6
  Related: rhbz#1991688
c8d6b6
c8d6b6
* Thu Jul 15 2021 Michal Schorm <mschorm@redhat.com> - 26.4.8-2
c8d6b6
- Switch from SCONS build tooling to CMAKE build tooling
c8d6b6
- Use upstream variants of Systemd service file and Systemd service file wrapper srcipt
c8d6b6
c8d6b6
* Thu Jun 03 2021 Lukas Javorsky <ljavorsk@redhat.com> - 26.4.8-1
c8d6b6
- Rebase to 26.4.8
c8d6b6
c8d6b6
* Wed Jun 16 2021 Mohan Boddu <mboddu@redhat.com> - 26.4.7-3
c8d6b6
- Rebuilt for RHEL 9 BETA for openssl 3.0
c8d6b6
  Related: rhbz#1971065
c8d6b6
c8d6b6
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 26.4.7-2
c8d6b6
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
c8d6b6
c8d6b6
* Tue Feb 23 2021 Michal Schorm <mschorm@redhat.com> - 26.4.7-1
c8d6b6
- Rebase to 26.4.7
c8d6b6
c8d6b6
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 26.4.6-3
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
c8d6b6
c8d6b6
* Fri Jan 22 2021 Jonathan Wakely <jwakely@redhat.com> - 26.4.6-2
c8d6b6
- Rebuilt for Boost 1.75
c8d6b6
c8d6b6
* Wed Nov 04 2020 Michal Schorm <mschorm@redhat.com> - 26.4.6-1
c8d6b6
- Rebase to 26.4.6
c8d6b6
c8d6b6
* Thu Sep 17 2020 Michal Schorm <mschorm@redhat.com> - 26.4.5-2
c8d6b6
- Extend the workaround also to ELN
c8d6b6
c8d6b6
* Wed Sep 16 2020 Michal Schorm <mschorm@redhat.com> - 26.4.5-1
c8d6b6
- Rebase to 26.4.5
c8d6b6
c8d6b6
* Wed Sep 16 2020 Michal Schorm <mschorm@redhat.com> - 26.4.4-5
c8d6b6
- Apply workaround for FTBFS on F33+
c8d6b6
c8d6b6
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 26.4.4-4
c8d6b6
- Second attempt - Rebuilt for
c8d6b6
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
c8d6b6
c8d6b6
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 26.4.4-3
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
c8d6b6
c8d6b6
* Mon Jun 08 2020 Michal Schorm <mschorm@redhat.com> - 26.4.4-2
c8d6b6
- Second rebuild for Boost 1.73
c8d6b6
c8d6b6
* Fri Jun 05 2020 Michal Schorm <mschorm@redhat.com> - 26.4.4-1
c8d6b6
- Rebase to 26.4.4
c8d6b6
  Resolves: rhbz#1546787
c8d6b6
c8d6b6
* Thu May 28 2020 Jonathan Wakely <jwakely@redhat.com> - 26.4.3-4
c8d6b6
- Rebuilt for Boost 1.73
c8d6b6
c8d6b6
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 26.4.3-3
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
c8d6b6
c8d6b6
* Sat Jan 18 2020 Michal Schorm <mschorm@redhat.com> - 26.4.3-2
c8d6b6
- Rebase to 26.4.3
c8d6b6
c8d6b6
* Wed Nov 06 2019 Michal Schorm <mschorm@redhat.com> - 25.3.28-1
c8d6b6
- Rebase to 25.3.28
c8d6b6
c8d6b6
* Thu Aug 01 2019 Michal Schorm <mschorm@redhat.com> - 25.3.26-3
c8d6b6
- Fix for #1735233 and #1737108
c8d6b6
c8d6b6
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 25.3.26-2
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
c8d6b6
c8d6b6
* Fri Jul 19 2019 Michal Schorm <mschorm@redhat.com> - 25.3.26-1
c8d6b6
- Rebase to 25.3.26
c8d6b6
c8d6b6
* Fri Jul 19 2019 Michal Schorm <mschorm@redhat.com> - 25.3.25-4
c8d6b6
- Use macro for setting up the compiler flags
c8d6b6
c8d6b6
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 25.3.25-3
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
c8d6b6
c8d6b6
* Tue Jan 29 2019 Jonathan Wakely <jwakely@redhat.com> - 25.3.25-2
c8d6b6
- Rebuilt for Boost 1.69
c8d6b6
c8d6b6
* Tue Jan 01 2019 Michal Schorm <mschorm@redhat.com> - 25.3.25-1
c8d6b6
- Rebase to 25.3.25
c8d6b6
c8d6b6
* Mon Jul 16 2018 Honza Horak <hhorak@redhat.com> - 25.3.23-5
c8d6b6
- Require asio also on rhel
c8d6b6
c8d6b6
* Fri Jul 13 2018 Honza Horak <hhorak@redhat.com> - 25.3.23-4
c8d6b6
- Add explicit gcc-c++ BR
c8d6b6
- Use python3-scons
c8d6b6
c8d6b6
* Fri Jul 13 2018 Honza Horak <hhorak@redhat.com> - 25.3.23-3
c8d6b6
- Do not require asio on rhel
c8d6b6
c8d6b6
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 25.3.23-2
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
c8d6b6
c8d6b6
* Fri Feb 16 2018 Michal Schorm <mschorm@redhat.com> - 25.3.23-1
c8d6b6
- Update to 25.3.23
c8d6b6
c8d6b6
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 25.3.22-2
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c8d6b6
c8d6b6
* Fri Nov 24 2017 Honza Horak <hhorak@redhat.com> - 25.3.22-1
c8d6b6
- Update to 25.3.22
c8d6b6
c8d6b6
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 25.3.16-6
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
c8d6b6
c8d6b6
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 25.3.16-5
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c8d6b6
c8d6b6
* Mon Jul 03 2017 Jonathan Wakely <jwakely@redhat.com> - 25.3.16-4
c8d6b6
- Rebuilt for Boost 1.64
c8d6b6
c8d6b6
* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 25.3.16-3
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild
c8d6b6
c8d6b6
* Sat Feb 18 2017 Jonathan Wakely <jwakely@redhat.com> - 25.3.16-2
c8d6b6
- Use asio-devel instead of bundled asio library
c8d6b6
c8d6b6
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 25.3.16-2
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
c8d6b6
c8d6b6
* Wed Jun 22 2016 Mike Bayer <mbayer@redhat.com> - 25.3.16-1
c8d6b6
- Update to 25.3.16
c8d6b6
c8d6b6
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 25.3.12-4
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
c8d6b6
c8d6b6
* Fri Jan 15 2016 Jonathan Wakely <jwakely@redhat.com> - 25.3.12-3
c8d6b6
- Rebuilt for Boost 1.60
c8d6b6
c8d6b6
* Wed Sep 30 2015 Marcin Juszkiewicz <mjuszkiewicz@redhat.com> - 25.3.12-2
c8d6b6
- Remove use of -mtune=native which breaks build on secondary architectures
c8d6b6
c8d6b6
* Fri Sep 25 2015 Richard W.M. Jones <rjones@redhat.com> - 25.3.12-1
c8d6b6
- Update to 25.3.12.
c8d6b6
- Should fix the build on 32 bit ARM (RHBZ#1241164).
c8d6b6
- Remove ExcludeArch (should have read the BZ more closely).
c8d6b6
c8d6b6
* Thu Aug 27 2015 Jonathan Wakely <jwakely@redhat.com> - 25.3.10-5
c8d6b6
- Rebuilt for Boost 1.59
c8d6b6
c8d6b6
* Wed Jul 29 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 25.3.10-4
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159
c8d6b6
c8d6b6
* Wed Jul 22 2015 David Tardon <dtardon@redhat.com> - 25.3.10-3
c8d6b6
- rebuild for Boost 1.58
c8d6b6
c8d6b6
* Wed Jul 08 2015 Ryan O'Hara <rohara@redhat.com> - 25.3.10-2
c8d6b6
- Disable ARM builds (#1241164, #1239516)
c8d6b6
c8d6b6
* Mon Jul 06 2015 Ryan O'Hara <rohara@redhat.com> - 25.3.10-1
c8d6b6
- Update to version 25.3.10
c8d6b6
c8d6b6
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 25.3.5-11
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
c8d6b6
c8d6b6
* Mon Jan 26 2015 Petr Machata <pmachata@redhat.com> - 25.3.5-10
c8d6b6
- Rebuild for boost 1.57.0
c8d6b6
c8d6b6
* Thu Nov 27 2014 Richard W.M. Jones <rjones@redhat.com> - 25.3.5-9
c8d6b6
- Add aarch64 support.
c8d6b6
c8d6b6
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 25.3.5-8
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
c8d6b6
c8d6b6
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 25.3.5-7
c8d6b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
c8d6b6
c8d6b6
* Fri May 23 2014 Petr Machata <pmachata@redhat.com> - 25.3.5-6
c8d6b6
- Rebuild for boost 1.55.0
c8d6b6
c8d6b6
* Wed Apr 30 2014 Dan HorĂ¡k <dan[at]danny.cz> - 25.3.5-5
c8d6b6
- set ExclusiveArch
c8d6b6
c8d6b6
* Thu Apr 24 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.5-4
c8d6b6
- Use strict_build_flags=0 to avoid -Werror
c8d6b6
- Remove unnecessary clean section
c8d6b6
c8d6b6
* Thu Apr 24 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.5-3
c8d6b6
- Include galera directories in file list
c8d6b6
- Set CPPFLAGS to optflags
c8d6b6
c8d6b6
* Wed Apr 23 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.5-2
c8d6b6
- Fix client certificate verification (#1090604)
c8d6b6
c8d6b6
* Thu Mar 27 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.5-1
c8d6b6
- Update to version 25.3.5
c8d6b6
c8d6b6
* Mon Mar 24 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.3-2
c8d6b6
- Add systemd service
c8d6b6
c8d6b6
* Sun Mar 09 2014 Ryan O'Hara <rohara@redhat.com> - 25.3.3-1
c8d6b6
- Initial build