aboutsummaryrefslogtreecommitdiff
path: root/sysutils/goss
diff options
context:
space:
mode:
authorSteve Wills <swills@FreeBSD.org>2017-08-17 14:35:52 +0000
committerSteve Wills <swills@FreeBSD.org>2017-08-17 14:35:52 +0000
commitbb37306ddc694645895f4b67b461e9cd4a630070 (patch)
tree126dca15b2910f51d5e15cf588f1f8264a9ba45d /sysutils/goss
parent6a6e2876a48c5bbdb2cabde788e9190881f5525e (diff)
downloadports-bb37306ddc694645895f4b67b461e9cd4a630070.tar.gz
ports-bb37306ddc694645895f4b67b461e9cd4a630070.zip
Notes
Diffstat (limited to 'sysutils/goss')
-rw-r--r--sysutils/goss/Makefile11
-rw-r--r--sysutils/goss/files/goss.in36
-rw-r--r--sysutils/goss/files/patch-extras_goss.yaml.sample6
-rw-r--r--sysutils/goss/files/patch-extras_process__goss.yaml.sample6
-rw-r--r--sysutils/goss/pkg-plist4
5 files changed, 62 insertions, 1 deletions
diff --git a/sysutils/goss/Makefile b/sysutils/goss/Makefile
index 6faa9a37b9b7..6424315b26c0 100644
--- a/sysutils/goss/Makefile
+++ b/sysutils/goss/Makefile
@@ -3,6 +3,7 @@
PORTNAME= goss
PORTVERSION= 0.3.4
DISTVERSIONPREFIX= v
+PORTREVISION= 1
CATEGORIES= sysutils
MAINTAINER= englishm@llnw.com
@@ -16,7 +17,7 @@ BUILD_DEPENDS= go:lang/go
ONLY_FOR_ARCHS= amd64
ONLY_FOR_ARCHS_REASON= go-ps only supports amd64
-PLIST_FILES= bin/goss
+USE_RC_SUBR= goss
USE_GITHUB= yes
GH_ACCOUNT= aelsabbahy
@@ -37,6 +38,10 @@ GH_TUPLE= achanda:go-sysctl:6be7678:achanda/src/github.com/achanda/go-sysctl \
opencontainers:runc:8779fa5:opencontainers/src/github.com/opencontainers/runc \
patrickmn:go-cache:1881a9b:patrickmn/src/github.com/patrickmn/go-cache \
urfave:cli:d86a009:urfave/src/github.com/urfave/cli
+
+post-patch:
+ ${REINPLACE_CMD} 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/extras/goss.yaml.sample
+
do-build:
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} CGO_ENABLED=0 GOPATH=${WRKSRC} \
go build -ldflags "-X main.version=${DISTVERSIONPREFIX}${PORTVERSION} -s -w" -o \
@@ -45,5 +50,9 @@ do-build:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${PORTNAME}/bin/${PORTNAME} \
${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+ ${INSTALL_DATA} ${WRKSRC}/extras/goss.yaml.sample ${STAGEDIR}${PREFIX}/etc/goss.yaml.sample
+ ${MKDIR} ${STAGEDIR}${PREFIX}/etc/goss.d
+ ${INSTALL_DATA} ${WRKSRC}/extras/process_goss.yaml.sample \
+ ${STAGEDIR}${PREFIX}/etc/goss.d/process_goss.yaml.sample
.include <bsd.port.mk>
diff --git a/sysutils/goss/files/goss.in b/sysutils/goss/files/goss.in
new file mode 100644
index 000000000000..65507578b064
--- /dev/null
+++ b/sysutils/goss/files/goss.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# Goss startup script
+#
+# PROVIDE: goss
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+# Add the following to /etc/rc.conf[.local] to enable this service
+#
+# goss_enable (bool): Set to NO by default.
+# Set it to YES to enable goss
+# goss_conf (string): Set to %%PREFIX%%/etc/goss.yaml by default
+# Set it to preferred config file
+# goss_listen (string): Set to ":12345" by default
+# Set it to preferred listen address
+#
+
+. /etc/rc.subr
+
+name=goss
+rcvar=goss_enable
+
+load_rc_config $name
+
+: ${goss_enable:="NO"}
+: ${goss_listen="127.0.0.1:12345"}
+: ${goss_conf="%%PREFIX%%/etc/goss.yaml"}
+
+required_files=${goss_conf}
+pidfile=/var/run/${name}.pid
+procname="%%PREFIX%%/bin/goss"
+command="/usr/sbin/daemon"
+command_args="-f -p ${pidfile} /usr/bin/env ${goss_env} ${procname} -g ${goss_conf} serve -l ${goss_listen}"
+
+run_rc_command "$1"
diff --git a/sysutils/goss/files/patch-extras_goss.yaml.sample b/sysutils/goss/files/patch-extras_goss.yaml.sample
new file mode 100644
index 000000000000..b6db2e3e2026
--- /dev/null
+++ b/sysutils/goss/files/patch-extras_goss.yaml.sample
@@ -0,0 +1,6 @@
+--- extras/goss.yaml.sample.orig 2017-08-14 20:07:43 UTC
++++ extras/goss.yaml.sample
+@@ -0,0 +1,3 @@
++gossfile:
++ %%PREFIX%%/etc/goss.d/*.yaml: {}
++
diff --git a/sysutils/goss/files/patch-extras_process__goss.yaml.sample b/sysutils/goss/files/patch-extras_process__goss.yaml.sample
new file mode 100644
index 000000000000..3daf98b53508
--- /dev/null
+++ b/sysutils/goss/files/patch-extras_process__goss.yaml.sample
@@ -0,0 +1,6 @@
+--- extras/process_goss.yaml.sample.orig 2017-08-15 06:16:52 UTC
++++ extras/process_goss.yaml.sample
+@@ -0,0 +1,3 @@
++process:
++ goss:
++ running: true
diff --git a/sysutils/goss/pkg-plist b/sysutils/goss/pkg-plist
new file mode 100644
index 000000000000..c9c018698202
--- /dev/null
+++ b/sysutils/goss/pkg-plist
@@ -0,0 +1,4 @@
+@dir etc/goss.d
+@sample etc/goss.d/process_goss.yaml.sample
+@sample etc/goss.yaml.sample
+bin/goss