|
@@ -1,18 +1,11 @@
|
|
|
%bcond_with systemd
|
|
|
%bcond_with python3
|
|
|
-%bcond_without cmake
|
|
|
|
|
|
-%define mariadb_version 10.6.7
|
|
|
-
|
|
|
-%if %{with python3}
|
|
|
-%global scons scons-3
|
|
|
-%else
|
|
|
-%global scons scons
|
|
|
-%endif
|
|
|
+%define mariadb_version 10.6.9
|
|
|
|
|
|
Summary: Synchronous multi-master wsrep provider (replication engine)
|
|
|
Name: galera
|
|
|
-Version: 26.4.11
|
|
|
+Version: 26.4.12
|
|
|
Release: 1%{?_dist_release}%{?with_systemd:.systemd}
|
|
|
%global galera_api_version %(echo %{version} | cut -d . -f 1,2)
|
|
|
Group: servers
|
|
@@ -24,21 +17,16 @@ URL: http://galeracluster.com/
|
|
|
# Actually, the truth is, we do use galera source tarball provided by MariaDB on
|
|
|
# following URL (without macros):
|
|
|
# https://mirror.vpsfree.cz/mariadb/mariadb-10.2.13/galera-25.3.23/src/galera-25.3.23.tar.gz
|
|
|
-Source0: https://downloads.mariadb.com/MariaDB/mariadb-%{mariadb_version}/galera-%{version}/src/%{name}-%{version}.tar.gz
|
|
|
-
|
|
|
+Source0: https://archive.mariadb.org/mariadb-%{mariadb_version}/galera-%{version}/src/%{name}-%{version}.tar.gz
|
|
|
Source1: garbd.service
|
|
|
Source2: garbd-wrapper
|
|
|
Source3: garbd.init
|
|
|
|
|
|
-Patch0: galera-python3.patch
|
|
|
+Patch0: cmake_paths.patch
|
|
|
|
|
|
BuildRequires: libboost-devel libboost-filesystem libboost-program-options
|
|
|
BuildRequires: check-devel openssl-devel gcc-c++ asio-devel
|
|
|
-%if %{with cmake}
|
|
|
BuildRequires: cmake ninja
|
|
|
-%else
|
|
|
-BuildRequires: scons
|
|
|
-%endif
|
|
|
%if %{with systemd}
|
|
|
BuildRequires: systemd
|
|
|
%endif
|
|
@@ -66,16 +54,10 @@ replication engine see http://www.codership.com.
|
|
|
|
|
|
%prep
|
|
|
%setup -q
|
|
|
-%if ! %{with cmake}
|
|
|
-%if %{with python3}
|
|
|
-%patch0 -p1
|
|
|
-%endif
|
|
|
-%endif
|
|
|
+%autopatch -p1
|
|
|
+
|
|
|
|
|
|
%build
|
|
|
-%if %{with cmake}
|
|
|
-%global build_ldflags %(echo %{build_ldflags} | sed -e 's/-Wl,--as-needed//')
|
|
|
-%endif
|
|
|
%{set_build_flags}
|
|
|
|
|
|
# Workaround for version 26.4.7
|
|
@@ -85,72 +67,57 @@ export CXXFLAGS="$CXXFLAGS -Wno-error=format"
|
|
|
export CFLAGS="$CFLAGS -Wno-error=format-extra-args -Wno-error=format"
|
|
|
# end of workaroound
|
|
|
|
|
|
-%if %{with cmake}
|
|
|
%cmake \
|
|
|
-GNinja \
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
- -DCMAKE_SKIP_RPATH:BOOL=ON
|
|
|
+ -DCMAKE_SKIP_RPATH:BOOL=ON \
|
|
|
+ -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"
|
|
|
%cmake_build
|
|
|
-%else
|
|
|
-%{scons} %{?_smp_mflags} strict_build_flags=0
|
|
|
-%endif
|
|
|
|
|
|
|
|
|
%install
|
|
|
+%cmake_install
|
|
|
+
|
|
|
%if %{with systemd}
|
|
|
-install -Dpm644 %{SOURCE1} %{buildroot}%{_unitdir}/garbd.service
|
|
|
-install -Dpm755 %{SOURCE2} %{buildroot}%{_sbindir}/garbd-wrapper
|
|
|
+mkdir -p %{buildroot}%{_unitdir}
|
|
|
+mv %{buildroot}/usr/lib/systemd/system/garb.service %{buildroot}%{_unitdir}/garbd.service
|
|
|
+sed -i 's/Alias=garbd.service/Alias=garb.service/g' %{buildroot}%{_unitdir}/garbd.service
|
|
|
+
|
|
|
+sed -i 's;/usr/bin/garb-systemd;/usr/sbin/garb-systemd;g' %{buildroot}%{_unitdir}/garbd.service
|
|
|
+# In the wrapper script:
|
|
|
+sed -i 's;/usr/bin/garbd;/usr/sbin/garbd;g' %{buildroot}/usr/sbin/garb-systemd
|
|
|
+
|
|
|
+sed -i 's/User=nobody/User=garb/g' %{buildroot}%{_unitdir}/garbd.service
|
|
|
%else
|
|
|
+
|
|
|
+rm -f %{buildroot}%{_sbindir}/garb-systemd
|
|
|
+mkdir -p %{buildroot}/var/run/garbd
|
|
|
install -Dpm644 %{SOURCE3} %{buildroot}%{_initdir}/garbd
|
|
|
%endif
|
|
|
-%if %{with cmake}
|
|
|
-%cmake_install
|
|
|
-pushd %{_vpath_builddir}
|
|
|
-
|
|
|
-mkdir -p %{buildroot}%{_libdir}/galera
|
|
|
-mv -f %{buildroot}/usr/lib/libgalera_smm.so %{buildroot}%{_libdir}/galera/
|
|
|
-for f in \
|
|
|
- galera/src/libgalera_smm_static.so galera/src/libgalera.so \
|
|
|
- gcs/src/libgcs4garb.so gcs/src/libgcs.so \
|
|
|
- gcache/src/libgcache.so \
|
|
|
- gcomm/src/libgcomm.so \
|
|
|
-%ifarch x86_64
|
|
|
- galerautils/src/libgalerautils_hw_crc32c.so \
|
|
|
-%endif
|
|
|
- galerautils/src/libgalerautilsxx.so galerautils/src/libgalerautils.so
|
|
|
-do
|
|
|
- install -Dpm755 $f %{buildroot}%{_libdir}/galera/
|
|
|
-done
|
|
|
-popd
|
|
|
-mkdir -p %{buildroot}%{_sbindir}
|
|
|
-mv -f %{buildroot}%{_bindir}/* %{buildroot}%{_sbindir}/
|
|
|
-mv -f %{buildroot}%{_datadir}/* %{buildroot}/usr/doc/
|
|
|
-mv -f %{buildroot}/usr/man %{buildroot}%{_mandir}
|
|
|
-rm -rf rpmdoc
|
|
|
-mv -f %{buildroot}/usr/doc ./rpmdoc
|
|
|
-install -D -m 644 garb/files/garb.cnf %{buildroot}%{_sysconfdir}/sysconfig/garb
|
|
|
-mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
|
|
|
-cat <<EOF > %{buildroot}%{_sysconfdir}/ld.so.conf.d/galera.conf
|
|
|
-%{_libdir}/galera
|
|
|
-EOF
|
|
|
-%else
|
|
|
-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
|
|
|
-%endif
|
|
|
+# drop invalid directory
|
|
|
+rm -rf %{buildroot}/usr/lib/systemd
|
|
|
+
|
|
|
+cp -f %{buildroot}%{_docdir}/galera/LICENSE.asio ./
|
|
|
+rm -f %{buildroot}%{_docdir}/galera/LICENSE.asio
|
|
|
+rm -f %{buildroot}%{_docdir}/galera/COPYING
|
|
|
|
|
|
|
|
|
-%if %{with cmake}
|
|
|
%check
|
|
|
-export LD_LIBRARY_PATH=%{buildroot}%{_libdir}/galera
|
|
|
%ctest
|
|
|
-%endif
|
|
|
|
|
|
|
|
|
+%pre
|
|
|
+/usr/sbin/useradd -M -r -d /dev/null -s /sbin/nologin -c "Galera Arbitrator Daemon" garb >/dev/null 2>&1 || :
|
|
|
+
|
|
|
%post
|
|
|
%if %{with systemd}
|
|
|
%systemd_post garbd.service
|
|
@@ -175,24 +142,28 @@ fi
|
|
|
|
|
|
|
|
|
%files
|
|
|
-%license rpmdoc/COPYING
|
|
|
-%license rpmdoc/LICENSE.asio
|
|
|
-%doc rpmdoc/AUTHORS rpmdoc/README rpmdoc/garb*
|
|
|
+%license COPYING LICENSE.asio
|
|
|
+%doc %{_docdir}/galera/*
|
|
|
%config(noreplace,missingok) %{_sysconfdir}/sysconfig/garb
|
|
|
-%{_sysconfdir}/ld.so.conf.d/galera.conf
|
|
|
%dir %{_libdir}/galera
|
|
|
%{_libdir}/galera/*
|
|
|
%{_sbindir}/garbd
|
|
|
%{_mandir}/man8/*
|
|
|
%if %{with systemd}
|
|
|
-%{_sbindir}/garbd-wrapper
|
|
|
+%{_sbindir}/garb-systemd
|
|
|
%{_unitdir}/garbd.service
|
|
|
%else
|
|
|
+%attr(755, garb, garb) %dir /var/run/garbd
|
|
|
%{_initdir}/garbd
|
|
|
%endif
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
+* Tue Aug 16 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 26.4.12-1
|
|
|
+- new upstream release.
|
|
|
+- dropped scons stuff and Patch0.
|
|
|
+- imported Patch0 from rawhide.
|
|
|
+
|
|
|
* Sun Feb 13 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 26.4.11-1
|
|
|
- new upstream release.
|
|
|
|