aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorDave Cottlehuber <dch@FreeBSD.org>2018-07-05 18:23:22 +0000
committerDave Cottlehuber <dch@FreeBSD.org>2018-07-05 18:23:22 +0000
commit6a06e692f966a4fd8c1896055ff23411475524e7 (patch)
tree9e443f98b523ecd9bbc02d12ab625ae7eb9b2a34 /www
parent897755d7dcf1702a2c9aec4caeed489412ec5dfc (diff)
downloadports-6a06e692f966a4fd8c1896055ff23411475524e7.tar.gz
ports-6a06e692f966a4fd8c1896055ff23411475524e7.zip
Notes
Diffstat (limited to 'www')
-rw-r--r--www/py-graphite-api/Makefile15
-rw-r--r--www/py-graphite-api/files/graphiteapi.in27
2 files changed, 27 insertions, 15 deletions
diff --git a/www/py-graphite-api/Makefile b/www/py-graphite-api/Makefile
index 040d0dcbf85d..afbe86a642e4 100644
--- a/www/py-graphite-api/Makefile
+++ b/www/py-graphite-api/Makefile
@@ -3,11 +3,12 @@
PORTNAME= graphite-api
PORTVERSION= 1.1.3
+PORTREVISION= 1
CATEGORIES= www python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
-MAINTAINER= dch@skunkwerks.at
+MAINTAINER= dch@FreeBSD.org
COMMENT= Graphite-web, without the interface - just the rendering HTTP API
LICENSE= APACHE20
@@ -24,15 +25,16 @@ RUN_DEPENDS= \
${PYTHON_PKGNAMEPREFIX}gunicorn>=19.4.1:www/py-gunicorn@${PY_FLAVOR} \
xorg-fonts-truetype>=0:x11-fonts/xorg-fonts-truetype
-NO_ARCH= yes
USES= python
USE_PYTHON= distutils py3kplist
+NO_ARCH= yes
+
GRAPHITEAPI_APP= graphiteapi
SUB_FILES= pkg-message
-SUB_LIST= PORTNAME=${PORTNAME} \
- PREFIX=${PREFIX} \
+SUB_LIST= PYTHON_VER=${PYTHON_VER} \
+ PYTHON_VERSION=${PYTHON_VERSION} \
GRAPHITEAPI_APP=${GRAPHITEAPI_APP} \
GRAPHITEAPI_USER=${GRAPHITEAPI_USER} \
GRAPHITEAPI_GROUP=${GRAPHITEAPI_GROUP} \
@@ -40,10 +42,7 @@ SUB_LIST= PORTNAME=${PORTNAME} \
GRAPHITEAPI_TMPDIR=${GRAPHITEAPI_TMPDIR} \
GRAPHITEAPI_PIDFILE=${GRAPHITEAPI_PIDFILE}
-PLIST_SUB= PORTNAME=${PORTNAME} \
- PORTVERSION=${PORTVERSION} \
- PREFIX=${PREFIX} \
- GRAPHITEAPI_APP=${GRAPHITEAPI_APP} \
+PLIST_SUB= GRAPHITEAPI_APP=${GRAPHITEAPI_APP} \
GRAPHITEAPI_USER=${GRAPHITEAPI_USER} \
GRAPHITEAPI_GROUP=${GRAPHITEAPI_GROUP} \
GRAPHITEAPI_LOGDIR=${GRAPHITEAPI_LOGDIR} \
diff --git a/www/py-graphite-api/files/graphiteapi.in b/www/py-graphite-api/files/graphiteapi.in
index 0b502c8327d2..490000872443 100644
--- a/www/py-graphite-api/files/graphiteapi.in
+++ b/www/py-graphite-api/files/graphiteapi.in
@@ -23,8 +23,10 @@
name="%%GRAPHITEAPI_APP%%"
rcvar="%%GRAPHITEAPI_APP%%_enable"
+desc="graphite-web rendering API"
+
+load_rc_config ${name}
-# defaults
: ${graphiteapi_enable:="NO"}
: ${graphiteapi_user="%%GRAPHITEAPI_USER%%"}
: ${graphiteapi_group="%%GRAPHITEAPI_GROUP%%"}
@@ -32,21 +34,32 @@ rcvar="%%GRAPHITEAPI_APP%%_enable"
: ${graphiteapi_config="%%ETCDIR%%/%%GRAPHITEAPI_APP%%.yaml"}
: ${graphiteapi_flags="--workers 4"}
-# daemon
-command="%%PREFIX%%/bin/gunicorn"
required_files="${graphiteapi_config}"
-command_args="graphite_api.app:app"
+
+command="%%PREFIX%%/bin/gunicorn-%%PYTHON_VER%%"
+procname="%%PYTHON_VERSION%%"
+
+pidfile="%%GRAPHITEAPI_PIDFILE%%"
+
+command_args="--daemon graphite_api.app:app"
command_args="${command_args} --user ${graphiteapi_user} --group ${graphiteapi_group}"
command_args="${command_args} --bind ${graphiteapi_address}"
-command_args="${command_args} --env TZ=UTC"
command_args="${command_args} --env GRAPHITE_API_CONFIG=${graphiteapi_config}"
command_args="${command_args} --pid %%GRAPHITEAPI_PIDFILE%%"
command_args="${command_args} --worker-tmp-dir %%GRAPHITEAPI_TMPDIR%%"
command_args="${command_args} --error-logfile %%GRAPHITEAPI_LOGDIR%%/error.log"
command_args="${command_args} --access-logfile %%GRAPHITEAPI_LOGDIR%%/access.log"
-# support SIGHUP to reload configuration file
extra_commands="reload"
+start_precmd="start_precmd"
+
+start_precmd()
+{
+ test -d "%%GRAPHITEAPI_LOGDIR%%" || install -d -o
+ ${graphiteapi_user} \
+ -g ${graphiteapi_group} -m 0750 "%%GRAPHITEAPI_LOGDIR%%"
+ test -d "%%GRAPHITEAPI_TMPDIR%%" || install -d -o ${graphiteapi_user} \
+ -g ${graphiteapi_group} -m 0750 "%%GRAPHITEAPI_TMPDIR%%"
+}
-load_rc_config $name
run_rc_command "$1"