* 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)
This commit is contained in:
Matthew Seaman 2014-11-18 15:47:34 +00:00
parent 25b8b1485f
commit c74922e73f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=372725
5 changed files with 38 additions and 27 deletions

View file

@ -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>

View file

@ -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");

View file

@ -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");

View file

@ -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"

View file

@ -1,4 +1,5 @@
bin/repmgr
@sample etc/repmgr.conf.sample
sbin/repmgrd
%%DATADIR%%/repmgr.conf.sample
%%PORTDOCS%%%%DOCSDIR%%/README.rst
%%DATADIR%%/repmgr.sql