diff options
author | Bernhard Froehlich <decke@FreeBSD.org> | 2014-03-10 09:20:06 +0000 |
---|---|---|
committer | Bernhard Froehlich <decke@FreeBSD.org> | 2014-03-10 09:20:06 +0000 |
commit | 39e7a0df18831961d6560d0e52559eaf9de0ba58 (patch) | |
tree | 98e03991d81b6da7719aaaf4e4dc92541a634d57 /print | |
parent | 0e939a01b35ef9f978bac907a4dc0f5fd38f3a8f (diff) |
Notes
Diffstat (limited to 'print')
-rw-r--r-- | print/cloudprint/Makefile | 12 | ||||
-rw-r--r-- | print/cloudprint/files/cloudprint.in | 46 |
2 files changed, 57 insertions, 1 deletions
diff --git a/print/cloudprint/Makefile b/print/cloudprint/Makefile index 09100156eaa4..84cdb5ae844a 100644 --- a/print/cloudprint/Makefile +++ b/print/cloudprint/Makefile @@ -3,6 +3,7 @@ PORTNAME= cloudprint PORTVERSION= 0.11.20140215 +PORTREVISION= 1 CATEGORIES= print MAINTAINER= decke@FreeBSD.org @@ -10,7 +11,8 @@ COMMENT= Google Cloud Print proxy for local CUPS printers LICENSE= GPLv3 -RUN_DEPENDS= ${PYTHON_SITELIBDIR}/cups.so:${PORTSDIR}/print/py-cups +RUN_DEPENDS= ${PYTHON_SITELIBDIR}/cups.so:${PORTSDIR}/print/py-cups \ + ${PYTHON_PKGNAMEPREFIX}daemon>0:${PORTSDIR}/devel/py-daemon USE_GITHUB= yes GH_ACCOUNT= armooo @@ -19,5 +21,13 @@ GH_COMMIT= 07e4711 USE_PYTHON= 2 USE_PYDISTUTILS= yes +USE_RC_SUBR= ${PORTNAME} + +USERS= cups +GROUPS= cups + +SUB_LIST+= PYTHON_CMD="${PYTHON_CMD}" \ + CPUSER="${USERS}" \ + CPGROUP="${GROUPS}" .include <bsd.port.mk> diff --git a/print/cloudprint/files/cloudprint.in b/print/cloudprint/files/cloudprint.in new file mode 100644 index 000000000000..0caa7193cef2 --- /dev/null +++ b/print/cloudprint/files/cloudprint.in @@ -0,0 +1,46 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: cloudprint +# REQUIRE: LOGIN cupsd +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf[.local] to enable cloudprint +# +# cloudprint_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable cloudprint. +# cloudprint_user (str): User account to run with. +# cloudprint_group (str): Group to run with. +# cloudprint_flags (str): Custom flags for cloudprint. + +. /etc/rc.subr + +: ${cloudprint_enable="NO"} +: ${cloudprint_user="%%CPUSER%%"} +: ${cloudprint_group="%%CPGROUP%%"} + +name=cloudprint +rcvar=cloudprint_enable +piddir="/var/run/${name}" +pidfile="${piddir}/${name}.pid" +confdir="%%PREFIX%%/etc/cloudprint" +command="%%PREFIX%%/bin/cloudprint" +command_args="-d -p ${pidfile} -a ${confdir}/cloudprintauth" +command_interpreter="%%PYTHON_CMD%%" +sig_stop="QUIT" +start_precmd="${name}_prestart" + +cloudprint_prestart() +{ + if [ ! -d "${piddir}" ]; then + /usr/bin/install -d -o ${cloudprint_user} -g ${cloudprint_group} -m 0755 ${piddir} + fi + if [ ! -d "${confdir}" ]; then + /usr/bin/install -d -o ${cloudprint_user} -g ${cloudprint_group} -m 0755 ${confdir} + fi +} + +load_rc_config $name + +run_rc_command "$1" |