Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Feb 2019 12:12:31 +0000 (UTC)
From:      Steve Wills <swills@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r491799 - in head/print/cloud-print-connector: . files
Message-ID:  <201902011212.x11CCVqF009755@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: swills
Date: Fri Feb  1 12:12:31 2019
New Revision: 491799
URL: https://svnweb.freebsd.org/changeset/ports/491799

Log:
  print/cloud-print-connector: Add service/daemon script
  
  PR:		235308
  Submitted by:	Robert James Hernandez <rob@sarcasticadmin.com> (modified slightly)

Added:
  head/print/cloud-print-connector/files/
  head/print/cloud-print-connector/files/gcp-cups-connectord.in   (contents, props changed)
  head/print/cloud-print-connector/pkg-message   (contents, props changed)
Modified:
  head/print/cloud-print-connector/Makefile   (contents, props changed)

Modified: head/print/cloud-print-connector/Makefile
==============================================================================
--- head/print/cloud-print-connector/Makefile	Fri Feb  1 09:53:21 2019	(r491798)
+++ head/print/cloud-print-connector/Makefile	Fri Feb  1 12:12:31 2019	(r491799)
@@ -2,6 +2,7 @@
 
 PORTNAME=	cloud-print-connector
 PORTVERSION=	1.16
+PORTREVISION=	1
 CATEGORIES=	print
 
 MAINTAINER=	swills@FreeBSD.org
@@ -18,6 +19,7 @@ LIB_DEPENDS=	libcups.so:print/cups \
 
 USES=		compiler pkgconfig
 USE_GITHUB=	yes
+USE_RC_SUBR=	gcp-cups-connectord
 GH_TUPLE=	google:cloud-print-connector:7d5f127:DEFAULT/src/github.com/google/cloud-print-connector \
 		urfave:cli:8e01ec4:cli/src/github.com/urfave/cli \
 		satori:go.uuid:36e9d2e:gouuid/src/github.com/satori/go.uuid \

Added: head/print/cloud-print-connector/files/gcp-cups-connectord.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/print/cloud-print-connector/files/gcp-cups-connectord.in	Fri Feb  1 12:12:31 2019	(r491799)
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# PROVIDE: gcp_cups_connectord
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+#
+# gcp_cups_connectord_enable (bool):  Set to "NO" by default.
+#                                     Set it to "YES" to enable
+#
+
+. /etc/rc.subr
+
+name="gcp_cups_connectord"
+rcvar="gcp_cups_connectord_enable"
+
+load_rc_config $name
+
+: ${name_enable:=no}
+
+pidfile="/var/run/${name}.pid"
+command="/usr/sbin/daemon"
+bin="%%PREFIX%%/bin/gcp-cups-connector"
+start_precmd="${name}_prestart"
+
+gcp_cups_connectord_prestart() {
+  if [ -z "${rc_flags}" ];then
+    rc_flags="-P ${pidfile} -f ${bin} -config-filename %%PREFIX%%/etc/gcp-cups-connector.config.json"
+  else
+    rc_flags="-P ${pidfile} -f ${bin} ${rc_flags}"
+  fi
+  return 0
+}
+
+run_rc_command "$1"

Added: head/print/cloud-print-connector/pkg-message
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/print/cloud-print-connector/pkg-message	Fri Feb  1 12:12:31 2019	(r491799)
@@ -0,0 +1,6 @@
+Run the following command to create a config file called gcp-cups-connector.config.json before the starting service:
+
+# gcp-connector-util init --log-file-name "/var/log/cloud-print-connectord"
+# mv /root/gcp-cups-connector.config.json /usr/local/etc/gcp-cups-connector.config.json
+
+More info at: https://github.com/google/cloud-print-connector/wiki/Configuration



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