aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/py-pdagent
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2017-09-14 17:37:53 +0000
committerMark Felder <feld@FreeBSD.org>2017-09-14 17:37:53 +0000
commit840db43d7136a05ccf87fb25d444f32afd4ec0b9 (patch)
treeccf044f2112af1bde09ec00a8c864db7da8f775e /net-mgmt/py-pdagent
parent165bdc6d54fbc09e22b06c1978241f4c95794c3d (diff)
downloadports-840db43d7136a05ccf87fb25d444f32afd4ec0b9.tar.gz
ports-840db43d7136a05ccf87fb25d444f32afd4ec0b9.zip
Notes
Diffstat (limited to 'net-mgmt/py-pdagent')
-rw-r--r--net-mgmt/py-pdagent/Makefile39
-rw-r--r--net-mgmt/py-pdagent/distinfo3
-rw-r--r--net-mgmt/py-pdagent/files/pdagentd.in49
-rw-r--r--net-mgmt/py-pdagent/pkg-descr4
-rw-r--r--net-mgmt/py-pdagent/pkg-plist21
5 files changed, 116 insertions, 0 deletions
diff --git a/net-mgmt/py-pdagent/Makefile b/net-mgmt/py-pdagent/Makefile
new file mode 100644
index 000000000000..51fde1b2342c
--- /dev/null
+++ b/net-mgmt/py-pdagent/Makefile
@@ -0,0 +1,39 @@
+# Created by: Mark Felder <feld@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= pdagent
+DISTVERSION= v1.4
+CATEGORIES= net-mgmt python
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= feld@FreeBSD.org
+COMMENT= PagerDuty Agent software
+
+LICENSE= BSD3CLAUSE
+
+USES= python:2.7 shebangfix
+SHEBANG_FILES= bin/*
+NO_ARCH= yes
+NO_BUILD= yes
+
+USE_RC_SUBR= pdagentd
+
+USE_GITHUB= YES
+GH_ACCOUNT= PagerDuty
+
+SUB_LIST+= PYTHON_CMD="${PYTHON_CMD}"
+
+BINFILES= pd-queue pd-send pdagentd.py
+
+do-patch:
+ ${REINPLACE_CMD} -e 's|/var/lib/pdagent|/var/db/pdagent|' -e 's|/etc|${ETCDIR}|' ${WRKSRC}/pdagent/confdirs.py
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} ${STAGEDIR}/${ETCDIR}
+ (cd ${WRKSRC} && ${COPYTREE_SHARE} pdagent ${STAGEDIR}${PYTHON_SITELIBDIR})
+.for i in ${BINFILES}
+ ${INSTALL_SCRIPT} ${WRKSRC}/bin/${i} ${STAGEDIR}/${PREFIX}/bin/${i}
+.endfor
+ ${INSTALL_DATA} ${WRKSRC}/conf/pdagent.conf ${STAGEDIR}/${ETCDIR}/pdagent.conf.sample
+
+.include <bsd.port.mk>
diff --git a/net-mgmt/py-pdagent/distinfo b/net-mgmt/py-pdagent/distinfo
new file mode 100644
index 000000000000..10e10fd825ef
--- /dev/null
+++ b/net-mgmt/py-pdagent/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1505398696
+SHA256 (PagerDuty-pdagent-v1.4_GH0.tar.gz) = 69f79d9c912db8e2fa9fed7c0f5f0113968739df316b6a79eec9ac94c368046f
+SIZE (PagerDuty-pdagent-v1.4_GH0.tar.gz) = 248170
diff --git a/net-mgmt/py-pdagent/files/pdagentd.in b/net-mgmt/py-pdagent/files/pdagentd.in
new file mode 100644
index 000000000000..e8736fa7c490
--- /dev/null
+++ b/net-mgmt/py-pdagent/files/pdagentd.in
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# Author: Mark Felder <feld@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+# PROVIDE: pdagentd
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable pdagentd:
+# pdagentd_enable="YES"
+
+. /etc/rc.subr
+
+name="pdagentd"
+rcvar=pdagentd_enable
+
+load_rc_config $name
+
+: ${pdagentd_enable="NO"}
+: ${pdagentd_user:="nobody"}
+: ${pdagentd_group:="nogroup"}
+
+pidfile="/var/run/pdagent/pdagentd.pid"
+command="%%PREFIX%%/bin/pdagentd.py"
+command_args="${rc_arg}"
+start_precmd=pdagentd_precmd
+procname=%%PYTHON_CMD%%
+
+pdagent_mkdirs="/var/db/pdagent /var/db/pdagent/outqueue /var/db/pdagent/db /var/db/pdagent/outqueue/pdq \
+ /var/db/pdagent/outqueue/tmp /var/db/pdagent/outqueue/suc /var/db/pdagent/outqueue/err"
+
+pdagentd_precmd()
+{
+ for i in ${pdagent_mkdirs}; do
+ install -d -o ${pdagentd_user} -g ${pdagentd_group} -m 775 ${i}
+ done
+
+ if [ ! -d /var/log/pdagent ]; then
+ install -d -o ${pdagentd_user} /var/log/pdagent
+ fi
+ if [ ! -d /var/run/pdagent ]; then
+ install -d -o ${pdagentd_user} /var/run/pdagent
+ fi
+}
+
+run_rc_command "$1"
diff --git a/net-mgmt/py-pdagent/pkg-descr b/net-mgmt/py-pdagent/pkg-descr
new file mode 100644
index 000000000000..b3fb8a966ae0
--- /dev/null
+++ b/net-mgmt/py-pdagent/pkg-descr
@@ -0,0 +1,4 @@
+The PagerDuty Agent is a program that lets you easily integrate your
+monitoring system with PagerDuty.
+
+WWW: https://github.com/PagerDuty/pdagent
diff --git a/net-mgmt/py-pdagent/pkg-plist b/net-mgmt/py-pdagent/pkg-plist
new file mode 100644
index 000000000000..ece07e69ba7f
--- /dev/null
+++ b/net-mgmt/py-pdagent/pkg-plist
@@ -0,0 +1,21 @@
+bin/pd-queue
+bin/pd-send
+bin/pdagentd.py
+@sample etc/pdagent/pdagent.conf.sample
+%%PYTHON_SITELIBDIR%%/pdagent/__init__.py
+%%PYTHON_SITELIBDIR%%/pdagent/confdirs.py
+%%PYTHON_SITELIBDIR%%/pdagent/config.py
+%%PYTHON_SITELIBDIR%%/pdagent/constants.py
+%%PYTHON_SITELIBDIR%%/pdagent/heartbeat.py
+%%PYTHON_SITELIBDIR%%/pdagent/jsonstore.py
+%%PYTHON_SITELIBDIR%%/pdagent/pdagentutil.py
+%%PYTHON_SITELIBDIR%%/pdagent/pdqueue.py
+%%PYTHON_SITELIBDIR%%/pdagent/pdthread.py
+%%PYTHON_SITELIBDIR%%/pdagent/root_certs/ca_certs.pem
+%%PYTHON_SITELIBDIR%%/pdagent/sendevent.py
+%%PYTHON_SITELIBDIR%%/pdagent/thirdparty/__init__.py
+%%PYTHON_SITELIBDIR%%/pdagent/thirdparty/argparse.py
+%%PYTHON_SITELIBDIR%%/pdagent/thirdparty/daemon.py
+%%PYTHON_SITELIBDIR%%/pdagent/thirdparty/filelock.py
+%%PYTHON_SITELIBDIR%%/pdagent/thirdparty/httpswithverify.py
+%%PYTHON_SITELIBDIR%%/pdagent/thirdparty/ssl_match_hostname.py