diff --git a/www/py-gunicorn/Makefile b/www/py-gunicorn/Makefile index 3fe09753c57d..29a2828b1fe3 100644 --- a/www/py-gunicorn/Makefile +++ b/www/py-gunicorn/Makefile @@ -1,52 +1,52 @@ PORTNAME= gunicorn DISTVERSION= 23.0.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= bofh@FreeBSD.org COMMENT= WSGI HTTP Server for UNIX WWW= https://gunicorn.org/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= ${PY_SETUPTOOLS} \ ${PYTHON_PKGNAMEPREFIX}setuptools-scm>=6.4.0:devel/py-setuptools-scm@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}aiohttp>0:www/py-aiohttp@${PY_FLAVOR} USES= cpe python USE_PYTHON= autoplist concurrent pep517 pytest USE_RC_SUBR= gunicorn NO_ARCH= yes SUB_LIST= USERS="${USERS}" GROUPS="${GROUPS}" USERS= gunicorn GROUPS= gunicorn OPTIONS_DEFINE= PROCTITLE OPTIONS_DEFAULT= PROCTITLE OPTIONS_GROUP= WORKERS OPTIONS_GROUP_WORKERS= EVENTLET GEVENT TORNADO EVENTLET_DESC= Eventlet async worker GEVENT_DESC= Greenlet worker PROCTITLE_DESC= Custom process titles with setproctitle(3) TORNADO_DESC= Tornado async worker EVENTLET_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}eventlet>=0.24.1:net/py-eventlet@${PY_FLAVOR} GEVENT_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}gevent>=1.4.0:devel/py-gevent@${PY_FLAVOR} PROCTITLE_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setproctitle>0:devel/py-setproctitle@${PY_FLAVOR} TORNADO_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tornado>=0.2:www/py-tornado@${PY_FLAVOR} post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/etc/${PORTNAME} ${INSTALL_DATA} ${WRKSRC}/examples/example_config.py \ ${STAGEDIR}${PREFIX}/etc/${PORTNAME}/gunicorn.conf.py.sample @${ECHO} "@sample etc/gunicorn/gunicorn.conf.py.sample" >> ${TMPPLIST} .include diff --git a/www/py-gunicorn/files/gunicorn.in b/www/py-gunicorn/files/gunicorn.in index 62e1fb68f56d..cb2c8dabaa8e 100644 --- a/www/py-gunicorn/files/gunicorn.in +++ b/www/py-gunicorn/files/gunicorn.in @@ -1,40 +1,45 @@ #!/bin/sh # # PROVIDE: gunicorn # REQUIRE: DAEMON # BEFORE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable gunicorn: -# gunicorn_enable (bool): Set to "NO" by default. -# Set it to "YES" to enable gunicorn. +# gunicorn_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable gunicorn. # +# gunicorn_config (str): Path to gunicorn config file. +# +# gunicorn_user (str): User to run gunicorn as. +# +# gunicorn_group (str): Group to run gunicorn as. . /etc/rc.subr name=gunicorn rcvar=gunicorn_enable # set defaults load_rc_config $name : ${gunicorn_enable:=NO} -: ${gunicorn_config=%%PREFIX%%/etc/gunicorn/gunicorn.conf.py} -: ${gunicorn_user=%%USERS%%} -: ${gunicorn_group=%%GROUPS%%} +: ${gunicorn_config:=%%PREFIX%%/etc/gunicorn/gunicorn.conf.py} +: ${gunicorn_user:=%%USERS%%} +: ${gunicorn_group:=%%GROUPS%%} pidfile="/var/run/${name}.pid" cpidfile="/var/run/${name}-worker.pid" command=/usr/sbin/daemon command_args="-P ${pidfile} -p ${cpidfile} -f -ST ${name} %%PREFIX%%/bin/gunicorn -c ${gunicorn_config}" required_files="${gunicorn_config}" start_precmd="gunicorn_precmd" gunicorn_precmd() { install -o ${gunicorn_user} /dev/null ${pidfile} install -o ${gunicorn_user} /dev/null ${cpidfile} } run_rc_command "$1"