aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/py-gstat_exporter
diff options
context:
space:
mode:
authorGuido Falsi <madpilot@FreeBSD.org>2021-02-28 19:09:18 +0000
committerGuido Falsi <madpilot@FreeBSD.org>2021-02-28 19:09:18 +0000
commitf11aaa7f5c24843db150e187781017dd51f6d9e1 (patch)
tree3d68e3f268f7343c3a2ab0ab9233d675b4933845 /net-mgmt/py-gstat_exporter
parentc0b12e89685e7284387ae65e2eb0a4177640c692 (diff)
downloadports-f11aaa7f5c24843db150e187781017dd51f6d9e1.tar.gz
ports-f11aaa7f5c24843db150e187781017dd51f6d9e1.zip
Notes
Diffstat (limited to 'net-mgmt/py-gstat_exporter')
-rw-r--r--net-mgmt/py-gstat_exporter/Makefile37
-rw-r--r--net-mgmt/py-gstat_exporter/distinfo3
-rw-r--r--net-mgmt/py-gstat_exporter/files/gstat_exporter.in28
-rw-r--r--net-mgmt/py-gstat_exporter/pkg-descr3
4 files changed, 71 insertions, 0 deletions
diff --git a/net-mgmt/py-gstat_exporter/Makefile b/net-mgmt/py-gstat_exporter/Makefile
new file mode 100644
index 000000000000..ba03a6deaaf0
--- /dev/null
+++ b/net-mgmt/py-gstat_exporter/Makefile
@@ -0,0 +1,37 @@
+# $FreeBSD$
+
+PORTNAME= gstat_exporter
+PORTVERSION= 20191119
+CATEGORIES= net-mgmt python
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= lapo@lapo.it
+COMMENT= Prometheus exporter for gstat data
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+IGNORE_FreeBSD_11= needs "gstat -C", available since FreeBSD 12.0
+
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}prometheus-client>=0.7.1:net-mgmt/py-prometheus-client@${PY_FLAVOR}
+
+USES= python:3.6+
+
+USE_GITHUB= yes
+GH_ACCOUNT= tykling
+GH_PROJECT= gstat_exporter
+GH_TAGNAME= 3c1858a52544b2eec56f5470e4042a7171e5448a
+
+NO_BUILD= yes
+NO_ARCH= yes
+
+USE_RC_SUBR= gstat_exporter
+SUB_LIST= PYTHON_CMD=${PYTHON_CMD}
+
+PLIST_FILES= bin/${PORTNAME}.py
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME}.py ${STAGEDIR}${PREFIX}/bin
+ ${REINPLACE_CMD} -i '' -e "1i\\${.newline}#!${PYTHON_CMD}" ${STAGEDIR}${PREFIX}/bin/${PORTNAME}.py
+
+.include <bsd.port.mk>
diff --git a/net-mgmt/py-gstat_exporter/distinfo b/net-mgmt/py-gstat_exporter/distinfo
new file mode 100644
index 000000000000..8034bbf09829
--- /dev/null
+++ b/net-mgmt/py-gstat_exporter/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1613729051
+SHA256 (tykling-gstat_exporter-20191119-3c1858a52544b2eec56f5470e4042a7171e5448a_GH0.tar.gz) = 385dc23fb7ef95626c03d8a4b454f00ffa015424b2ec9bf94b656aa4c662153f
+SIZE (tykling-gstat_exporter-20191119-3c1858a52544b2eec56f5470e4042a7171e5448a_GH0.tar.gz) = 4141
diff --git a/net-mgmt/py-gstat_exporter/files/gstat_exporter.in b/net-mgmt/py-gstat_exporter/files/gstat_exporter.in
new file mode 100644
index 000000000000..a5a2757684ad
--- /dev/null
+++ b/net-mgmt/py-gstat_exporter/files/gstat_exporter.in
@@ -0,0 +1,28 @@
+#!/bin/sh
+# $FreeBSD$
+#
+# PROVIDE: gstat_exporter
+# REQUIRE: LOGIN NETWORKING
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable gstat_exporter:
+#
+# gstat_exporter_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable gstat_exporter_enable.
+
+. /etc/rc.subr
+
+name=gstat_exporter
+rcvar=gstat_exporter_enable
+desc="gstat_exporter daemon"
+
+load_rc_config ${name}
+
+: ${gstat_exporter_enable:=NO}
+
+pidfile="/var/run/${name}.pid"
+command_interpreter=%%PYTHON_CMD%%
+command=%%PREFIX%%/bin/${name}.py
+start_cmd="/usr/sbin/daemon -f -p ${pidfile} $command_interpreter $command"
+
+run_rc_command "$1"
diff --git a/net-mgmt/py-gstat_exporter/pkg-descr b/net-mgmt/py-gstat_exporter/pkg-descr
new file mode 100644
index 000000000000..0cd8653d8dd9
--- /dev/null
+++ b/net-mgmt/py-gstat_exporter/pkg-descr
@@ -0,0 +1,3 @@
+Prometheus exporter for FreeBSD gstat data
+
+WWW: https://github.com/tykling/gstat_exporter