aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/py-pdagent
diff options
context:
space:
mode:
authorDan Langille <dvl@FreeBSD.org>2021-04-15 13:00:46 +0000
committerDan Langille <dvl@FreeBSD.org>2021-04-15 13:06:42 +0000
commitdd4201c282f9e65fd9fbaf28eda305a67fa12e9c (patch)
tree89539a9034073d6ddeb913f4958e580c9e000fea /net-mgmt/py-pdagent
parent60d035e91a9c3c4fd61005c7034f35326d18d92a (diff)
downloadports-dd4201c282f9e65fd9fbaf28eda305a67fa12e9c.tar.gz
ports-dd4201c282f9e65fd9fbaf28eda305a67fa12e9c.zip
Bring back net-mgmt/py-pdagent-integrations & net-mgmt/py-pdagent
NOTE: net-mgmt/py-pdagent-integrations was previously net-mgmt/pdagent-integrations The PagerDuty Agent is a program that lets you easily integrate your monitoring system with PagerDuty. WWW: https://github.com/PagerDuty/pdagent
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.in46
-rw-r--r--net-mgmt/py-pdagent/pkg-descr4
-rw-r--r--net-mgmt/py-pdagent/pkg-message8
-rw-r--r--net-mgmt/py-pdagent/pkg-plist21
6 files changed, 121 insertions, 0 deletions
diff --git a/net-mgmt/py-pdagent/Makefile b/net-mgmt/py-pdagent/Makefile
new file mode 100644
index 000000000000..1a41c873d4a1
--- /dev/null
+++ b/net-mgmt/py-pdagent/Makefile
@@ -0,0 +1,39 @@
+PORTNAME= pdagent
+PORTVERSION= 1.7.2
+DISTVERSIONPREFIX=v
+CATEGORIES= net-mgmt python
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= ports@FreeBSD.org
+COMMENT= PagerDuty Agent software
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE.TXT
+
+USES= python:3.7+ shebangfix
+USE_PYTHON= flavors
+USE_RC_SUBR= pdagentd
+USE_GITHUB= yes
+
+GH_ACCOUNT= PagerDuty
+SHEBANG_FILES= bin/*
+NO_ARCH= yes
+NO_BUILD= yes
+
+SUB_LIST+= PYTHON_CMD="${PYTHON_CMD}"
+BINFILES= pd-queue pd-send pdagentd.py
+
+USERS= pdagent
+GROUPS= pdagent
+
+post-patch:
+ ${REINPLACE_CMD} -e 's|/var/lib/pdagent|/var/db/pdagent| ; s|/etc|${ETCDIR}|' \
+ ${WRKSRC}/pdagent/confdirs.py
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} ${STAGEDIR}/${ETCDIR}
+ (cd ${WRKSRC} && ${COPYTREE_SHARE} pdagent ${STAGEDIR}${PYTHON_SITELIBDIR})
+ (cd ${WRKSRC}/bin ; ${INSTALL_SCRIPT} ${BINFILES} ${STAGEDIR}/${PREFIX}/bin)
+ ${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..92f14148de30
--- /dev/null
+++ b/net-mgmt/py-pdagent/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1617288043
+SHA256 (PagerDuty-pdagent-v1.7.2_GH0.tar.gz) = 17b126e662a39540a053e22743b717bfe86e2221587536c20ca67f60365ff63a
+SIZE (PagerDuty-pdagent-v1.7.2_GH0.tar.gz) = 247883
diff --git a/net-mgmt/py-pdagent/files/pdagentd.in b/net-mgmt/py-pdagent/files/pdagentd.in
new file mode 100644
index 000000000000..3705fbfd6275
--- /dev/null
+++ b/net-mgmt/py-pdagent/files/pdagentd.in
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# Author: Mark Felder <feld@FreeBSD.org>
+#
+# $FreeBSD: head/net-mgmt/py-pdagent/files/pdagentd.in 466572 2018-04-05 17:11:39Z feld $
+#
+
+# 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:="pdagent"}
+: ${pdagentd_group:="pdagent"}
+
+pidfile="/var/run/pdagent/pdagentd.pid"
+command="%%PREFIX%%/bin/pdagentd.py"
+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 770 ${i}
+ done
+
+ chown -R ${pdagentd_user}:${pdagentd_group} /var/db/pdagent
+
+ install -d -o ${pdagentd_user} /var/log/pdagent
+ install -d -o ${pdagentd_user} /var/run/pdagent
+}
+
+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-message b/net-mgmt/py-pdagent/pkg-message
new file mode 100644
index 000000000000..5cc0bf90e47a
--- /dev/null
+++ b/net-mgmt/py-pdagent/pkg-message
@@ -0,0 +1,8 @@
+[
+{ type: install
+ message: <<EOM
+You must add the required users and service accounts to the pdagent
+group to permit write access to /var/db/pdagent.
+EOM
+}
+]
diff --git a/net-mgmt/py-pdagent/pkg-plist b/net-mgmt/py-pdagent/pkg-plist
new file mode 100644
index 000000000000..02c3968d110a
--- /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/http.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/six.py