File repmgr.spec.in of Package repmgr
#
# spec file for package
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
%define packageversion ##
%define pgname postgresql%packageversion
%define pgbasedir %_prefix/lib/%pgname
%define pgbindir %pgbasedir/bin
%define pgdatadir %_datadir/%pgname
%define realname repmgr
Name: %{pgname}-%{realname}
Version: 3.3.2
Release: 0
License: GPL-3.0
Summary: Replication Manager for PostgreSQL clusters
Url: http://www.repmgr.org/
Group: Applications/Databases
Source: http://www.repmgr.org/download/repmgr-%{version}.tar.gz
BuildRequires: %{pgname}-server
BuildRequires: %{pgname}-devel
BuildRequires: openssl-devel
BuildRequires: zlib-devel
BuildRequires: krb5-devel
#BuildRequires: libcom_err-devel
BuildRequires: update-alternatives
Requires: %{pgname}-server
Requires: rsync
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(post): update-alternatives
Requires(postun): update-alternatives
Provides: %{realname}-implementation = %{version}-%{release}
Requires: %{realname} = %{version}
%description
repmgr is a set of open source tools that helps DBAs and System administrators
manage a cluster of PostgreSQL databases.
By taking advantage of the Hot Standby capability introduced in PostgreSQL 9,
repmgr greatly simplifies the process of setting up and managing database with
high availability and scalability requirements.
repmgr simplifies administration and daily management, enhances productivity
and reduces the overall costs of a PostgreSQL cluster by:
* monitoring the replication process;
* allowing DBAs to issue high availability operations such as switch-overs
and fail-overs.
%prep
%setup -q -n %{realname}-%{version}
%build
make USE_PGXS=1 %{?_smp_mflags}
%install
%{__install} -d -m 755 %{buildroot}%{pgbindir}
make USE_PGXS=1 install DESTDIR=$RPM_BUILD_ROOT
%post
/usr/sbin/update-alternatives --install \
%{_sbindir}/repmgr repmgr %{pgbindir}/repmgr %{packageversion} \
--slave %{_sbindir}/repmgrd repmgrd %{pgbindir}/repmgrd
%preun
if [ "$1" = 0 ] ; then
/usr/sbin/update-alternatives --remove repmgr %{pgbindir}/repmgr
fi
%files
%defattr(-,root,root)
%doc CREDITS COPYRIGHT HISTORY LICENSE TODO *.md *.rst
%{pgbasedir}/%{_lib}/repmgr_funcs.so
%{pgbindir}/repmgr
%{pgbindir}/repmgrd
%dir %{pgdatadir}/contrib
%{pgdatadir}/contrib/repmgr.sql
%{pgdatadir}/contrib/repmgr_funcs.sql
%{pgdatadir}/contrib/uninstall_repmgr.sql
%{pgdatadir}/contrib/uninstall_repmgr_funcs.sql
%changelog