Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2018 16:54:47 +0000 (UTC)
From:      Steve Wills <swills@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r465385 - in head/sysutils: . consul-replicate consul-replicate/files
Message-ID:  <201803231654.w2NGsl8u014790@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: swills
Date: Fri Mar 23 16:54:47 2018
New Revision: 465385
URL: https://svnweb.freebsd.org/changeset/ports/465385

Log:
  sysutils/consul-replicate: create port
  
  The daemon consul-replicate integrates with Consul to perform
  cross-data-center K/V replication.
  
  WWW: https://github.com/hashicorp/consul-replicate
  
  PR:		223121
  Submitted by:	jhixson@gmail.com

Added:
  head/sysutils/consul-replicate/
  head/sysutils/consul-replicate/Makefile   (contents, props changed)
  head/sysutils/consul-replicate/distinfo   (contents, props changed)
  head/sysutils/consul-replicate/files/
  head/sysutils/consul-replicate/files/consul-replicate.in   (contents, props changed)
  head/sysutils/consul-replicate/pkg-descr   (contents, props changed)
Modified:
  head/sysutils/Makefile   (contents, props changed)

Modified: head/sysutils/Makefile
==============================================================================
--- head/sysutils/Makefile	Fri Mar 23 16:46:05 2018	(r465384)
+++ head/sysutils/Makefile	Fri Mar 23 16:54:47 2018	(r465385)
@@ -192,6 +192,7 @@
     SUBDIR += consolekit2
     SUBDIR += consul
     SUBDIR += consul-alerts
+    SUBDIR += consul-replicate
     SUBDIR += consul_exporter
     SUBDIR += container-diff
     SUBDIR += contractor

Added: head/sysutils/consul-replicate/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/consul-replicate/Makefile	Fri Mar 23 16:54:47 2018	(r465385)
@@ -0,0 +1,53 @@
+# $FreeBSD$
+
+PORTNAME=	consul-replicate
+PORTVERSION=	0.4.0
+DISTVERSIONPREFIX=	v
+CATEGORIES=	sysutils
+
+MAINTAINER=	jhixson@gmail.com
+COMMENT=	Consul cross-DC KV replication daemon
+
+LICENSE=	MPL
+
+BUILD_DEPENDS=	${LOCALBASE}/bin/go:lang/go
+
+USES=		compiler
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	hashicorp
+GH_SUBDIR=	src/github.com/${GH_ACCOUNT}/${PORTNAME}
+
+USE_RC_SUBR=	consul-replicate
+
+PLIST_FILES=	bin/${PORTNAME}
+
+USERS=		consul
+GROUPS=		consul
+
+post-extract:
+	@${MV} ${WRKSRC}/vendor/ ${WRKSRC}/src/
+
+do-build:
+	@cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${PORTNAME}; \
+		${SETENV} CGO_ENABLED=0 ${BUILD_ENV} GOCACHE=off GOPATH=${WRKSRC} \
+		go build -v -x -ldflags "\
+		-X github.com/${GH_ACCOUNT}/${PORTNAME}/version.Version=${PORTVERSION}  \
+		-X github.com/${GH_ACCOUNT}/${PORTNAME}/version.GitCommit=675a2c2  \
+		-X github.com/${GH_ACCOUNT}/${PORTNAME}/version.GitDescribe=v${PORTVERSION} \
+		" -o bin/${PORTNAME}
+
+do-install:
+	${INSTALL_PROGRAM} \
+		${WRKSRC}/src/github.com/${GH_ACCOUNT}/${PORTNAME}/bin/${PORTNAME} \
+		${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+
+.include <bsd.port.pre.mk>
+
+# golang assumes that if clang is in use, it is called "clang" and not "cc". If
+# it's called "cc", go fails.
+.if ${COMPILER_TYPE} == clang
+BUILD_ENV=	CC=clang
+.endif
+
+.include <bsd.port.post.mk>

Added: head/sysutils/consul-replicate/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/consul-replicate/distinfo	Fri Mar 23 16:54:47 2018	(r465385)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1508456952
+SHA256 (hashicorp-consul-replicate-v0.4.0_GH0.tar.gz) = cd2e0e8e9bcd80bd2b3063b2aac5169756aa48a0dc6c5736997fdf590894c49a
+SIZE (hashicorp-consul-replicate-v0.4.0_GH0.tar.gz) = 1155743

Added: head/sysutils/consul-replicate/files/consul-replicate.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/consul-replicate/files/consul-replicate.in	Fri Mar 23 16:54:47 2018	(r465385)
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: consul-replicate
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# consul_replicate_enable (bool):   Set to NO by default.
+#                                   Set it to YES to enable consul.
+# consul_replicate_user (user):     Set user to run consul.
+#                                   Default is "consul".
+# consul_replcate_group (group):    Set group to run consul.
+#                                   Default is "consul".
+
+. /etc/rc.subr
+
+name=consul_replicate
+rcvar=consul_replicate_enable
+
+load_rc_config $name
+
+: ${consul_replicate_enable:="NO"}
+: ${consul_replicate_user:="consul"}
+: ${consul_replicate_group:="consul"}
+
+pidfile=/var/run/consul-replicate.pid
+procname="%%PREFIX%%/bin/consul-replicate"
+command="/usr/sbin/daemon"
+command_args="-f -p ${pidfile} /usr/bin/env ${consul_replicate_env} ${procname} -config '%%PREFIX%%/etc/consul-replicate.d' ${consul_replicate_args}"
+
+start_precmd=consul_replicate_startprecmd
+
+consul_replicate_startprecmd()
+{
+        if [ ! -e ${pidfile} ]; then
+                install -o ${consul_replicate_user} -g ${consul_replicate_group} /dev/null ${pidfile};
+        fi
+}
+
+run_rc_command "$1"

Added: head/sysutils/consul-replicate/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/consul-replicate/pkg-descr	Fri Mar 23 16:54:47 2018	(r465385)
@@ -0,0 +1,4 @@
+The daemon consul-replicate integrates with Consul to perform
+cross-data-center K/V replication.
+
+WWW: https://github.com/hashicorp/consul-replicate



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803231654.w2NGsl8u014790>