Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Mar 2014 09:20:06 +0000 (UTC)
From:      Bernhard Froehlich <decke@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r347727 - in head/print/cloudprint: . files
Message-ID:  <201403100920.s2A9K6WE055007@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: decke
Date: Mon Mar 10 09:20:06 2014
New Revision: 347727
URL: http://svnweb.freebsd.org/changeset/ports/347727
QAT: https://qat.redports.org/buildarchive/r347727/

Log:
  - Add rc startscript with support to run cloudprint as unprivileged user
  - Bump PORTREVISION

Added:
  head/print/cloudprint/files/
  head/print/cloudprint/files/cloudprint.in   (contents, props changed)
Modified:
  head/print/cloudprint/Makefile

Modified: head/print/cloudprint/Makefile
==============================================================================
--- head/print/cloudprint/Makefile	Mon Mar 10 09:17:29 2014	(r347726)
+++ head/print/cloudprint/Makefile	Mon Mar 10 09:20:06 2014	(r347727)
@@ -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 lo
 
 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>

Added: head/print/cloudprint/files/cloudprint.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/print/cloudprint/files/cloudprint.in	Mon Mar 10 09:20:06 2014	(r347727)
@@ -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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403100920.s2A9K6WE055007>