Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37710275
en ru br
Репозитории ALT

Группа :: Базы Данных
Пакет: postgresql15-repmgr

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: postgresql15-repmgr-5.4.1.patch
Скачать


 .gear/repmgr.init                                  | 105 ++++++++++++++++++
 .gear/repmgr.service                               |  21 ++++
 .gear/repmgr.sudoers                               |   2 +
 .gear/repmgr.sysconfig                             |   5 +
 .gear/repmgr.tmpfiles                              |   1 +
 .gear/rules                                        |   8 ++
 .../tags/d1d748166632ec24160fe038f7e6b476f6fac014  |  22 ++++
 .gear/tags/list                                    |   1 +
 .gear/upstream/remotes                             |   3 +
 Makefile.in                                        |   4 +-
 repmgr.spec                                        | 121 +++++++++++++++++++++
 11 files changed, 291 insertions(+), 2 deletions(-)
diff --git a/.gear/repmgr.init b/.gear/repmgr.init
new file mode 100755
index 0000000..2a10316
--- /dev/null
+++ b/.gear/repmgr.init
@@ -0,0 +1,105 @@
+#!/bin/sh
+#
+# /etc/init.d/repmgr
+#
+# pgbouncer		This is the init script for starting up the pgbouncer daemon
+# repmgrd		Start repmgrd daemon
+# chkconfig:	- 90 14
+# description: repmgr is a replication manager, and failover management tool for PostgreSQL
+#
+# processname: repmgrd
+# pidfile: /run/repmgr/repmgr.pid
+#
+#
+## BEGIN INIT INFO
+# Provides: repmgrd
+# Required-Start: $local_fs $remote_fs $network $syslog $named
+# Required-Stop: $local_fs $remote_fs $network $syslog $named
+# Should-Start: postgresql
+# Default-Start: 3 4 5
+# Default-Stop:  0 1 2 6
+# Short-Description: Start repmgrd daemon
+# Description: repmgrd is replication manager, and failover management tool
+### END INIT INFO
+
+# Do not load RH compatibility interface.
+WITHOUT_RC_COMPAT=1
+
+# Source function library.
+. /etc/init.d/functions
+
+RETVAL=0
+
+PGUSER=postgres
+NAME="repmgrd"
+REPMGR_CONF="/etc/repmgr/repmgr.conf"
+PIDFILE="/run/repmgr/repmgr.pid"
+LOCKFILE="/var/lock/subsys/repmgr"
+SourceIfNotEmpty /etc/sysconfig/repmgr
+
+start()
+{
+	start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --displayname "$NAME" --user $PGUSER --expect-user $PGUSER -- "$NAME" -d -f "$REPMGR_CONF" "$REPMGRD_OPTS"
+	RETVAL=$?
+	return $RETVAL
+}
+
+stop()
+{
+	stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user $PGUSER --displayname "$NAME" -- "$NAME"
+	RETVAL=$?
+	return $RETVAL
+}
+
+restart()
+{
+	stop $1
+	start $1
+}
+
+reload()
+{
+	msg_reloading "$NAME"
+	stop_daemon --pidfile "$PIDFILE" --expect-user $PGUSER -HUP -- "$NAME"
+	RETVAL=$?
+	return $RETVAL
+}
+
+case "$1" in
+	start)
+		start
+		;;
+	stop)
+		stop
+		;;
+	restart)
+		restart
+		;;
+	reload)
+		reload
+		;;
+	status )
+		status --pidfile "$PIDFILE" --expect-user $PGUSER -- "$NAME"
+		RETVAL=$?
+		;;
+	condstop)
+		if [ -e "$LOCKFILE" ]; then
+			stop
+		fi
+		;;
+	condrestart)
+		if [ -e "$LOCKFILE" ]; then
+			restart
+		fi
+		;;
+	condreload)
+		if [ -e "$LOCKFILE" ]; then
+			reload
+		fi
+		;;
+	*)
+		msg_usage "${0##*/} {start|stop|reload|restart|status|condstop|condreload|condrestart}"
+		RETVAL=1
+esac
+
+exit $RETVAL
diff --git a/.gear/repmgr.service b/.gear/repmgr.service
new file mode 100644
index 0000000..4382997
--- /dev/null
+++ b/.gear/repmgr.service
@@ -0,0 +1,21 @@
+
+[Unit]
+Description=Replication Manager for PostgreSQL
+After=network.target
+After=postgresql.service
+
+[Service]
+User=postgres
+Group=postgres
+
+# Location of repmgr conf file:
+Environment=REPMGR_CONF=/etc/repmgr/repmgr.conf
+EnvironmentFile=-/etc/sysconfig/repmgr
+ExecStart=/usr/bin/repmgrd -f ${REPMGR_CONF} --daemonize=false --no-pid-file ${REPMGRD_OPTS}
+ExecReload=/bin/kill -HUP $MAINPID
+
+# Give a reasonable amount of time for the server to start up/shut down
+TimeoutSec=300
+
+[Install]
+WantedBy=multi-user.target
diff --git a/.gear/repmgr.sudoers b/.gear/repmgr.sudoers
new file mode 100644
index 0000000..91f614e
--- /dev/null
+++ b/.gear/repmgr.sudoers
@@ -0,0 +1,2 @@
+Defaults:postgres !requiretty
+postgres ALL=(ALL) NOPASSWD: /sbin/service stop postgresql,/sbin/service status postgresql,/sbin/service start postgresql,/sbin/service restart postgresql,/sbin/service reload postgresql
diff --git a/.gear/repmgr.sysconfig b/.gear/repmgr.sysconfig
new file mode 100644
index 0000000..28c1715
--- /dev/null
+++ b/.gear/repmgr.sysconfig
@@ -0,0 +1,5 @@
+# Repmgr conf file
+REPMGR_CONF=/etc/repmgr/repmgr.conf
+
+# Options for repmgrd
+#REPMGRD_OPTS="--verbose"
diff --git a/.gear/repmgr.tmpfiles b/.gear/repmgr.tmpfiles
new file mode 100644
index 0000000..20704ae
--- /dev/null
+++ b/.gear/repmgr.tmpfiles
@@ -0,0 +1 @@
+d /run/repmgr 0775 root postgres -
diff --git a/.gear/rules b/.gear/rules
new file mode 100644
index 0000000..496e0e9
--- /dev/null
+++ b/.gear/rules
@@ -0,0 +1,8 @@
+specsubst: pgver
+tar: v@version@:.
+diff: v@version@:. . name=@name@-@version@.patch
+copy?: .gear/*.init
+copy?: .gear/*.service
+copy?: .gear/*.sudoers
+copy?: .gear/*.sysconfig
+copy?: .gear/*.tmpfiles
diff --git a/.gear/tags/d1d748166632ec24160fe038f7e6b476f6fac014 b/.gear/tags/d1d748166632ec24160fe038f7e6b476f6fac014
new file mode 100644
index 0000000..36135f5
--- /dev/null
+++ b/.gear/tags/d1d748166632ec24160fe038f7e6b476f6fac014
@@ -0,0 +1,22 @@
+object 9ab4acea78d54a134d373a66bb6c3cfeb24ba53d
+type commit
+tag v5.4.1
+tagger Israel Barth Rubio <israel.barth@enterprisedb.com> 1688404341 -0300
+
+Release v5.4.1
+-----BEGIN PGP SIGNATURE-----
+
+iQIzBAABCAAdFiEEMSAcNZ+o8zJ9rHiXuGrp8/R8cakFAmSjAXUACgkQuGrp8/R8
+cal4KRAArtNSZap/KW/wK+HJtWNLfj+jhzJZuZaFvzX/wc0sHXjxQwTBg3/oOeAh
+bNV2T6QPDgu3YgkyCoUnytO0VC/gVXZKv5VV6zcze7pIe6RPeio1OuTuMFServo7
+NbIFaUT/7Kfnh30QZihSp3CGBnwJxHTAKNN6CUaisXE7QoIrOR+7/fN3LTgL5D1/
+eRAbCrqQMVBSU3CFv0Ci62eDJ/k4P3OfWFVo6eIcHW9/v96Qv10+Bi/V5TFuorI/
+VeQB0pT6bEOX3HGn2zGataQ2UdjCWj3aey8ZxXzYh+42jUJB+q71j1u5hCjcFaEv
+Yn5L/s+1K2hs6iHIPaunJ7BMtqcacmkEywwvGa/TDb5zR7Qr5JTjNPiSA8dBVLm3
+5GMWXKrxsGPbOpMZUXgA9VTWDMJ0CK3oXevfh8fZX5omNqRHP0xcCWIuemRGbKtW
+/9rqXvWhVzZZ/QjX8x4wosD6PtZ2jpFG/1HHtP0M6daHBXEPxT6P2/bNuCLvN8oz
+O6JC0if6gvy6lRK0MrjOPHeSwWBcf+e8Vl6lJlyrrJ6GL5eo01MCxrqAG+Bq7taT
+ESjlq7RERPleo2xbGQp98NHkuA/1r8Rv8zmGL30V+lGn2h3mT/YoWjrihLiozQIr
+eoo4qQDDctSiyOCN5ghVaUuoExqvLwl97ndYeE3ofvmDpToT4No=
+=Ruid
+-----END PGP SIGNATURE-----
diff --git a/.gear/tags/list b/.gear/tags/list
new file mode 100644
index 0000000..63a0eda
--- /dev/null
+++ b/.gear/tags/list
@@ -0,0 +1 @@
+d1d748166632ec24160fe038f7e6b476f6fac014 v5.4.1
diff --git a/.gear/upstream/remotes b/.gear/upstream/remotes
new file mode 100644
index 0000000..df71085
--- /dev/null
+++ b/.gear/upstream/remotes
@@ -0,0 +1,3 @@
+[remote "upstream"]
+	url = https://github.com/EnterpriseDB/repmgr.git
+	fetch = +refs/heads/*:refs/remotes/upstream/*
diff --git a/Makefile.in b/Makefile.in
index ef048f3..2459036 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -81,10 +81,10 @@ configfile-scan.c: configfile-scan.l
 $(REPMGR_CLIENT_OBJS): repmgr-client.h repmgr_version.h
 
 repmgr: $(REPMGR_CLIENT_OBJS)
-	$(CC) $(CFLAGS) $(REPMGR_CLIENT_OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
+	$(CC) $(CFLAGS) $(REPMGR_CLIENT_OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) -o $@$(X)
 
 repmgrd: $(REPMGRD_OBJS)
-	$(CC) $(CFLAGS) $(REPMGRD_OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
+	$(CC) $(CFLAGS) $(REPMGRD_OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) -o $@$(X)
 
 $(REPMGR_CLIENT_OBJS): $(HEADERS)
 $(REPMGRD_OBJS): $(HEADERS)
diff --git a/repmgr.spec b/repmgr.spec
new file mode 100644
index 0000000..c2b31f9
--- /dev/null
+++ b/repmgr.spec
@@ -0,0 +1,121 @@
+%define pg_ver @pgver@
+%define prog_name repmgr
+%def_with jit
+
+Name: postgresql%pg_ver-%prog_name
+Version: 5.4.1
+Release: alt1
+Summary: Replication Manager for PostgreSQL Clusters
+Group: Databases
+License: GPL-3.0
+Url: http://www.repmgr.org/
+Vcs: https://github.com/EnterpriseDB/repmgr.git
+Source0: %name-%version.tar
+Source1: repmgr.init
+Source2: repmgr.sudoers
+Source3: repmgr.service
+Source4: repmgr.tmpfiles
+Source5: repmgr.sysconfig
+
+Patch: %name-%version.patch
+
+Requires: postgresql-common
+Requires: postgresql%pg_ver-server
+
+Provides: %prog_name = %EVR
+Obsoletes: %prog_name < %EVR
+
+BuildRequires: flex
+BuildRequires: libssl-devel libselinux-devel liblz4-devel libxslt-devel libpam-devel
+BuildRequires: libkrb5-devel libcurl-devel libjson-c-devel
+BuildRequires: libecpg-devel-static libpq5-devel-static postgresql%pg_ver-server-devel
+# for build doc
+BuildRequires: docbook-dtds docbook-style-xsl
+BuildRequires: /usr/bin/xmllint /usr/bin/xsltproc
+
+%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.
+
+%package doc
+Summary:  Documentation for the Replication Manager for PostgreSQL Clusters
+Group: Documentation
+BuildArch: noarch
+
+%description doc
+The package contains documentation for the Replication Manager for PostgreSQL Clusters.
+
+%prep
+%setup
+%patch -p1
+
+%build
+%autoreconf
+%configure PG_CONFIG=%_bindir/pg_server_config
+USE_PGXS=1 %make_build
+%make doc
+%make doc-repmgr.html
+
+%install
+USE_PGXS=1 %makeinstall_std
+
+mkdir -p %buildroot/{%_initdir,%_unitdir,%_tmpfilesdir,%_sysconfdir/{sysconfig,sudoers.d,%prog_name},%_logdir/%prog_name}
+install -p -m755 %SOURCE1 %buildroot%_initdir/%prog_name
+install -p -m644 %SOURCE2 %buildroot%_sysconfdir/sudoers.d/%prog_name
+install -p -m644 %SOURCE3 %buildroot%_unitdir/%prog_name.service
+install -p -m644 %SOURCE4 %buildroot%_tmpfilesdir/%prog_name.conf
+install -p -m644 %SOURCE5 %buildroot%_sysconfdir/sysconfig/%prog_name
+install -p -m644 repmgr.conf.sample %buildroot%_sysconfdir/%prog_name/%prog_name.conf
+
+%post
+%post_service %name
+echo "Execute the following psql command inside any database that you want to update:"
+echo "ALTER EXTENSION repmgr UPDATE;                                                 "
+
+%preun
+%preun_service %name
+
+%files
+%doc README.md LICENSE
+%_bindir/repmgr
+%_bindir/repmgrd
+%config(noreplace) %_sysconfdir/sysconfig/%prog_name
+%config(noreplace) %_sysconfdir/sudoers.d/%prog_name
+%dir %attr(750,root,postgres) %_sysconfdir/%prog_name
+%config(noreplace) %attr(640,root,postgres) %_sysconfdir/%prog_name/%prog_name.conf
+%_initdir/%prog_name
+%_unitdir/%prog_name.service
+%_tmpfilesdir/%prog_name.conf
+%attr(1775,root,postgres) %dir %_logdir/%prog_name
+%_libdir/pgsql/*.so
+%if %pg_ver >= 11
+%if_with jit
+%_libdir/pgsql/bitcode/*
+%endif
+%endif
+%_datadir/pgsql/extension/*
+
+%files doc
+%doc doc/html
+
+%changelog
+* Tue Jul 04 2023 Alexei Takaseev <taf@altlinux.org> 5.4.1-alt1
+- 5.4.1
+
+* Tue Nov 22 2022 Alexei Takaseev <taf@altlinux.org> 5.3.3-alt2
+- Join repmgr and postgresqlXY-repmgr subpackages to one
+  postgresqlXY-repmgr
+
+* Sat Nov 12 2022 Alexey Shabalin <shaba@altlinux.org> 5.3.3-alt1
+- 5.3.3
+
+* Thu Feb 10 2022 Alexey Shabalin <shaba@altlinux.org> 5.3.0-alt1
+- 5.3.0
+
+* Wed Feb 24 2021 Alexey Shabalin <shaba@altlinux.org> 5.2.1-alt2
+- Execute service as postgres system user.
+
+* Wed Feb 10 2021 Alexey Shabalin <shaba@altlinux.org> 5.2.1-alt1
+- Initial build.
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin