pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/print/cups-filters Add cups-browsed start up script, f...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2a31e8df28b9
branches:  trunk
changeset: 364250:2a31e8df28b9
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Thu Jun 22 12:30:25 2017 +0000

description:
Add cups-browsed start up script, from Edgar Fu?.

Bump PKGREVISION.

diffstat:

 print/cups-filters/Makefile                        |  21 +++++++++++----
 print/cups-filters/PLIST                           |   4 +-
 print/cups-filters/files/cups-browsed-daemonize.sh |   4 +++
 print/cups-filters/files/cups-browsed.sh           |  28 ++++++++++++++++++++++
 4 files changed, 49 insertions(+), 8 deletions(-)

diffs (114 lines):

diff -r 8fffc13dfca0 -r 2a31e8df28b9 print/cups-filters/Makefile
--- a/print/cups-filters/Makefile       Thu Jun 22 11:16:16 2017 +0000
+++ b/print/cups-filters/Makefile       Thu Jun 22 12:30:25 2017 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.72 2017/06/13 14:59:48 wiz Exp $
+# $NetBSD: Makefile,v 1.73 2017/06/22 12:30:25 wiz Exp $
 
 DISTNAME=      cups-filters-1.14.0
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    print
 MASTER_SITES=  http://openprinting.org/download/cups-filters/
 EXTRACT_SUFX=  .tar.xz
@@ -40,10 +40,8 @@
 BUILD_DEFS+=           VARBASE
 CONFIGURE_ARGS+=       --localstatedir=${VARBASE}
 
-.if ${INIT_SYSTEM} == "rc.d"
-CONFIGURE_ARGS+=       --with-rcdir=${PREFIX}/share/examples/rc.d
-CONFIGURE_ARGS+=       --with-rclevels=""
-.endif
+RCD_SCRIPTS=           cups-browsed
+
 CONFIGURE_ARGS+=       --disable-braille
 CONFIGURE_ARGS+=       --disable-ldap
 CONFIGURE_ARGS+=       --disable-mutool
@@ -57,11 +55,22 @@
 CONF_FILES=            ${PREFIX}/share/examples/cups-filters/fonts/conf.d/99pdftoopvp.conf ${PKG_SYSCONFDIR}/fontconfig/conf.d/99pdftoopvp.conf
 CONF_FILES+=           ${PREFIX}/share/examples/cups-filters/cups-browsed.conf ${PKG_SYSCONFDIR}/cups/cups-browsed.conf
 
+post-extract:
+       ${CP} ${FILESDIR}/cups-browsed-daemonize.sh ${WRKSRC}
+
+SUBST_CLASSES+=                        daemonize
+SUBST_STAGE.daemonize=         pre-configure
+SUBST_MESSAGE.daemonize=       Customizing daemonizing script
+SUBST_FILES.daemonize=         cups-browsed-daemonize.sh
+SUBST_SED.daemonize=           -e 's|@PREFIX@|${PREFIX}|g'
+SUBST_SED.daemonize+=          -e 's|@VARBASE@|${VARBASE}|g'
+
 post-install:
        ${MV} ${DESTDIR}${PKG_SYSCONFDIR}/cups/cups-browsed.conf ${DESTDIR}${PREFIX}/share/examples/cups-filters/cups-browsed.conf
        # backends that need root access should not have world read and execute permissions
        ${CHMOD} go-rwx ${DESTDIR}${PREFIX}/libexec/cups/backend/parallel
        ${CHMOD} go-rwx ${DESTDIR}${PREFIX}/libexec/cups/backend/serial
+       ${INSTALL_SCRIPT} ${WRKSRC}/cups-browsed-daemonize.sh ${DESTDIR}${PREFIX}/libexec/cups-browsed
 
 .include "../../devel/glib2/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
diff -r 8fffc13dfca0 -r 2a31e8df28b9 print/cups-filters/PLIST
--- a/print/cups-filters/PLIST  Thu Jun 22 11:16:16 2017 +0000
+++ b/print/cups-filters/PLIST  Thu Jun 22 12:30:25 2017 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.18 2017/05/01 10:13:29 leot Exp $
+@comment $NetBSD: PLIST,v 1.19 2017/06/22 12:30:25 wiz Exp $
 bin/driverless
 bin/foomatic-rip
 bin/ttfread
@@ -17,6 +17,7 @@
 lib/libfontembed.la
 lib/pkgconfig/libcupsfilters.pc
 lib/pkgconfig/libfontembed.pc
+libexec/cups-browsed
 libexec/cups/backend/beh
 libexec/cups/backend/driverless
 libexec/cups/backend/implicitclass
@@ -88,7 +89,6 @@
 share/doc/cups-filters/README
 share/examples/cups-filters/cups-browsed.conf
 share/examples/cups-filters/fonts/conf.d/99pdftoopvp.conf
-share/examples/rc.d/cups-browsed
 share/ppd/cupsfilters/Fuji_Xerox-DocuPrint_CM305_df-PDF.ppd
 share/ppd/cupsfilters/Generic-PDF_Printer-PDF.ppd
 share/ppd/cupsfilters/HP-Color_LaserJet_CM3530_MFP-PDF.ppd
diff -r 8fffc13dfca0 -r 2a31e8df28b9 print/cups-filters/files/cups-browsed-daemonize.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/print/cups-filters/files/cups-browsed-daemonize.sh        Thu Jun 22 12:30:25 2017 +0000
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# cups-browsed itself doesn't daemonize
+( cd /; @PREFIX@/sbin/cups-browsed </dev/null >/dev/null 2>&1 & echo $! >@VARBASE@/run/cups-browsed.pid ) &
diff -r 8fffc13dfca0 -r 2a31e8df28b9 print/cups-filters/files/cups-browsed.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/print/cups-filters/files/cups-browsed.sh  Thu Jun 22 12:30:25 2017 +0000
@@ -0,0 +1,28 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: cups-browsed.sh,v 1.1 2017/06/22 12:30:25 wiz Exp $
+#
+# PROVIDE: cups-browsed
+# REQUIRE: cups
+
+. /etc/rc.subr
+
+# The program's name is "cups-browsed", but shell varnames can't contain hyphens
+# Also, the program itself doesn't daemonize, use a shell wrapper
+
+name="cups_browsed" # Prefix for various ${name}_XXX variables
+cups_browsed_rcname="cups-browsed" # File name in rc.conf.d
+rcvar="cups_browsed" # Name of YES/NO rc variable
+command=@PREFIX@/libexec/cups-browsed # Daemonizing wrapper
+procname="@PREFIX@/sbin/cups-browsed" # Real command that appears in ps(1) output
+conf_file="@PKG_SYSCONFDIR@/cups/cups-browsed.conf"
+required_files="${conf_file}"
+pidfile=@VARBASE@/run/cups-browsed.pid
+stop_postcmd=cups_browsed_remove_pidfile
+
+cups_browsed_remove_pidfile() {
+       rm -f "${pidfile}"
+}
+
+load_rc_config $cups_browsed_rcname
+run_rc_command $1



Home | Main Index | Thread Index | Old Index