aboutsummaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authormatthew <matthew@FreeBSD.org>2014-11-18 23:47:34 +0800
committermatthew <matthew@FreeBSD.org>2014-11-18 23:47:34 +0800
commit315739dab3a1a93a3eb33469343b9a4e57162bd9 (patch)
tree076c3ad7b1f4d210a3f13e3140552577bd255429 /databases
parentd13d48cfb838204a2d18002232d04c49e4f5670c (diff)
downloadfreebsd-ports-gnome-315739dab3a1a93a3eb33469343b9a4e57162bd9.tar.gz
freebsd-ports-gnome-315739dab3a1a93a3eb33469343b9a4e57162bd9.tar.zst
freebsd-ports-gnome-315739dab3a1a93a3eb33469343b9a4e57162bd9.zip
* Drop the patches replacing strnlen() -- this function is
available in libc for all currently supported versions of FreeBSD. * Install the default config file into ${PREFIX}/etc/repmgr.conf.sample and uses the standard @sample plist functionality. This is where hier(7) expects config files to be installed. * Add an rc.d script to start up repmgrd automatically on system boot, which relies on the config file being in ${PREFIX}/etc/. PR: 195106 Submitted by: matthew Approved by: 5u623l20@gmail.com (maintainer)
Diffstat (limited to 'databases')
-rw-r--r--databases/postgresql-repmgr/Makefile7
-rw-r--r--databases/postgresql-repmgr/files/patch-config.c11
-rw-r--r--databases/postgresql-repmgr/files/patch-repmgr.c11
-rw-r--r--databases/postgresql-repmgr/files/repmgrd.in33
-rw-r--r--databases/postgresql-repmgr/pkg-plist3
5 files changed, 38 insertions, 27 deletions
diff --git a/databases/postgresql-repmgr/Makefile b/databases/postgresql-repmgr/Makefile
index 69153fe1c17d..077efca7c502 100644
--- a/databases/postgresql-repmgr/Makefile
+++ b/databases/postgresql-repmgr/Makefile
@@ -3,7 +3,7 @@
PORTNAME= postgresql-repmgr
PORTVERSION= 2.0
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= databases
MASTER_SITES= http://www.repmgr.org/download/
DISTNAME= repmgr-${PORTVERSION}
@@ -16,20 +16,19 @@ LICENSE= GPLv3
RUN_DEPENDS= rsync:${PORTSDIR}/net/rsync
USES+= gmake pgsql:9.0+
+USE_RC_SUBR= repmgrd
WANT_PGSQL= server
MAKE_ENV= USE_PGXS=1
OPTIONS_DEFINE= DOCS
-PORTDOCS= README.*
-
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/repmgr ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/repmgrd ${STAGEDIR}${PREFIX}/sbin
+ ${INSTALL_DATA} ${WRKSRC}/repmgr.conf.sample ${STAGEDIR}${PREFIX}/etc
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.rst ${STAGEDIR}${DOCSDIR}
@${MKDIR} ${STAGEDIR}${DATADIR}
- ${INSTALL_DATA} ${WRKSRC}/repmgr.conf.sample ${STAGEDIR}${DATADIR}
${INSTALL_DATA} ${WRKSRC}/repmgr.sql ${STAGEDIR}${DATADIR}
.include <bsd.port.mk>
diff --git a/databases/postgresql-repmgr/files/patch-config.c b/databases/postgresql-repmgr/files/patch-config.c
deleted file mode 100644
index e13f48a80521..000000000000
--- a/databases/postgresql-repmgr/files/patch-config.c
+++ /dev/null
@@ -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");
diff --git a/databases/postgresql-repmgr/files/patch-repmgr.c b/databases/postgresql-repmgr/files/patch-repmgr.c
deleted file mode 100644
index 380d8fe43059..000000000000
--- a/databases/postgresql-repmgr/files/patch-repmgr.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- repmgr.c.orig 2014-03-17 21:27:40.000000000 +0800
-+++ repmgr.c 2014-05-24 17:55:10.996404127 +0800
-@@ -1871,7 +1871,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");
diff --git a/databases/postgresql-repmgr/files/repmgrd.in b/databases/postgresql-repmgr/files/repmgrd.in
new file mode 100644
index 000000000000..33f7b336890c
--- /dev/null
+++ b/databases/postgresql-repmgr/files/repmgrd.in
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: repmgrd
+# REQUIRE: postgresql
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf to enable this
+# service:
+#
+# repmgrd_enable (bool): Set to YES to enable repmgrd. Default: NO
+#
+# repmgrd_config (path): Default: %%PREFIX%%/etc/repmgr.conf
+#
+
+. /etc/rc.subr
+
+name=repmgrd
+rcvar=repmgrd_enable
+
+load_rc_config $name
+
+: ${repmgrd_enable:="NO"}
+: ${repmgrd_config="%%PREFIX%%/etc/repmgr.conf"}
+
+command=%%PREFIX%%/sbin/${name}
+pidfile=/var/run/${name}.pid
+
+command_args="-p $pidfile -f $repmgrd_config"
+
+run_rc_command "$1"
+
diff --git a/databases/postgresql-repmgr/pkg-plist b/databases/postgresql-repmgr/pkg-plist
index ef43cc791f6c..1bf90253934d 100644
--- a/databases/postgresql-repmgr/pkg-plist
+++ b/databases/postgresql-repmgr/pkg-plist
@@ -1,4 +1,5 @@
bin/repmgr
+@sample etc/repmgr.conf.sample
sbin/repmgrd
-%%DATADIR%%/repmgr.conf.sample
+%%PORTDOCS%%%%DOCSDIR%%/README.rst
%%DATADIR%%/repmgr.sql