svn commit: r449650 - in head/sysutils/consul_exporter: . files
Steve Wills
swills at FreeBSD.org
Mon Sep 11 14:40:14 UTC 2017
Author: swills
Date: Mon Sep 11 14:40:12 2017
New Revision: 449650
URL: https://svnweb.freebsd.org/changeset/ports/449650
Log:
sysutils/consul_exporter: create port
Export Consul service health to Prometheus.
WWW: https://github.com/prometheus/consul_exporter
PR: 222226
Submitted by: Tobias <t.tom at succont.de>
Added:
head/sysutils/consul_exporter/
head/sysutils/consul_exporter/Makefile (contents, props changed)
head/sysutils/consul_exporter/distinfo (contents, props changed)
head/sysutils/consul_exporter/files/
head/sysutils/consul_exporter/files/consul_exporter.in (contents, props changed)
head/sysutils/consul_exporter/pkg-descr (contents, props changed)
Added: head/sysutils/consul_exporter/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/consul_exporter/Makefile Mon Sep 11 14:40:12 2017 (r449650)
@@ -0,0 +1,48 @@
+# $FreeBSD$
+
+PORTNAME= consul_exporter
+PORTVERSION= 0.3.0
+DISTVERSIONPREFIX= v
+CATEGORIES= sysutils
+
+MAINTAINER= t.tom at succont.de
+COMMENT= Exporter for Consul metrics
+
+LICENSE= APACHE20
+
+BUILD_DEPENDS= ${LOCALBASE}/bin/go:lang/go
+
+USES= compiler
+
+USE_GITHUB= yes
+GH_ACCOUNT= prometheus
+GH_SUBDIR= src/github.com/${GH_ACCOUNT}/consul_exporter
+
+USE_RC_SUBR= consul_exporter
+
+PLIST_FILES= bin/consul_exporter
+
+post-extract:
+ @${MV} ${WRKSRC}/vendor/ ${WRKSRC}/src/
+
+do-build:
+ @cd ${WRKSRC}/src/github.com/prometheus/consul_exporter; ${SETENV} CGO_ENABLED=0 ${BUILD_ENV} GOPATH=${WRKSRC} go build \
+ -ldflags "\
+ -X github.com/prometheus/consul_exporter/version.Version=${PORTVERSION} \
+ -X github.com/prometheus/consul_exporter/version.VersionPrerelease= \
+ -X github.com/prometheus/consul_exporter/version.GitDescribe=v${PORTVERSION} \
+ " \
+ -o bin/consul_exporter
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/prometheus/consul_exporter/bin/consul_exporter ${STAGEDIR}${PREFIX}/bin/consul_exporter
+
+.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_exporter/distinfo
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/consul_exporter/distinfo Mon Sep 11 14:40:12 2017 (r449650)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1504964932
+SHA256 (prometheus-consul_exporter-v0.3.0_GH0.tar.gz) = 621a7fd6f50b59d6c10f2325dafcffa95ab7b1491514c1f801485b4b037e9428
+SIZE (prometheus-consul_exporter-v0.3.0_GH0.tar.gz) = 1031879
Added: head/sysutils/consul_exporter/files/consul_exporter.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/consul_exporter/files/consul_exporter.in Mon Sep 11 14:40:12 2017 (r449650)
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: consul_exporter
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# consul_exporter_enable (bool): Set to NO by default.
+# Set it to YES to enable consul exporter.
+# consul_exporter_env (string): Set environment variables used with consul exporter.
+# Default is "".
+# consul_exporter_args (string): Set flags used with consul-exporter.
+# Default is "".
+
+. /etc/rc.subr
+
+name=consul_exporter
+rcvar=consul_exporter_enable
+extra_commands="reload"
+
+load_rc_config $name
+
+: ${consul_exporter_enable:="NO"}
+: ${consul_exporter_env:=""}
+: ${consul_exporter_args:=""}
+
+pidfile=/var/run/consul_exporter.pid
+procname="%%PREFIX%%/bin/consul_exporter"
+command="/usr/sbin/daemon"
+command_args="-f -p ${pidfile} /usr/bin/env ${consul_env} ${procname} ${consul_exporter_args}"
+
+run_rc_command "$1"
Added: head/sysutils/consul_exporter/pkg-descr
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/consul_exporter/pkg-descr Mon Sep 11 14:40:12 2017 (r449650)
@@ -0,0 +1,3 @@
+Export Consul service health to Prometheus.
+
+WWW: https://github.com/prometheus/consul_exporter
More information about the svn-ports-all
mailing list