ports/188323: postgresql-repmgr (repmgr) update to 2.0
toddnni
toddnni at gmail.com
Sun Apr 6 18:30:02 UTC 2014
>Number: 188323
>Category: ports
>Synopsis: postgresql-repmgr (repmgr) update to 2.0
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Sun Apr 06 18:30:01 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator: toddnni
>Release: FreeBSD 9.2-RELEASE
>Organization:
>Environment:
>Description:
Hi,
I needed (*) repmgr v.2.0 and I updated the port in meantime. I believe that the newer version should work with postgresql-9.3 also. However I tested the port only with postgresql-9.2
The changes I made:
- the patch files were removed. They were no longer necessary, the upstream code was fixed
- the newer version contains repmgr_funcs postgresql library
- repmgr.conf was renamed to repmgr.conf.sample
(*) Now 'repmgr standby follow' works correctly in my 3 node cluster
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
Index: Makefile
===================================================================
--- Makefile (revision 350397)
+++ Makefile (working copy)
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= postgresql-repmgr
-PORTVERSION= 1.2.0
+PORTVERSION= 2.0
CATEGORIES= databases
MASTER_SITES= http://www.repmgr.org/download/
DISTNAME= repmgr-${PORTVERSION}
@@ -26,10 +26,14 @@
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/repmgr ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/repmgrd ${STAGEDIR}${PREFIX}/sbin
+ @${MKDIR} ${STAGEDIR}${PREFIX}/lib/postgresql
+ ${INSTALL_PROGRAM} ${WRKSRC}/sql/repmgr_funcs.so ${STAGEDIR}${PREFIX}/lib/postgresql
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.rst ${STAGEDIR}${DOCSDIR}
@${MKDIR} ${STAGEDIR}${DATADIR}
- ${INSTALL_DATA} ${WRKSRC}/repmgr.conf ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${WRKSRC}/sql/repmgr_funcs.sql ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${WRKSRC}/sql/uninstall_repmgr_funcs.sql ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${WRKSRC}/repmgr.conf.sample ${STAGEDIR}${DATADIR}
${INSTALL_DATA} ${WRKSRC}/repmgr.sql ${STAGEDIR}${DATADIR}
.include <bsd.port.mk>
Index: distinfo
===================================================================
--- distinfo (revision 350397)
+++ distinfo (working copy)
@@ -1,2 +1,2 @@
-SHA256 (repmgr-1.2.0.tar.gz) = 191c077a15b9f7fa729b8f1c4e5ace8b340fda6285c7b552545f94ca4490ec5b
-SIZE (repmgr-1.2.0.tar.gz) = 51608
+SHA256 (repmgr-2.0.tar.gz) = b891d8a98700f73a58ce9580377978a1e43834f3bdcf6992e565b4aacddee887
+SIZE (repmgr-2.0.tar.gz) = 72227
Index: files/patch-config.c
===================================================================
--- files/patch-config.c (revision 350397)
+++ files/patch-config.c (working copy)
@@ -1,11 +0,0 @@
---- ./config.c.orig 2012-12-04 19:40:15.395225527 +1100
-+++ ./config.c 2012-12-04 19:40:38.975104852 +1100
-@@ -77,7 +77,7 @@
- fclose (fp);
-
- /* Check config settings */
-- if (strnlen(options->cluster_name, MAXLEN)==0)
-+ if (strlen(options->cluster_name)==0)
- {
- fprintf(stderr, "Cluster name is missing. "
- "Check the configuration file.\n");
Index: files/patch-repmgr.c
===================================================================
--- files/patch-repmgr.c (revision 350397)
+++ files/patch-repmgr.c (working copy)
@@ -1,40 +0,0 @@
---- ./repmgr.c.orig 2012-07-28 02:30:35.000000000 +1000
-+++ ./repmgr.c 2012-12-04 19:41:06.157429458 +1100
-@@ -28,6 +28,7 @@
-
- #include <stdio.h>
- #include <stdlib.h>
-+#include <sys/wait.h>
- #include <time.h>
- #include <unistd.h>
-
-@@ -1603,11 +1604,18 @@
- char script[MAXLEN];
- int r;
-
-+/* On some OS, true is located in a different place than in Linux */
-+#ifdef __FreeBSD__
-+#define TRUEBIN_PATH "/usr/bin/true"
-+#else
-+#define TRUEBIN_PATH "/bin/true"
-+#endif
-+
- /* Check if we have ssh connectivity to host before trying to rsync */
- if (!remote_user[0])
-- maxlen_snprintf(script, "ssh -o Batchmode=yes %s /bin/true", host);
-+ maxlen_snprintf(script, "ssh -o Batchmode=yes %s %s", host, TRUEBIN_PATH);
- else
-- maxlen_snprintf(script, "ssh -o Batchmode=yes %s -l %s /bin/true", host, remote_user);
-+ maxlen_snprintf(script, "ssh -o Batchmode=yes %s -l %s %s", host, remote_user, TRUEBIN_PATH);
-
- log_debug(_("command is: %s"), script);
- r = system(script);
-@@ -1625,7 +1633,7 @@
- char host_string[MAXLEN];
- int r;
-
-- if (strnlen(options.rsync_options, MAXLEN) == 0)
-+ if (strlen(options.rsync_options) == 0)
- maxlen_snprintf(
- rsync_flags, "%s",
- "--archive --checksum --compress --progress --rsh=ssh");
Index: pkg-plist
===================================================================
--- pkg-plist (revision 350397)
+++ pkg-plist (working copy)
@@ -1,5 +1,8 @@
bin/repmgr
sbin/repmgrd
-%%PORTDATA%%%%DATADIR%%/repmgr.conf
+lib/postgresql/repmgr_funcs.so
+%%PORTDATA%%%%DATADIR%%/repmgr_funcs.sql
+%%PORTDATA%%%%DATADIR%%/uninstall_repmgr_funcs.sql
+%%PORTDATA%%%%DATADIR%%/repmgr.conf.sample
%%PORTDATA%%%%DATADIR%%/repmgr.sql
%%PORTDATA%%@dirrm %%DATADIR%%
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list