Fri Dec 8 15:27:46 2017 UTC ()
Import repmgr-4.0.1 as databases/repmgr

Based on package provided by Matthieu Guegan in joyent/pkgsrc#49

repmgr is a suite of open-source tools to manage replication and failover
within a cluster of PostgreSQL servers.  It enhances PostgreSQL's built-in
replication capabilities with utilities to set up standby servers, monitor
replication, and perform administrative tasks such as failover or
switchover operations.


(jperkin)
diff -r0 -r1.1 pkgsrc/databases/repmgr/DESCR
diff -r0 -r1.1 pkgsrc/databases/repmgr/Makefile
diff -r0 -r1.1 pkgsrc/databases/repmgr/PLIST
diff -r0 -r1.1 pkgsrc/databases/repmgr/distinfo
diff -r0 -r1.1 pkgsrc/databases/repmgr/files/smf/manifest.xml

File Added: pkgsrc/databases/repmgr/DESCR
repmgr is a suite of open-source tools to manage replication and failover
within a cluster of PostgreSQL servers.  It enhances PostgreSQL's built-in
replication capabilities with utilities to set up standby servers, monitor
replication, and perform administrative tasks such as failover or
switchover operations.

File Added: pkgsrc/databases/repmgr/Makefile
# $NetBSD: Makefile,v 1.1 2017/12/08 15:27:46 jperkin Exp $

DISTNAME=	repmgr-4.0.1
PKGNAME=	postgresql${PGSQL_VERSION}-${DISTNAME}
CATEGORIES=	databases
MASTER_SITES=	${MASTER_SITE_GITHUB:=2ndQuadrant/}
GITHUB_PROJECT=	repmgr
GITHUB_TAG=	v${PKGVERSION_NOREV}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://github.com/2ndQuadrant/repmgr/
COMMENT=	The Most Popular Replication Manager for PostgreSQL (Postgres)
LICENSE=	gnu-gpl-v3

DEPENDS+=	postgresql${PGSQL_VERSION}-server>=0:../../databases/postgresql${PGSQL_VERSION}-server

GNU_CONFIGURE=	yes
USE_TOOLS+=	gmake

SMF_NAME=	postgresql-repmgr

BUILD_DEFS+=	PGUSER PGGROUP PGHOME
FILES_SUBST+=	PGUSER=${PGUSER} PGGROUP=${PGGROUP} PGHOME=${PGHOME}

DOCDIR=		share/doc/repmgr
EGDIR=		share/examples/repmgr
PKG_SYSCONFSUBDIR=	postgresql

INSTALLATION_DIRS+=	${DOCDIR} ${EGDIR}

CONF_FILES_PERMS+=	${EGDIR}/repmgr.conf.sample \
			${PKG_SYSCONFDIR}/repmgr.conf \
			${REAL_ROOT_USER} ${PGGROUP} 0640

post-install:
	${INSTALL_DATA} ${WRKSRC}/README.md \
	    ${DESTDIR}${PREFIX}/${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/repmgr.conf.sample \
	    ${DESTDIR}${PREFIX}/${EGDIR}

.include "../../mk/pgsql.buildlink3.mk"
.include "../../mk/readline.buildlink3.mk"
.include "../../textproc/libxml2/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/databases/repmgr/PLIST
@comment $NetBSD: PLIST,v 1.1 2017/12/08 15:27:46 jperkin Exp $
bin/repmgr
bin/repmgrd
lib/postgresql/repmgr.so
share/doc/repmgr/README.md
share/examples/repmgr/repmgr.conf.sample
share/postgresql/extension/repmgr--4.0.sql
share/postgresql/extension/repmgr--unpackaged--4.0.sql
share/postgresql/extension/repmgr.control

File Added: pkgsrc/databases/repmgr/distinfo
$NetBSD: distinfo,v 1.1 2017/12/08 15:27:46 jperkin Exp $

SHA1 (repmgr-4.0.1.tar.gz) = dbf6e5b6985c931ef78455ea04c88deec02fd8bc
RMD160 (repmgr-4.0.1.tar.gz) = 473a68703ecea079a4a12bb8aeac63804aedcb07
SHA512 (repmgr-4.0.1.tar.gz) = 73c2af83b6b9cb7b4df1a05aa0211083b3ec6d71f7e2dd1c6cbbcde09bef7c5f5d794037b33ad7dba6ef34fe514f6915c9f38ccfea325aeea76c538b1b4809a9
Size (repmgr-4.0.1.tar.gz) = 275800 bytes

File Added: pkgsrc/databases/repmgr/files/smf/manifest.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="export">
  <service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1">
    <create_default_instance enabled="false" />
    <single_instance />
    <dependency name="network" grouping="require_all" restart_on="none" type="service">
      <service_fmri value="svc:/milestone/network:default" />
    </dependency>
    <dependency name="filesystem-local" grouping="require_all" restart_on="none" type="service">
      <service_fmri value="svc:/system/filesystem/local:default" />
    </dependency>
    <method_context>
      <method_credential user="@PGUSER@" group="@PGGROUP@" />
      <method_environment>
        <envvar name="PATH" value="@PREFIX@/bin:@PREFIX@/sbin:/usr/bin:/usr/sbin:/bin:/sbin"/>
      </method_environment>
    </method_context>
    <exec_method type="method" name="start" exec="@PREFIX@/bin/repmgrd -f %{config_file} -p %{data}/repmgrd.pid -d" timeout_seconds="300" />
    <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
    <exec_method type="method" name="refresh" exec=":kill -HUP" timeout_seconds="60"/>
    <property_group name="application" type="application">
      <propval name="data" type="astring" value="@PGHOME@/data" />
      <propval name="config_file" type="astring" value="@PKG_SYSCONFDIR@/repmgr.conf" />
    </property_group>
    <template>
      <common_name>
        <loctext xml:lang="C">Replication Manager for PostgreSQL clusters</loctext>
      </common_name>
      <documentation>
        <doc_link name="repmgr.org" uri="http://repmgr.org" />
      </documentation>
    </template>
  </service>
</service_bundle>