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