svn commit: r411055 - in head/print: cups cups/files hplip hplip/files
Tijl Coosemans
tijl at FreeBSD.org
Mon Mar 14 11:41:00 UTC 2016
Author: tijl
Date: Mon Mar 14 11:40:58 2016
New Revision: 411055
URL: https://svnweb.freebsd.org/changeset/ports/411055
Log:
Add a patch to print/cups and print/hplip to disable detaching of ulpt(4).
This isn't needed on FreeBSD and it always fails because the process doesn't
have the required privileges.
Add a sample devd configuration file to print/cups that gives users in group
cups access to USB printers. [1]
Submitted by: hselasky, Alexander Zagrebin <alex at zagrebin.ru> [1]
Added:
head/print/cups/files/cups.conf.sample (contents, props changed)
head/print/cups/files/patch-backend_usb-libusb.c (contents, props changed)
Modified:
head/print/cups/Makefile
head/print/cups/pkg-plist
head/print/hplip/Makefile
head/print/hplip/files/patch-io-hpmud-musb.c
Modified: head/print/cups/Makefile
==============================================================================
--- head/print/cups/Makefile Mon Mar 14 11:13:46 2016 (r411054)
+++ head/print/cups/Makefile Mon Mar 14 11:40:58 2016 (r411055)
@@ -4,6 +4,7 @@
PORTNAME= cups
PORTVERSION= 2.1.3
DISTVERSIONSUFFIX=-source
+PORTREVISION= 1
CATEGORIES= print
MASTER_SITES= http://www.cups.org/software/${PORTVERSION}/
@@ -85,6 +86,7 @@ CONFIGURE_ARGS+=ac_cv_search_libiconv_op
post-patch:
@${REINPLACE_CMD} -e '/SILENT/d' ${WRKSRC}/Makedefs.in
+ @${REINPLACE_CMD} 's/usblp/ulpt/g' ${WRKSRC}/backend/usb-libusb.c
@${REINPLACE_CMD} -e 's|/usr/local/etc/pam.d|${LOCALBASE}/etc/pam.d|' \
-e 's/-fstack-protector//' ${WRKSRC}/configure
@${REINPLACE_CMD} 's|http://www.cups.org|https://cups.org|' \
@@ -116,6 +118,8 @@ post-patch-DOCS-off:
post-install:
${LN} -sf lpr ${STAGEDIR}${PREFIX}/bin/lpr-cups
+ ${INSTALL_DATA} ${FILESDIR}/cups.conf.sample \
+ ${STAGEDIR}${PREFIX}/etc/devd
${INSTALL_DATA} ${FILESDIR}/cups ${STAGEDIR}${PREFIX}/etc/pam.d
.include <bsd.port.post.mk>
Added: head/print/cups/files/cups.conf.sample
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/print/cups/files/cups.conf.sample Mon Mar 14 11:40:58 2016 (r411055)
@@ -0,0 +1,13 @@
+# $FreeBSD$
+#
+# Allow members of group cups to access generic USB printer devices
+
+notify 100 {
+ match "system" "USB";
+ match "subsystem" "INTERFACE";
+ match "type" "ATTACH";
+ match "intclass" "0x07";
+ match "intsubclass" "0x01";
+ match "intprotocol" "(0x01|0x02|0x03)";
+ action "chgrp cups /dev/$cdev; chmod g+rw /dev/$cdev";
+};
Added: head/print/cups/files/patch-backend_usb-libusb.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/print/cups/files/patch-backend_usb-libusb.c Mon Mar 14 11:40:58 2016 (r411055)
@@ -0,0 +1,11 @@
+--- backend/usb-libusb.c.orig 2015-09-15 21:20:02 UTC
++++ backend/usb-libusb.c
+@@ -1441,7 +1441,7 @@ open_device(usb_printer_t *printer, /* I
+ * works without the module attached.
+ */
+
+- errcode = libusb_kernel_driver_active(printer->handle, printer->iface);
++ errcode = 0;
+ if (errcode == 0)
+ printer->usblp_attached = 0;
+ else if (errcode == 1)
Modified: head/print/cups/pkg-plist
==============================================================================
--- head/print/cups/pkg-plist Mon Mar 14 11:13:46 2016 (r411054)
+++ head/print/cups/pkg-plist Mon Mar 14 11:40:58 2016 (r411055)
@@ -30,6 +30,7 @@ bin/ppdpo
@sample(,cups,640) %%ETCDIR%%/cupsd.conf.sample
@sample(,cups,640) %%ETCDIR%%/snmp.conf.sample
etc/dbus-1/system.d/cups.conf
+ at sample etc/devd/cups.conf.sample
etc/pam.d/cups
include/cups/adminutil.h
include/cups/array.h
Modified: head/print/hplip/Makefile
==============================================================================
--- head/print/hplip/Makefile Mon Mar 14 11:13:46 2016 (r411054)
+++ head/print/hplip/Makefile Mon Mar 14 11:40:58 2016 (r411055)
@@ -3,6 +3,7 @@
PORTNAME= hplip
PORTVERSION= 3.16.2
+PORTREVISION= 1
CATEGORIES= print
MASTER_SITES= SF
Modified: head/print/hplip/files/patch-io-hpmud-musb.c
==============================================================================
--- head/print/hplip/files/patch-io-hpmud-musb.c Mon Mar 14 11:13:46 2016 (r411054)
+++ head/print/hplip/files/patch-io-hpmud-musb.c Mon Mar 14 11:40:58 2016 (r411055)
@@ -1,6 +1,6 @@
---- io/hpmud/musb.c.orig 2015-06-13 19:38:23 UTC
+--- io/hpmud/musb.c.orig 2016-02-08 09:42:51 UTC
+++ io/hpmud/musb.c
-@@ -138,10 +138,16 @@ static int get_string_descriptor(libusb_
+@@ -139,10 +139,16 @@ static int get_string_descriptor(libusb_
0x409,
tbuf, sizeof(tbuf), LIBUSB_CONTROL_REQ_TIMEOUT);
@@ -20,3 +20,12 @@
continue;
}
break;
+@@ -385,7 +391,7 @@ static int detach(libusb_device_handle *
+ {
+ int ret ;
+ /* If any kernel module has claimed this interface, detach it. */
+- ret = libusb_kernel_driver_active (hd, interface);
++ ret = 0;
+ DBG("Active kernel driver on interface=%d ret=%d\n", interface, ret);
+ if (ret == 1)
+ {
More information about the svn-ports-head
mailing list