diff options
-rw-r--r-- | print/cups-base/Makefile | 9 | ||||
-rw-r--r-- | print/cups-base/distinfo | 4 | ||||
-rw-r--r-- | print/cups-base/files/lpt-cupsd.conf | 17 | ||||
-rw-r--r-- | print/cups-base/files/ulpt-cupsd.conf.in | 38 | ||||
-rw-r--r-- | print/cups-base/files/ulpt-cupsd.sh.in | 47 | ||||
-rw-r--r-- | print/cups-base/pkg-message | 2 | ||||
-rw-r--r-- | print/cups-base/pkg-plist | 3 |
7 files changed, 95 insertions, 25 deletions
diff --git a/print/cups-base/Makefile b/print/cups-base/Makefile index bb719a905e64..3d56af2fcfff 100644 --- a/print/cups-base/Makefile +++ b/print/cups-base/Makefile @@ -6,9 +6,8 @@ # PORTNAME= cups -PORTVERSION= 1.4.5 +PORTVERSION= 1.4.6 DISTVERSIONSUFFIX= -source -PORTREVISION= 0 CATEGORIES= print MASTER_SITES= EASYSW/${PORTNAME}/${DISTVERSION} PKGNAMESUFFIX= ${CUPS_SUFFIX}${PKGNAMESUFFIX2} @@ -75,7 +74,6 @@ CUPS_SUFFIX= -client CUPS_SUFFIX= -image LICENSE= LGPL21 .else -PORTREVISION= 1 CUPS_SUFFIX= -base CONFLICTS+= cupsddk-* .endif @@ -266,6 +264,8 @@ MAN8= accept.8 \ MLINKS= accept.8 reject.8 \ cupsaccept.8 cupsreject.8 \ cupsenable.8 cupsdisable.8 + +SUB_FILES+= ulpt-cupsd.conf ulpt-cupsd.sh .endif pre-configure:: @@ -361,7 +361,8 @@ post-install: cd ${CUPS_ETCDIR}/; if test ! -f ${f}; then ${CP} -p ${f}.N ${f}; fi .endfor ${MKDIR} ${EXAMPLESDIR} - ${INSTALL_DATA} ${FILESDIR}/lpt-cupsd.conf ${EXAMPLESDIR}/ + ${INSTALL_DATA} ${WRKDIR}/ulpt-cupsd.conf ${EXAMPLESDIR}/ + ${INSTALL_SCRIPT} ${WRKDIR}/ulpt-cupsd.sh ${PREFIX}/sbin/ ${INSTALL} -d ${CUPS_SPOOLDIR}/tmp/ ${CHOWN} -R ${CUPSOWN}:${CUPSGRP} ${CUPS_SPOOLDIR}/ ${CHMOD} -R g+w ${CUPS_SPOOLDIR}/ diff --git a/print/cups-base/distinfo b/print/cups-base/distinfo index cf299400c026..5d9ec492e120 100644 --- a/print/cups-base/distinfo +++ b/print/cups-base/distinfo @@ -1,2 +1,2 @@ -SHA256 (cups-1.4.5-source.tar.bz2) = 0450d6d8e6e8af225d2a3319c848737d76473a6c7579cf97c52086d0371c0efe -SIZE (cups-1.4.5-source.tar.bz2) = 4513924 +SHA256 (cups-1.4.6-source.tar.bz2) = f08711702a77b52c7150f96fe1f45482f6151cb95ef601268c528607fe6ad514 +SIZE (cups-1.4.6-source.tar.bz2) = 4517061 diff --git a/print/cups-base/files/lpt-cupsd.conf b/print/cups-base/files/lpt-cupsd.conf deleted file mode 100644 index 81a02df92187..000000000000 --- a/print/cups-base/files/lpt-cupsd.conf +++ /dev/null @@ -1,17 +0,0 @@ -# /usr/local/etc/devd/cups.conf -attach 110 { -device-name "unlpt[0-9]+"; -action "chown cups:cups /dev/$device-name"; -}; - -attach 110 { -device-name "ulpt[0-9]+"; -action "chown cups:cups /dev/$device-name"; -}; - -attach 110 { -device-name "lpt[0-9]+"; -action "chown cups:cups /dev/$device-name"; -}; - -# eof diff --git a/print/cups-base/files/ulpt-cupsd.conf.in b/print/cups-base/files/ulpt-cupsd.conf.in new file mode 100644 index 000000000000..f9dde52718f2 --- /dev/null +++ b/print/cups-base/files/ulpt-cupsd.conf.in @@ -0,0 +1,38 @@ +# /usr/local/etc/devd/cups.conf +# +# $FreeBSD$ +# +# Tell cups to pause and unpause the printer when it arrives and departs. +# + +attach 110 { +device-name "unlpt[0-9]+"; +action "%%PREFIX%%/sbin/ulpt-cupsd.sh enable $device-name"; +}; + +attach 110 { +device-name "ulpt[0-9]+"; +action "%%PREFIX%%/sbin/ulpt-cupsd.sh enable $device-name"; +}; + +attach 110 { +device-name "lpt[0-9]+"; +action "%%PREFIX%%/sbin/ulpt-cupsd.sh enable $device-name"; +}; + +detach 110 { +device-name "unlpt[0-9]+"; +action "%%PREFIX%%/sbin/ulpt-cupsd.sh disable $device-name"; +} + +detach 110 { +device-name "ulpt[0-9]+"; +action "%%PREFIX%%/sbin/ulpt-cupsd.sh disable $device-name"; +} + +detach 110 { +device-name "lpt[0-9]+"; +action "%%PREFIX%%/sbin/ulpt-cupsd.sh disable $device-name"; +} + +# eof diff --git a/print/cups-base/files/ulpt-cupsd.sh.in b/print/cups-base/files/ulpt-cupsd.sh.in new file mode 100644 index 000000000000..41935aa71111 --- /dev/null +++ b/print/cups-base/files/ulpt-cupsd.sh.in @@ -0,0 +1,47 @@ +#!/bin/sh +# +# $FreeBSD$ + +usage() { + echo "$0: usage:" >&2 + echo "$0 [enable|disable] devicename" >&2 + exit 1 +} + +if [ -z "$2" ]; then + usage +fi + +printer="$(awk -v DEVICENAME="$2" ' +/^<(Default)?Printer[[:space:]]/ { + if (match($0, /[^[:space:]>]+>/)) { + PRINTER=substr($0, RSTART, RLENGTH - 1); + } +} +/^<\/(Default)?Printer/ { + PRINTER="" +} +match($0, "DeviceURI[[:space:]]+usb:/dev/" DEVICENAME "\$") { + print PRINTER +} +' %%PREFIX%%/etc/cups/printers.conf)" + +if [ -z "$printer" ]; then + # nothing to do + exit 0 +fi + +case "$1" in +enable) + chown cups:cups "/dev/$2" + %%PREFIX%%/sbin/cupsenable "$printer" + ;; +disable) + %%PREFIX%%/sbin/cupsdisable "$printer" + ;; +*) + usage + ;; +esac +exit 0 +# eof diff --git a/print/cups-base/pkg-message b/print/cups-base/pkg-message index a9dc95af6dd4..a19aaadd65e2 100644 --- a/print/cups-base/pkg-message +++ b/print/cups-base/pkg-message @@ -21,7 +21,7 @@ devfs_system_ruleset="system" 3) Restart devfs: /etc/rc.d/devfs restart If your system supports 'devd' you can copy -$PREFIX/share/examples/cups/lpt-cupsd.conf to $PREFIX/etc/devd/ +$PREFIX/share/examples/cups/ulpt-cupsd.conf to $PREFIX/etc/devd/ To enable printing under Gimp and MS-Windows clients do the following: diff --git a/print/cups-base/pkg-plist b/print/cups-base/pkg-plist index 0ef054435497..3860f2b2a705 100644 --- a/print/cups-base/pkg-plist +++ b/print/cups-base/pkg-plist @@ -106,6 +106,7 @@ sbin/cupsdisable sbin/cupsenable sbin/cupsfilter sbin/cupsreject +sbin/ulpt-cupsd.sh sbin/lpadmin sbin/lpc sbin/lpinfo @@ -922,7 +923,7 @@ sbin/reject %%DOCSDIR%%/pl/index.html %%DOCSDIR%%/robots.txt %%DOCSDIR%%/ru/index.html -%%EXAMPLESDIR%%/lpt-cupsd.conf +%%EXAMPLESDIR%%/ulpt-cupsd.conf share/applications/cups.desktop share/icons/hicolor/16x16/apps/cups.png share/icons/hicolor/32x32/apps/cups.png |