head 1.9; access; symbols pkgsrc-2013Q2:1.9.0.6 pkgsrc-2013Q2-base:1.9 pkgsrc-2012Q4:1.9.0.4 pkgsrc-2012Q4-base:1.9 pkgsrc-2011Q4:1.9.0.2 pkgsrc-2011Q4-base:1.9 pkgsrc-2011Q3:1.8.0.12 pkgsrc-2011Q3-base:1.8 pkgsrc-2011Q2:1.8.0.10 pkgsrc-2011Q2-base:1.8 pkgsrc-2011Q1:1.8.0.8 pkgsrc-2011Q1-base:1.8 pkgsrc-2010Q4:1.8.0.6 pkgsrc-2010Q4-base:1.8 pkgsrc-2010Q3:1.8.0.4 pkgsrc-2010Q3-base:1.8 pkgsrc-2010Q2:1.8.0.2 pkgsrc-2010Q2-base:1.8 pkgsrc-2009Q4:1.7.0.20 pkgsrc-2009Q4-base:1.7 pkgsrc-2008Q4:1.7.0.18 pkgsrc-2008Q4-base:1.7 pkgsrc-2008Q3:1.7.0.16 pkgsrc-2008Q3-base:1.7 cube-native-xorg:1.7.0.14 cube-native-xorg-base:1.7 pkgsrc-2008Q2:1.7.0.12 pkgsrc-2008Q2-base:1.7 pkgsrc-2008Q1:1.7.0.10 pkgsrc-2008Q1-base:1.7 pkgsrc-2007Q4:1.7.0.8 pkgsrc-2007Q4-base:1.7 pkgsrc-2007Q3:1.7.0.6 pkgsrc-2007Q3-base:1.7 pkgsrc-2007Q2:1.7.0.4 pkgsrc-2007Q2-base:1.7 pkgsrc-2007Q1:1.7.0.2 pkgsrc-2007Q1-base:1.7 pkgsrc-2006Q4:1.6.0.4 pkgsrc-2006Q4-base:1.6 pkgsrc-2006Q3:1.6.0.2 pkgsrc-2006Q3-base:1.6 pkgsrc-2006Q2:1.5.0.22 pkgsrc-2006Q2-base:1.5 pkgsrc-2006Q1:1.5.0.20 pkgsrc-2006Q1-base:1.5 pkgsrc-2005Q4:1.5.0.18 pkgsrc-2005Q4-base:1.5 pkgsrc-2005Q3:1.5.0.16 pkgsrc-2005Q3-base:1.5 pkgsrc-2005Q2:1.5.0.14 pkgsrc-2005Q2-base:1.5 pkgsrc-2005Q1:1.5.0.12 pkgsrc-2005Q1-base:1.5 pkgsrc-2004Q4:1.5.0.10 pkgsrc-2004Q4-base:1.5 pkgsrc-2004Q3:1.5.0.8 pkgsrc-2004Q3-base:1.5 pkgsrc-2004Q2:1.5.0.6 pkgsrc-2004Q2-base:1.5 pkgsrc-2004Q1:1.5.0.4 pkgsrc-2004Q1-base:1.5 pkgsrc-2003Q4:1.5.0.2 pkgsrc-2003Q4-base:1.5 buildlink2-base:1.3 netbsd-1-4-PATCH002:1.2 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.9 date 2011.11.13.21.06.31; author sbd; state dead; branches; next 1.8; 1.8 date 2010.06.05.23.09.29; author sbd; state Exp; branches; next 1.7; 1.7 date 2007.03.14.12.29.05; author markd; state dead; branches; next 1.6; 1.6 date 2006.07.05.20.12.06; author wiz; state Exp; branches; next 1.5; 1.5 date 2002.12.19.22.24.55; author jlam; state dead; branches; next 1.4; 1.4 date 2002.10.20.18.57.38; author jlam; state Exp; branches; next 1.3; 1.3 date 2000.07.12.20.09.37; author jlam; state dead; branches; next 1.2; 1.2 date 99.12.07.21.01.47; author rh; state Exp; branches; next 1.1; 1.1 date 99.11.29.02.18.54; author jlam; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.11.29.02.18.54; author jlam; state Exp; branches; next ; desc @@ 1.9 log @Remove the usb-backend-both-usblp-and-libusb.dpatch as it is has been dropped by it original author. @ text @$NetBSD: patch-al,v 1.8 2010/06/05 23:09:29 sbd Exp $ Incorporate usb-backend-both-usblp-and-libusb.dpatch by http://www.cups.org/str.php?L3357 --- backend/usb-libusb.c.orig 2009-09-11 20:03:31.000000000 +0000 +++ backend/usb-libusb.c @@@@ -13,16 +13,16 @@@@ * * Contents: * - * list_devices() - List the available printers. - * print_device() - Print a file to a USB device. + * list_devices_libusb() - List the available printers. + * print_device_libusb() - Print a file to a USB device. * close_device() - Close the connection to the USB printer. * find_device() - Find or enumerate USB printers. * get_device_id() - Get the IEEE-1284 device ID for the printer. * list_cb() - List USB printers for discovery. * make_device_uri() - Create a device URI for a USB printer. - * open_device() - Open a connection to the USB printer. + * open_device_libusb() - Open a connection to the USB printer. * print_cb() - Find a USB printer for printing. - * side_cb() - Handle side-channel requests. + * side_cb_libusb() - Handle side-channel requests. */ /* @@@@ -65,30 +65,30 @@@@ static int list_cb(usb_printer_t *print static char *make_device_uri(usb_printer_t *printer, const char *device_id, char *uri, size_t uri_size); -static int open_device(usb_printer_t *printer, int verbose); +static int open_device_libusb(usb_printer_t *printer, int verbose); static int print_cb(usb_printer_t *printer, const char *device_uri, const char *device_id, const void *data); -static ssize_t side_cb(usb_printer_t *printer, int print_fd); +static ssize_t side_cb_libusb(usb_printer_t *printer, int print_fd); /* - * 'list_devices()' - List the available printers. + * 'list_devices_libusb()' - List the available printers. */ void -list_devices(void) +list_devices_libusb(void) { - fputs("DEBUG: list_devices\n", stderr); + fputs("DEBUG: list_devices_libusb\n", stderr); find_device(list_cb, NULL); } /* - * 'print_device()' - Print a file to a USB device. + * 'print_device_libusb()' - Print a file to a USB device. */ int /* O - Exit status */ -print_device(const char *uri, /* I - Device URI */ +print_device_libusb(const char *uri, /* I - Device URI */ const char *hostname, /* I - Hostname/manufacturer */ const char *resource, /* I - Resource/modelname */ char *options, /* I - Device options/serial number */ @@@@ -105,19 +105,23 @@@@ print_device(const char *uri, /* I - De struct pollfd pfds[2]; /* Poll descriptors */ - fputs("DEBUG: print_device\n", stderr); + fputs("DEBUG: print_device_libusb\n", stderr); /* * Connect to the printer... */ +#if defined(__linux) || defined(__sun) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) + if ((printer = find_device(print_cb, uri)) == NULL) + return(-1); +#else while ((printer = find_device(print_cb, uri)) == NULL) { _cupsLangPuts(stderr, _("INFO: Waiting for printer to become available...\n")); sleep(5); } - +#endif /* * If we are printing data from a print driver on stdin, ignore SIGTERM @@@@ -189,7 +193,7 @@@@ print_device(const char *uri, /* I - De if (pfds[1].revents & (POLLIN | POLLHUP)) { - if ((bytes = side_cb(printer, print_fd)) < 0) + if ((bytes = side_cb_libusb(printer, print_fd)) < 0) pfds[1].events = 0; /* Filter has gone away... */ else tbytes += bytes; @@@@ -359,7 +363,7 @@@@ find_device(usb_cb_t cb, /* I - Callb printer.iface = iface; printer.handle = NULL; - if (!open_device(&printer, data != NULL)) + if (!open_device_libusb(&printer, data != NULL)) { if (!get_device_id(&printer, device_id, sizeof(device_id))) { @@@@ -583,6 +587,14 @@@@ make_device_uri( mfg = tempmfg; } + if (!strncasecmp(mdl, mfg, strlen(mfg))) + { + mdl += strlen(mfg); + + while (isspace(*mdl & 255)) + mdl ++; + } + /* * Generate the device URI from the manufacturer, model, serial number, * and interface number... @@@@ -611,11 +623,11 @@@@ make_device_uri( /* - * 'open_device()' - Open a connection to the USB printer. + * 'open_device_libusb()' - Open a connection to the USB printer. */ static int /* O - 0 on success, -1 on error */ -open_device(usb_printer_t *printer, /* I - Printer */ +open_device_libusb(usb_printer_t *printer, /* I - Printer */ int verbose) /* I - Update connecting-to-device state? */ { int number; /* Configuration/interface/altset numbers */ @@@@ -733,16 +745,73 @@@@ print_cb(usb_printer_t *printer, /* I - const char *device_id, /* I - IEEE-1284 device ID */ const void *data) /* I - User data (make, model, S/N) */ { - return (!strcmp((char *)data, device_uri)); + char *uri = (char *)data, + *str1, + *str2, + buf[255], + requested_uri[1024]; + + /* Work on a copy of uri */ + strncpy(requested_uri, uri, sizeof(requested_uri)); + requested_uri[sizeof(requested_uri) - 1] = '\0'; + + /* + * libusb-discovered URIs can have an "interface" specification and this + * never happens for usblp-discovered URIs, so remove the "interface" + * specification from the URI which we are checking currently. This way a + * queue for a usblp-discovered printer can now be accessed via libusb + */ + if (((str1 = strstr(requested_uri, "interface=")) == NULL) && + ((str2 = strstr(device_uri, "interface=")) != NULL)) + { + *(str2 - 1) = '\0'; + } + + /* + * Old URI with "serial=?". Cut this part off and consider this as + * an URI without serial number + */ + if ((str1 = strstr(requested_uri, "serial=?")) != NULL) + *(str1 - 1) = '\0'; + + /* + * Old URI without serial number. Match it also with URIs with serial + * number + */ + if (((str1 = strstr(requested_uri, "serial=")) == NULL) && + ((str2 = strstr(device_uri, "serial=")) != NULL)) + *(str2 - 1) = '\0'; + + /* + * libusb-discovered URIs can have a "serial" specification when the + * usblp-discovered URI for the same printer does not have one, as + * with libusb we can discover serial numbers also with other methods + * than only via the device ID. Therefore we accept also a + * usblp-discovered printer without serial number as a match. This we + * do by removing the serial number from the queue's (libusb-discovered) + * URI before comparing. Also warn the user because of the incapability + * of the usblp-based access to distinguish printers by the serial + * number. + */ + if (((str1 = strstr(requested_uri, "serial=")) == NULL) && + ((str2 = strstr(device_uri, "serial=")) != NULL)) + { + *(str2 - 1) = '\0'; + if (backendGetMakeModel(device_id, buf, sizeof(buf)) == 0) + fprintf(stderr, "WARNING: If you have more than one %s printer connected to this machine, please make sure that the \"usblp\" kernel module is always unloaded (and blacklisted) and re-create the queues for these printers. Otherwise CUPS will not be able to distinguish them.\n", + buf); + } + + return (!strcmp(requested_uri, device_uri)); } /* - * 'side_cb()' - Handle side-channel requests. + * 'side_cb_libusb()' - Handle side-channel requests. */ static ssize_t /* O - Number of bytes written */ -side_cb(usb_printer_t *printer, /* I - Printer */ +side_cb_libusb(usb_printer_t *printer, /* I - Printer */ int print_fd) /* I - File to print */ { ssize_t bytes, /* Bytes read/written */ @ 1.8 log @Incorporate: usb-backend-both-usblp-and-libusb.dpatch by http://www.cups.org/str.php?L3357 One "usb" CUPS backend for both libusb-based and usblp-based access. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD$ @ 1.7 log @Update cups to 1.2.8 ok'ed jlam a while back. CUPS 1.2.8 adds a French localization, updates the Japanese and Spanish localizations, and fixes several web interface, printing, and networking bugs. CUPS 1.2.7 adds several Mac OS X improvements, implements timeouts in the SSL negotiation code, and fixes the bounding box generated by the PostScript filter, bidirectional support in the USB backend, and another case where the lpstat command could hang. CUPS 1.2.6 fixes some compile errors, localization of the web interface on Mac OS X, bugs in the lpc and lpstat commands, and backchannel support in the parallel backend. CUPS 1.2.5 fixes minor printing, networking, and documentation issues and adds support for older versions of DBUS and a translation for Estonian. CUPS 1.2.4 fixes a number of web interface, scheduler, and CUPS API issues. CUPS 1.2.3 fixes a number of web interface, networking, remote printing, and CUPS API issues. CUPS 1.2.2 fixes several build, platform, notification, and printing bugs. CUPS 1.2.1 fixes several build, platform, and printing bugs. CUPS 1.2.0 is the first stable feature release in the 1.2.x series and includes over 90 new features and changes since CUPS 1.1.23, including a greatly improved web interface and "plug-and-print" support for many local and network printers. @ text @d1 1 a1 1 $NetBSD: patch-al,v 1.6 2006/07/05 20:12:06 wiz Exp $ d3 215 a217 10 --- cups.list.in.orig 2005-01-03 19:29:44.000000000 +0000 +++ cups.list.in @@@@ -58,6 +58,7 @@@@ $prefix=@@prefix@@ $exec_prefix=@@exec_prefix@@ $bindir=@@bindir@@ $datadir=@@datadir@@ +$datarootdir=@@datarootdir@@ $includedir=@@includedir@@ $infodir=@@infodir@@ $libdir=@@libdir@@ @ 1.6 log @Fix installation with autoconf-2.60. @ text @d1 1 a1 1 $NetBSD$ @ 1.5 log @Updated print/cups to 1.1.17. Changes from version 1.1.16 include: - Bug fixes to the backends and scheduler. - Bug fixes to the image filters. - The scheduler now allows accounts authenticated via PAM to not have a corresponding UNIX account, but group membership still requires the account name to be listed in the UNIX group file(s)... - Added some startup performance enhancements to the scheduler so that the printer object information is regenerated fewer times and the MIME type database is not filled with lots of empty filters for raw/direct queues. - The backends now ignore SIGPIPE so that failed job filters will not stop a print queue. - User-defined classification strings are now printed verbatim. - The lpstat command did not allow for destination lists. - The LPD backend now sends the job title as the print filename. - Added support for variable sizes in the EPSON dot matrix printer drivers. This allows for pages as short as 1/2" (1 row of labels) and does not do an automatic form feed. - The Solaris USB backend now supports the new device URI syntax. - The serial backend now enumerates serial ports under MacOS X. @ text @d1 1 a1 1 $NetBSD: patch-al,v 1.4 2002/10/20 18:57:38 jlam Exp $ d3 10 a12 11 --- templates/Makefile.orig Sun Oct 20 13:19:53 2002 +++ templates/Makefile @@@@ -99,7 +99,7 @@@@ install: for file in $(FILES); do \ $(INSTALL_DATA) $$file $(DATADIR)/templates; \ done - cd fr; make install + cd fr; $(MAKE) $(MFLAGS) install # @ 1.4 log @Update print/cups from version 1.1.15.1 to version 1.1.16: CUPS 1.1.16 adds support for a new CUPS printer driver for Windows NT/2000/XP that provides accurate page accounting as well as support for the banner, job billing, job priority, and page label options. The new release also contains many small bug fixes and enhancements, including better USB printing support, support for printer names containing any printable character (123print, my-long-printer-name, etc.), and French language localization of the web interface and documentation. @ text @d1 1 a1 1 $NetBSD$ @ 1.3 log @Update CUPS to 1.1. Remove most of the patches; I worked closely with the author to make this package compile more seamlessly on BSD systems, and in particular with the NetBSD pkgsrc software collection. CUPS 1.1 is the newest production (stable) release of CUPS. It provides many new features from the 1.0.x releases, including a new Level 3 PostScript RIP, a new PDF filter, EPSON printer drivers, IPP/1.1 support, banner page support, and LPD client support. Binaries for several platforms are also available. Major changes in v1.1 include: - The text filter now embeds missing fonts. - Integrated Xpdf's pdftops filter into CUPS, which is a lightweight and reliable replacement for Ghostscript's PDF support. - The web administration interface now allows you to set the default banner pages. - Images can now be positioned on the page using the new "position" option. - Updated the serial, parallel, and usb backends to do multiple writes and ignore ioctl() errors as needed; this should fix problems with serial printing on old serial drivers and with the UltraSPARC parallel port driver under Solaris 2.7. - Now propagate LD_LIBRARY_PATH to child processes from cupsd. - Queued remote jobs recreate remote printers as needed when the scheduler is started. - Deleting a printer also purges all jobs on that printer. - Old job and control files that don't belong to a printer are automatically deleted. - cups-lpd now supports options set with lpoptions. - The IPP backend now switches to IPP/1.0 if a 1.1 request fails. @ text @d1 1 a1 1 $NetBSD: patch-al,v 1.2 1999/12/07 21:01:47 rh Exp $ d3 8 a10 3 --- data/Makefile.orig Fri Jul 30 16:22:10 1999 +++ data/Makefile Tue Dec 7 21:59:45 1999 @@@@ -49,6 +49,6 @@@@ a11 5 install: - -$(MKDIR) $(DATADIR)/data - $(CP) $(FILES) $(DATADIR)/data + -$(BSD_INSTALL_DATA_DIR) $(DATADIR)/data + $(BSD_INSTALL_DATA) $(FILES) $(DATADIR)/data @ 1.2 log @defuzz. @ text @d1 1 a1 1 $NetBSD$ @ 1.1 log @Initial revision @ text @d3 3 a5 4 --- data/Makefile.orig Fri Jul 30 10:22:10 1999 +++ data/Makefile Sun Nov 28 21:06:28 1999 @@@@ -48,8 +48,8 @@@@ # a13 1 # End of "$Id: Makefile,v 1.2 1999/07/30 14:22:10 mike Exp $". @ 1.1.1.1 log @Common UNIX Printing System, a IPP 1.0 implementation. @ text @@