%global pgmajorversion 10 %global pgpackageversion %(echo %{pgmajorversion} | tr -d .) %global sname repmgr %if 0%{?rhel} && 0%{?rhel} <= 6 %global systemd_enabled 0 %else %global systemd_enabled 1 %endif %global extra_version %{nil} %global _varrundir %{_localstatedir}/run/%{sname} Name: %{sname}%{pgpackageversion} Version: 4.0.6 Release: 1%{nil}%{?dist} Summary: Replication Manager for PostgreSQL Clusters License: GPLv3+ URL: https://www.repmgr.org Source0: http://repmgr.org/download/%{sname}-%{version}%{extra_version}.tar.bz2 Source1: repmgr-pg%{pgpackageversion}.service Source2: repmgr-pg%{pgpackageversion}.init Source3: repmgr-pg%{pgpackageversion}.sysconfig Patch0: repmgr-pg%{pgpackageversion}-config-file-location.patch %if %{systemd_enabled} BuildRequires: systemd # We require this to be present for %%{_prefix}/lib/tmpfiles.d Requires: systemd Requires(post): systemd-sysv Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %else Requires(post): chkconfig Requires(preun): chkconfig # This is for /sbin/service Requires(preun): initscripts Requires(postun): initscripts # This is for older spec files (RHEL <= 6) Group: Applications/Databases BuildRoot: %{_tmppath}/%{name}-%{version}%{extra_version}-%{release}-root-%(%{__id_u} -n) %endif BuildRequires: postgresql, postgresql-devel, postgresql-static BuildRequires: libxslt-devel, pam-devel, openssl-devel, readline-devel Requires: postgresql-server %description repmgr is an open-source tool suite for managing replication and failover in a cluster of PostgreSQL servers. It enhances PostgreSQL's built-in hot-standby capabilities with tools to set up standby servers, monitor replication, and perform administrative tasks such as failover or manual switchover operations. repmgr4 is a complete rewrite of the existing repmgr codebase and brings with it many improvements and additional functionality. If upgrading from repmgr3, please read the documentation carefully as there are a number of changes, particularly in the configuration file and command line option handling. %prep %setup -q -n %{sname}-%{version}%{extra_version} %patch0 -p0 %build PG_CONFIG=/usr/bin/pg_config ./configure %{__make} PG_CONFIG=/usr/bin/pg_config USE_PGXS=1 %{?_smp_mflags} %install %{__mkdir} -p %{buildroot}/usr/bin/ %if %{systemd_enabled} # Use new %%make_install macro: USE_PGXS=1 %make_install DESTDIR=%{buildroot} %else # Use older version USE_PGXS=1 %{__make} install DESTDIR=%{buildroot} %endif %{__mkdir} -p %{buildroot}/usr/bin/ %{__mkdir} -p %{buildroot}/%{_sysconfdir}/%{sname}/%{pgmajorversion}/ %if %{systemd_enabled} install -d %{buildroot}%{_unitdir} install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service # ... and make a tmpfiles script to recreate it at reboot. %{__mkdir} -p %{buildroot}%{_tmpfilesdir} cat > %{buildroot}%{_tmpfilesdir}/%{name}.conf < 4.0.6-1 - Upstream release 4.0.6-1 * Tue May 1 2018 - Pallavi Sontakke 4.0.5-1 - Upstream release 4.0.5-1 * Thu Mar 8 2018 - Marco Nenciarini 4.0.4-1 - Upstream release 4.0.4-1 * Wed Feb 14 2018 - Giulio Calacoci 4.0.3-1 - Upstream release 4.0.3-1 * Wed Jan 17 2018 - Giulio Calacoci 4.0.2-1 - Upstream release 4.0.2-1 * Mon Dec 11 2017 - Marco Nenciarini 4.0.1-1 - Upstream release 4.0.1-1 * Mon Nov 20 2017 - Giulio Calacoci 4.0.0-1 - Upstream release 4.0.0-1 * Tue Sep 10 2017 - Ian Barwick 4.0-0.1.beta1 - Upstream release 4.0-beta1