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