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