summaryrefslogtreecommitdiffstats
path: root/patches/source/cups
diff options
context:
space:
mode:
Diffstat (limited to 'patches/source/cups')
-rw-r--r--patches/source/cups/cups-1.5.4-usb-quirks.diff319
-rw-r--r--patches/source/cups/cups-blacklist-usblp.conf10
-rwxr-xr-xpatches/source/cups/cups.SlackBuild203
-rw-r--r--patches/source/cups/cups.url1
-rw-r--r--patches/source/cups/doinst.sh34
-rw-r--r--patches/source/cups/slack-desc19
-rw-r--r--patches/source/cups/str4609-1.5.patch341
7 files changed, 927 insertions, 0 deletions
diff --git a/patches/source/cups/cups-1.5.4-usb-quirks.diff b/patches/source/cups/cups-1.5.4-usb-quirks.diff
new file mode 100644
index 00000000..dfe1dab8
--- /dev/null
+++ b/patches/source/cups/cups-1.5.4-usb-quirks.diff
@@ -0,0 +1,319 @@
+From efe932a075744c1cfdf755ce8fea0870fc38a1c8 Mon Sep 17 00:00:00 2001
+From: mancha <mancha1@hush.com>
+Date: Wed, 9 Oct 2013
+Subject: Backport usb fixes to CUPS 1.5.4
+
+ usb-libusb.c | 152 +++++++++++++++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 127 insertions(+), 25 deletions(-)
+
+--- a/backend/usb-libusb.c 2012-07-16
++++ b/backend/usb-libusb.c 2013-10-09
+@@ -13,7 +13,7 @@
+ *
+ * Contents:
+ *
+- * list_devices() - List the available printers.
++ * list_devices() - List the available printers.
+ * print_device() - Print a file to a USB device.
+ * close_device() - Close the connection to the USB printer.
+ * find_device() - Find or enumerate USB printers.
+@@ -70,7 +70,7 @@ typedef struct usb_printer_s /**** USB
+ read_endp, /* Read endpoint */
+ protocol, /* Protocol: 1 = Uni-di, 2 = Bi-di. */
+ usblp_attached, /* "usblp" kernel module attached? */
+- opened_for_job; /* Set to 1 by print_device() */
++ reset_after_job; /* Set to 1 by print_device() */
+ unsigned int quirks; /* Quirks flags */
+ struct libusb_device_handle *handle; /* Open handle to device */
+ } usb_printer_t;
+@@ -122,6 +122,9 @@ struct quirk_printer_struct {
+ #define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */
+ #define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific
+ Class or SubClass */
++#define USBLP_QUIRK_BLACKLIST 0x8 /* these printers do not conform to the USB print spec */
++#define USBLP_QUIRK_RESET 0x4000 /* After printing do a reset
++ for clean-up */
+ #define USBLP_QUIRK_NO_REATTACH 0x8000 /* After printing we cannot re-attach
+ the usblp kernel module */
+
+@@ -139,17 +142,97 @@ static const struct quirk_printer_struct
+ { 0x0409, 0xbef4, USBLP_QUIRK_BIDIR }, /* NEC Picty760 (HP OEM) */
+ { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */
+ { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */
++ { 0x043d, 0x00f3, USBLP_QUIRK_NO_REATTACH }, /* Lexmark International,
++ Inc. (e250d), https://bugs.launchpad.net/bugs/1084164 */
++ { 0x043d, 0x00d7, USBLP_QUIRK_NO_REATTACH }, /* Lexmark E328 */
+ { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820,
+ by zut <kernel@zut.de> */
++ { 0x04a9, 0x1095, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP6000D
++ Printer, https://bugs.launchpad.net/bugs/1160638 */
++ { 0x04a9, 0x10a2, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4200
++ Printer, http://www.cups.org/str.php?L4155 */
++ { 0x04a9, 0x10b6, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4300
++ Printer, https://bugs.launchpad.net/bugs/1032385 */
++ { 0x04a9, 0x1721, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP210
++ https://bugzilla.redhat.com/show_bug.cgi?id=847923#c53 */
++ { 0x04a9, 0x170c, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP500
++ Printer, https://bugs.launchpad.net/bugs/1032456 */
++ { 0x04a9, 0x1717, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP510
++ Printer, https://bugs.launchpad.net/bugs/1050009 */
++ { 0x04a9, 0x173d, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP550
++ Printer, http://www.cups.org/str.php?L4155 */
++ { 0x04a9, 0x173e, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP560
++ Printer, http://www.cups.org/str.php?L4155 */
++ { 0x04a9, 0x26a3, USBLP_QUIRK_NO_REATTACH }, /* Canon, Inc. MF4150
++ Printer, https://bugs.launchpad.net/bugs/1160638 */
++ { 0x04f9, 0x001a, USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
++ HL-1430 Laser Printer,
++ https://bugs.launchpad.net/bugs/1038695 */
+ { 0x04f9, 0x000d, USBLP_QUIRK_BIDIR |
+ USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
+- HL-1440 Laser Printer */
++ HL-1440 Laser Printer,
++ https://bugs.launchpad.net/bugs/1000253 */
++ { 0x04f9, 0x000e, USBLP_QUIRK_BIDIR |
++ USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
++ HL-1450 Laser Printer,
++ https://bugs.launchpad.net/bugs/1000253 */
++ { 0x06bc, 0x000b, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp.
++ Okipage 14ex Printer,
++ https://bugs.launchpad.net/bugs/872483 */
++ { 0x06bc, 0x01c7, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp. B410d,
++ https://bugs.launchpad.net/bugs/872483 */
++ { 0x04b8, 0x0001, USBLP_QUIRK_BIDIR |
++ USBLP_QUIRK_NO_REATTACH }, /* Seiko Epson Corp. Stylus Color 740 / Photo 750,
++ http://bugs.debian.org/697970 */
++ { 0x04b8, 0x0005, USBLP_QUIRK_NO_REATTACH }, /* Seiko Epson Corp. Stylus Color 670,
++ https://bugs.launchpad.net/bugs/872483 */
+ { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt
+ Printer M129C */
+ { 0x067b, 0x2305, USBLP_QUIRK_BIDIR |
+- USBLP_QUIRK_NO_REATTACH },
++ USBLP_QUIRK_NO_REATTACH |
++ USBLP_QUIRK_RESET },
+ /* Prolific Technology, Inc. PL2305 Parallel Port
+- (USB -> Parallel adapter) */
++ (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/987485 */
++ { 0x0924, 0x3ce9, USBLP_QUIRK_NO_REATTACH }, /* Xerox Phaser 3124
++ https://bugzilla.redhat.com/show_bug.cgi?id=867392 */
++ { 0x0924, 0x4293, USBLP_QUIRK_NO_REATTACH }, /* Xerox WorkCentre 3210
++ https://bugs.launchpad.net/bugs/1102470 */
++ { 0x1a86, 0x7584, USBLP_QUIRK_NO_REATTACH }, /* QinHeng Electronics
++ CH340S (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/1000253 */
++ { 0x04e8, 0x0000, USBLP_QUIRK_RESET }, /* All Samsung devices,
++ https://bugs.launchpad.net/bugs/1032456 */
++ { 0x0a5f, 0x0000, USBLP_QUIRK_BIDIR }, /* All Zebra devices,
++ https://bugs.launchpad.net/bugs/1001028 */
++ /* Canon */
++ { 0x04a9, 0x304a, USBLP_QUIRK_BLACKLIST }, /* Canon CP-10 */
++ { 0x04a9, 0x3063, USBLP_QUIRK_BLACKLIST }, /* Canon CP-100 */
++ { 0x04a9, 0x307c, USBLP_QUIRK_BLACKLIST }, /* Canon CP-200 */
++ { 0x04a9, 0x307d, USBLP_QUIRK_BLACKLIST }, /* Canon CP-300 */
++ { 0x04a9, 0x30bd, USBLP_QUIRK_BLACKLIST }, /* Canon CP-220 */
++ { 0x04a9, 0x30be, USBLP_QUIRK_BLACKLIST }, /* Canon CP-330 */
++ { 0x04a9, 0x30f6, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP400 */
++ { 0x04a9, 0x310b, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP600 */
++ { 0x04a9, 0x3127, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP710 */
++ { 0x04a9, 0x3128, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP510 */
++ { 0x04a9, 0x3141, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES1 */
++ { 0x04a9, 0x3142, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP730 */
++ { 0x04a9, 0x3143, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP720 */
++ { 0x04a9, 0x3170, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP750 */
++ { 0x04a9, 0x3171, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP740 */
++ { 0x04a9, 0x3185, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES2 */
++ { 0x04a9, 0x3186, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES20 */
++ { 0x04a9, 0x31aa, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP770 */
++ { 0x04a9, 0x31ab, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP760 */
++ { 0x04a9, 0x31b0, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES30 */
++ { 0x04a9, 0x31dd, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP780 */
++ { 0x04a9, 0x31ee, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES40 */
++ { 0x04a9, 0x3214, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP800 */
++ { 0x04a9, 0x3255, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP900 */
++ { 0x04a9, 0x3256, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP810 */
++ { 0x04a9, 0x30F5, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP500 */
++ { 0x04a9, 0x31AF, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES3 */
++ { 0x04a9, 0x31DD, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP780 */
++ /* MISSING PIDs: CP520, CP530, CP790 */
+ { 0, 0 }
+ };
+
+@@ -256,7 +339,12 @@ print_device(const char *uri, /* I - De
+ }
+
+ g.print_fd = print_fd;
+- g.printer->opened_for_job = 1;
++
++ /*
++ * Some devices need a reset after finishing a job, these devices are
++ * marked with the USBLP_QUIRK_RESET quirk.
++ */
++ g.printer->reset_after_job = (g.printer->quirks & USBLP_QUIRK_RESET ? 1 : 0);
+
+ /*
+ * If we are printing data from a print driver on stdin, ignore SIGTERM
+@@ -639,10 +727,10 @@ print_device(const char *uri, /* I - De
+ * If it didn't exit abort the pending read and wait an additional
+ * second...
+ */
+-
++
+ if (!g.read_thread_done)
+ {
+- fputs("DEBUG: Read thread still active, aborting the pending read...\n",
++ fputs("DEBUG: Read thread still active, aborting the pending read...\n",
+ stderr);
+
+ g.wait_eof = 0;
+@@ -650,7 +738,7 @@ print_device(const char *uri, /* I - De
+ gettimeofday(&tv, NULL);
+ cond_timeout.tv_sec = tv.tv_sec + 1;
+ cond_timeout.tv_nsec = tv.tv_usec * 1000;
+-
++
+ while (!g.read_thread_done)
+ {
+ if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
+@@ -663,9 +751,6 @@ print_device(const char *uri, /* I - De
+ pthread_mutex_unlock(&g.read_thread_mutex);
+ }
+
+- if (print_fd)
+- close(print_fd);
+-
+ /*
+ * Close the connection and input file and general clean up...
+ */
+@@ -725,7 +810,7 @@ close_device(usb_printer_t *printer) /*
+ */
+ if (printer->origconf > 0 && printer->origconf != number2)
+ {
+- fprintf(stderr, "DEBUG: Restoring USB device configuration: %d -> %d\n",
++ fprintf(stderr, "DEBUG: Restoring USB device configuration: %d -> %d\n",
+ number2, printer->origconf);
+ if ((errcode = libusb_set_configuration(printer->handle,
+ printer->origconf)) < 0)
+@@ -772,7 +857,7 @@ close_device(usb_printer_t *printer) /*
+ * Reset the device to clean up after the job
+ */
+
+- if (printer->opened_for_job == 1)
++ if (printer->reset_after_job == 1)
+ {
+ if ((errcode = libusb_reset_device(printer->handle)) < 0)
+ fprintf(stderr,
+@@ -815,7 +900,8 @@ find_device(usb_cb_t cb, /* I - Callb
+ /* Pointer to current alternate setting */
+ const struct libusb_endpoint_descriptor *endpptr = NULL;
+ /* Pointer to current endpoint */
+- ssize_t numdevs, /* number of connected devices */
++ ssize_t err = 0, /* Error code */
++ numdevs, /* number of connected devices */
+ i = 0;
+ uint8_t conf, /* Current configuration */
+ iface, /* Current interface */
+@@ -834,7 +920,14 @@ find_device(usb_cb_t cb, /* I - Callb
+ * Initialize libusb...
+ */
+
+- libusb_init(NULL);
++ err = libusb_init(NULL);
++ if (err)
++ {
++ fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
++ "libusb error %i\n", err);
++ return (NULL);
++ }
++
+ numdevs = libusb_get_device_list(NULL, &list);
+ fprintf(stderr, "DEBUG: libusb_get_device_list=%d\n", (int)numdevs);
+
+@@ -859,7 +952,14 @@ find_device(usb_cb_t cb, /* I - Callb
+ !devdesc.idProduct)
+ continue;
+
+- printer.quirks = quirks(devdesc.idVendor, devdesc.idProduct);
++ printer.quirks = quirks(devdesc.idVendor, devdesc.idProduct);
++
++ /*
++ * Ignore blacklisted printers...
++ */
++
++ if (printer.quirks & USBLP_QUIRK_BLACKLIST)
++ continue;
+
+ for (conf = 0; conf < devdesc.bNumConfigurations; conf ++)
+ {
+@@ -886,7 +986,7 @@ find_device(usb_cb_t cb, /* I - Callb
+ */
+
+ if (((altptr->bInterfaceClass != LIBUSB_CLASS_PRINTER ||
+- altptr->bInterfaceSubClass != 1) &&
++ altptr->bInterfaceSubClass != 1) &&
+ ((printer.quirks & USBLP_QUIRK_BAD_CLASS) == 0)) ||
+ (altptr->bInterfaceProtocol != 1 && /* Unidirectional */
+ altptr->bInterfaceProtocol != 2) || /* Bidirectional */
+@@ -964,7 +1064,7 @@ find_device(usb_cb_t cb, /* I - Callb
+ bEndpointAddress;
+ }
+ else
+- fprintf(stderr, "DEBUG: Uni-directional USB communication "
++ fprintf(stderr, "DEBUG: Uni-directional USB communication "
+ "only!\n");
+ printer.write_endp = confptr->interface[printer.iface].
+ altsetting[printer.altset].
+@@ -997,7 +1097,8 @@ find_device(usb_cb_t cb, /* I - Callb
+ * Clean up ....
+ */
+
+- libusb_free_device_list(list, 1);
++ if (numdevs >= 0)
++ libusb_free_device_list(list, 1);
+ libusb_exit(NULL);
+
+ return (NULL);
+@@ -1144,7 +1245,7 @@ make_device_uri(
+ if ((sern = cupsGetOption("SERIALNUMBER", num_values, values)) == NULL)
+ if ((sern = cupsGetOption("SERN", num_values, values)) == NULL)
+ if ((sern = cupsGetOption("SN", num_values, values)) == NULL &&
+- ((libusb_get_device_descriptor (printer->device, &devdesc) >= 0) &&
++ ((libusb_get_device_descriptor(printer->device, &devdesc) >= 0) &&
+ devdesc.iSerialNumber))
+ {
+ /*
+@@ -1288,7 +1389,7 @@ open_device(usb_printer_t *printer, /* I
+ }
+
+ printer->usblp_attached = 0;
+- printer->opened_for_job = 0;
++ printer->reset_after_job = 0;
+
+ if (verbose)
+ fputs("STATE: +connecting-to-device\n", stderr);
+@@ -1343,7 +1444,7 @@ open_device(usb_printer_t *printer, /* I
+
+ printer->origconf = current;
+
+- if ((errcode =
++ if ((errcode =
+ libusb_get_config_descriptor (printer->device, printer->conf, &confptr))
+ < 0)
+ {
+@@ -1355,7 +1456,7 @@ open_device(usb_printer_t *printer, /* I
+
+ if (number1 != current)
+ {
+- fprintf(stderr, "DEBUG: Switching USB device configuration: %d -> %d\n",
++ fprintf(stderr, "DEBUG: Switching USB device configuration: %d -> %d\n",
+ current, number1);
+ if ((errcode = libusb_set_configuration(printer->handle, number1)) < 0)
+ {
+@@ -1586,7 +1687,8 @@ static unsigned int quirks(int vendor, i
+ for (i = 0; quirk_printers[i].vendorId; i++)
+ {
+ if (vendor == quirk_printers[i].vendorId &&
+- product == quirk_printers[i].productId)
++ (quirk_printers[i].productId == 0x0000 ||
++ product == quirk_printers[i].productId))
+ return quirk_printers[i].quirks;
+ }
+ return 0;
diff --git a/patches/source/cups/cups-blacklist-usblp.conf b/patches/source/cups/cups-blacklist-usblp.conf
new file mode 100644
index 00000000..0ebaa9a6
--- /dev/null
+++ b/patches/source/cups/cups-blacklist-usblp.conf
@@ -0,0 +1,10 @@
+##############################################################################
+# Do not edit this file; instead, copy it to /etc/modprobe.d/ and edit that
+##############################################################################
+
+# Blacklist the (obsolete) usblp module. While the CUPS package has been
+# patched to handle if this module is loaded, there are some reports that
+# it doesn't always work. Anyway, there should be no need to have this
+# module loaded, so we'll blacklist it just in case.
+
+blacklist usblp
diff --git a/patches/source/cups/cups.SlackBuild b/patches/source/cups/cups.SlackBuild
new file mode 100755
index 00000000..71caa108
--- /dev/null
+++ b/patches/source/cups/cups.SlackBuild
@@ -0,0 +1,203 @@
+#!/bin/sh
+
+# Copyright 2008, 2009, 2010, 2011, 2012 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# CUPS build script by volkerdi@slackware.com.
+
+VERSION=1.5.4
+BUILD=${BUILD:-4_slack14.1}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ "$ARCH" = "x86_64" ]; then
+ LIBDIRSUFFIX="64"
+else
+ LIBDIRSUFFIX=""
+fi
+
+NUMJOBS=${NUMJOBS:-" -j7 "}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-cups
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+cd $TMP
+rm -rf cups-$VERSION
+tar xvf $CWD/cups-$VERSION-source.tar.?z* || exit 1
+cd cups-$VERSION || exit 1
+
+# Fix for CUPS 1.5.4. Don't reload the obsolete usblp module, as this
+# can cause partial printing with certain printers.
+zcat $CWD/cups-1.5.4-usb-quirks.diff.gz | patch -p1 --verbose || exit 1
+
+zcat $CWD/str4609-1.5.patch.gz | patch -p0 --verbose || exit 1
+
+sed -i.orig -e 's#$exec_prefix/lib/cups#$libdir/cups#g' configure
+./configure \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --enable-ssl \
+ --enable-openssl=yes \
+ --enable-gnutls=no \
+ --enable-cdsassl=no \
+ --docdir=/usr/doc \
+ --without-php \
+ --disable-pam \
+ --build=$ARCH-slackware-linux
+
+make $NUMJOBS || exit 1
+mkdir -p $PKG/etc/cups
+mkdir -p $PKG/var/spool
+make BUILDROOT=$PKG install || exit 1
+
+# Blacklist the usblp module just to make sure that it doesn't cause
+# any problems:
+mkdir -p $PKG/lib/modprobe.d
+cp -a $CWD/cups-blacklist-usblp.conf $PKG/lib/modprobe.d
+chown root:root $PKG/lib/modprobe.d/cups-blacklist-usblp.conf
+chmod 644 $PKG/lib/modprobe.d/cups-blacklist-usblp.conf
+
+# Hey, what's with the gigantic test files? Bloat is bad.
+rm -f $PKG/usr/share/cups/ipptool/*.{pdf,ps,jpg}
+
+# I've added so many things like /etc/init.d/ to Slackware that CUPS
+# is now installing init scripts to the Red Hat locations. We'll move
+# them to the usual locations:
+mkdir -p $PKG/etc/rc.d
+# Handle this as a config file, and non-executable in a default install:
+mv $PKG/etc/init.d/cups $PKG/etc/rc.d/rc.cups.new
+chmod 644 $PKG/etc/rc.d/rc.cups.new
+# Clear out the additions:
+rm -rf $PKG/etc/init.d $PKG/etc/rc{0,2,3,5}.d
+
+# I'm not sure if overwriting this blindly could have ill effects,
+# but it never hurts to play it safe. According to the dbus-daemon
+# manpage, only files ending in .conf will be used, so there won't
+# be any unintended doubling up.
+mv $PKG/etc/dbus-1/system.d/cups.conf $PKG/etc/dbus-1/system.d/cups.conf.new
+
+# For full CUPS SMB support, you'll need to install the cups-samba
+# package from the source in this directory. There's no easy way
+# to add that to a package build, and the requests aren't pouring in,
+# so you'll have to install it yourself. It's easy to do.
+
+# However, this will get you the most useful SMB support for free.
+# Thanks to Boris Kurktchiev for the tip. :-)
+( cd $PKG/usr/lib${LIBDIRSUFFIX}/cups/backend
+ if [ ! -e smb ]; then
+ ln -sf /usr/bin/smbspool smb
+ fi
+)
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+# Remove preformatted manpages and move the manpages to /usr/man:
+( cd $PKG/usr/share/man
+ find . -type d -name "cat*" | xargs rm -rf
+ cd ..
+ mv man ..
+)
+
+# Adjust/expand docs:
+( mkdir -p $PKG/usr/doc
+ mv $PKG/usr/share/doc/cups $PKG/usr/doc/cups-$VERSION
+ rmdir $PKG/usr/share/doc
+ cd $PKG/usr/doc
+ ln -sf cups-$VERSION cups )
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r CHANGES.txt ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
+ cat CHANGES.txt | head -n 1000 > $DOCSDIR/CHANGES.txt
+ touch -r CHANGES.txt $DOCSDIR/CHANGES.txt
+fi
+
+# I'm sorry, but PDF files are almost as bloated and annoying as
+# MS Word documents. We'll retain the HTML files in /usr/doc.
+( cd $PKG/usr/doc
+ find . -name "*.pdf" -exec rm -f {} \; )
+
+# Apply no-clobber fix to conffiles:
+( cd $PKG/etc/cups
+ for file in * ; do
+ if [ -f $file ]; then
+ mv $file $file.new
+ fi
+ done )
+
+# Strip stuff:
+find $PKG | xargs file | grep -e "executable" -e "shared object" \
+ | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+# Use symlinks to certain binaries so that CUPS and LPRng can coexist:
+SUFFIX=cups
+for file in \
+usr/bin/cancel \
+usr/bin/lp \
+usr/bin/lpq \
+usr/bin/lpr \
+usr/bin/lprm \
+usr/bin/lpstat \
+usr/sbin/lpc ; do
+ ( cd $PKG
+ mv ${file} ${file}-${SUFFIX}
+ ( cd `dirname ${file}` ; ln -sf `basename ${file}`-${SUFFIX} `basename ${file}` )
+ )
+done
+# Now fix the associated man pages:
+mv $PKG/usr/man/man1/cancel.1.gz $PKG/usr/man/man1/cancel-${SUFFIX}.1.gz
+mv $PKG/usr/man/man1/lp.1.gz $PKG/usr/man/man1/lp-${SUFFIX}.1.gz
+mv $PKG/usr/man/man1/lpq.1.gz $PKG/usr/man/man1/lpq-${SUFFIX}.1.gz
+mv $PKG/usr/man/man1/lpr.1.gz $PKG/usr/man/man1/lpr-${SUFFIX}.1.gz
+mv $PKG/usr/man/man1/lprm.1.gz $PKG/usr/man/man1/lprm-${SUFFIX}.1.gz
+mv $PKG/usr/man/man1/lpstat.1.gz $PKG/usr/man/man1/lpstat-${SUFFIX}.1.gz
+mv $PKG/usr/man/man8/lpc.8.gz $PKG/usr/man/man8/lpc-${SUFFIX}.8.gz
+( cd $PKG/usr/man/man1
+ ln -sf cancel-${SUFFIX}.1.gz cancel.1.gz
+ ln -sf lp-${SUFFIX}.1.gz lp.1.gz
+ ln -sf lpq-${SUFFIX}.1.gz lpq.1.gz
+ ln -sf lpr-${SUFFIX}.1.gz lpr.1.gz
+ ln -sf lprm-${SUFFIX}.1.gz lprm.1.gz
+ ln -sf lpstat-${SUFFIX}.1.gz lpstat.1.gz
+)
+( cd $PKG/usr/man/man8
+ ln -sf lpc-${SUFFIX}.8.gz lpc.8.gz
+)
+
+# Add the doinst.sh that installs the .new conffiles:
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+
+# Build the package:
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/cups-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/patches/source/cups/cups.url b/patches/source/cups/cups.url
new file mode 100644
index 00000000..fc83aeb6
--- /dev/null
+++ b/patches/source/cups/cups.url
@@ -0,0 +1 @@
+http://ftp.easysw.com/pub/cups/1.5.4/cups-1.5.4-source.tar.bz2
diff --git a/patches/source/cups/doinst.sh b/patches/source/cups/doinst.sh
new file mode 100644
index 00000000..6807cc3a
--- /dev/null
+++ b/patches/source/cups/doinst.sh
@@ -0,0 +1,34 @@
+config() {
+ NEW="$1"
+ OLD="`dirname $NEW`/`basename $NEW .new`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+for file in etc/cups/*.new ; do
+ config $file
+done
+config etc/dbus-1/system.d/cups.conf.new
+
+# This file will just have to go. It appeared for a while during a -current
+# devel period and has never been part of a stable release.
+#config etc/modprobe.d/cups.blacklist.usblp.conf.new
+rm -f etc/modprobe.d/cups.blacklist.usblp.conf.new
+rm -f etc/modprobe.d/cups.blacklist.usblp.conf
+
+# Leave any new rc.cups with the same permissions as the old one:
+# This is a kludge, but it's because there's no --reference option
+# on busybox's 'chmod':
+if [ -e etc/rc.d/rc.cups ]; then
+ if [ -x etc/rc.d/rc.cups ]; then
+ chmod 755 etc/rc.d/rc.cups.new
+ else
+ chmod 644 etc/rc.d/rc.cups.new
+ fi
+fi
+# Then config() it:
+config etc/rc.d/rc.cups.new
diff --git a/patches/source/cups/slack-desc b/patches/source/cups/slack-desc
new file mode 100644
index 00000000..c2e1643c
--- /dev/null
+++ b/patches/source/cups/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+cups: CUPS (Common UNIX Printing System)
+cups:
+cups: The Common UNIX Printing System provides a portable printing layer for
+cups: UNIX(R)-like operating systems. It has been developed by Easy Software
+cups: Products to promote a standard printing solution for all UNIX vendors
+cups: and users. CUPS uses the Internet Printing Protocol ("IPP") as the
+cups: basis for managing print jobs and queues. The CUPS package includes
+cups: System V and Berkeley command-line interfaces, a PostScript RIP
+cups: package for supporting non-PostScript printer drivers, and tools for
+cups: creating additional printer drivers and other CUPS services.
+cups:
diff --git a/patches/source/cups/str4609-1.5.patch b/patches/source/cups/str4609-1.5.patch
new file mode 100644
index 00000000..f0d940ea
--- /dev/null
+++ b/patches/source/cups/str4609-1.5.patch
@@ -0,0 +1,341 @@
+Index: cgi-bin/ipp-var.c
+===================================================================
+--- cgi-bin/ipp-var.c (revision 12588)
++++ cgi-bin/ipp-var.c (working copy)
+@@ -1230,21 +1230,7 @@
+ * Rewrite URIs...
+ */
+
+- if (!strcmp(name, "member_uris"))
+- {
+- char url[1024]; /* URL for class member... */
+-
+-
+- cgiRewriteURL(attr->values[i].string.text, url,
+- sizeof(url), NULL);
+-
+- snprintf(valptr, sizeof(value) - (valptr - value),
+- "<A HREF=\"%s\">%s</A>", url,
+- strrchr(attr->values[i].string.text, '/') + 1);
+- }
+- else
+- cgiRewriteURL(attr->values[i].string.text, valptr,
+- sizeof(value) - (valptr - value), NULL);
++ cgiRewriteURL(attr->values[i].string.text, valptr, sizeof(value) - (valptr - value), NULL);
+ break;
+ }
+
+Index: cgi-bin/template.c
+===================================================================
+--- cgi-bin/template.c (revision 12588)
++++ cgi-bin/template.c (working copy)
+@@ -659,39 +659,7 @@
+ while (*s)
+ {
+ if (*s == '<')
+- {
+- /*
+- * Pass <A HREF="url"> and </A>, otherwise quote it...
+- */
+-
+- if (!_cups_strncasecmp(s, "<A HREF=\"", 9))
+- {
+- fputs("<A HREF=\"", out);
+- s += 9;
+-
+- while (*s && *s != '\"')
+- {
+- if (*s == '&')
+- fputs("&amp;", out);
+- else
+- putc(*s, out);
+-
+- s ++;
+- }
+-
+- if (*s)
+- s ++;
+-
+- fputs("\">", out);
+- }
+- else if (!_cups_strncasecmp(s, "</A>", 4))
+- {
+- fputs("</A>", out);
+- s += 3;
+- }
+- else
+- fputs("&lt;", out);
+- }
++ fputs("&lt;", out);
+ else if (*s == '>')
+ fputs("&gt;", out);
+ else if (*s == '\"')
+Index: scheduler/ipp.c
+===================================================================
+--- scheduler/ipp.c (revision 12588)
++++ scheduler/ipp.c (working copy)
+@@ -509,8 +509,8 @@
+ * Remote unauthenticated user masquerading as local root...
+ */
+
+- _cupsStrFree(username->values[0].string.text);
+- username->values[0].string.text = _cupsStrAlloc(RemoteRoot);
++ _cupsStrFree(username->values[0].string.text);
++ username->values[0].string.text = _cupsStrAlloc(RemoteRoot);
+ }
+ }
+
+@@ -1648,7 +1648,10 @@
+ cupsdSetString(&job->username, con->username);
+
+ if (attr)
+- cupsdSetString(&attr->values[0].string.text, con->username);
++ {
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(con->username);
++ }
+ }
+ else if (attr)
+ {
+@@ -1699,48 +1702,11 @@
+ * Also, we can only have 1 value and it must be a name value.
+ */
+
+- switch (attr->value_tag)
+- {
+- case IPP_TAG_STRING :
+- case IPP_TAG_TEXTLANG :
+- case IPP_TAG_NAMELANG :
+- case IPP_TAG_TEXT :
+- case IPP_TAG_NAME :
+- case IPP_TAG_KEYWORD :
+- case IPP_TAG_URI :
+- case IPP_TAG_URISCHEME :
+- case IPP_TAG_CHARSET :
+- case IPP_TAG_LANGUAGE :
+- case IPP_TAG_MIMETYPE :
+- /*
+- * Free old strings...
+- */
+-
+- for (i = 0; i < attr->num_values; i ++)
+- {
+- _cupsStrFree(attr->values[i].string.text);
+- attr->values[i].string.text = NULL;
+- if (attr->values[i].string.charset)
+- {
+- _cupsStrFree(attr->values[i].string.charset);
+- attr->values[i].string.charset = NULL;
+- }
+- }
+-
+- default :
+- break;
+- }
+-
+- /*
+- * Use the default connection hostname instead...
+- */
+-
+- attr->value_tag = IPP_TAG_NAME;
+- attr->num_values = 1;
+- attr->values[0].string.text = _cupsStrAlloc(con->http.hostname);
++ ippDeleteAttribute(job->attrs, attr);
++ ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-originating-host-name", NULL, con->http.hostname);
+ }
+-
+- attr->group_tag = IPP_TAG_JOB;
++ else
++ attr->group_tag = IPP_TAG_JOB;
+ }
+ else
+ {
+@@ -1832,8 +1798,8 @@
+
+ attr = ippAddStrings(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-sheets",
+ 2, NULL, NULL);
+- attr->values[0].string.text = _cupsStrRetain(printer->job_sheets[0]);
+- attr->values[1].string.text = _cupsStrRetain(printer->job_sheets[1]);
++ attr->values[0].string.text = _cupsStrAlloc(printer->job_sheets[0]);
++ attr->values[1].string.text = _cupsStrAlloc(printer->job_sheets[1]);
+ }
+
+ job->job_sheets = attr;
+@@ -1859,7 +1825,8 @@
+ * Force the leading banner to have the classification on it...
+ */
+
+- cupsdSetString(&attr->values[0].string.text, Classification);
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(Classification);
+
+ cupsdLogJob(job, CUPSD_LOG_NOTICE, "CLASSIFICATION FORCED "
+ "job-sheets=\"%s,none\", "
+@@ -1876,7 +1843,8 @@
+ * Can't put two different security markings on the same document!
+ */
+
+- cupsdSetString(&attr->values[1].string.text, attr->values[0].string.text);
++ _cupsStrFree(attr->values[1].string.text);
++ attr->values[1].string.text = _cupsStrAlloc(attr->values[0].string.text);
+
+ cupsdLogJob(job, CUPSD_LOG_NOTICE, "CLASSIFICATION FORCED "
+ "job-sheets=\"%s,%s\", "
+@@ -1916,18 +1884,26 @@
+ if (attr->num_values > 1 &&
+ !strcmp(attr->values[0].string.text, attr->values[1].string.text))
+ {
+- cupsdSetString(&(attr->values[0].string.text), Classification);
+- cupsdSetString(&(attr->values[1].string.text), Classification);
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(Classification);
++ _cupsStrFree(attr->values[1].string.text);
++ attr->values[1].string.text = _cupsStrAlloc(Classification);
+ }
+ else
+ {
+ if (attr->num_values == 1 ||
+ strcmp(attr->values[0].string.text, "none"))
+- cupsdSetString(&(attr->values[0].string.text), Classification);
++ {
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(Classification);
++ }
+
+ if (attr->num_values > 1 &&
+ strcmp(attr->values[1].string.text, "none"))
+- cupsdSetString(&(attr->values[1].string.text), Classification);
++ {
++ _cupsStrFree(attr->values[1].string.text);
++ attr->values[1].string.text = _cupsStrAlloc(Classification);
++ }
+ }
+
+ if (attr->num_values > 1)
+@@ -4150,7 +4126,8 @@
+ if (attr)
+ {
+ attr->value_tag = IPP_TAG_KEYWORD;
+- cupsdSetString(&(attr->values[0].string.text), "no-hold");
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc("no-hold");
+ }
+
+ /*
+@@ -9491,7 +9468,6 @@
+ if (format)
+ {
+ _cupsStrFree(format->values[0].string.text);
+-
+ format->values[0].string.text = _cupsStrAlloc(mimetype);
+ }
+ else
+@@ -10028,9 +10004,8 @@
+
+ if (attr)
+ {
++ attr->value_tag = IPP_TAG_KEYWORD;
+ _cupsStrFree(attr->values[0].string.text);
+-
+- attr->value_tag = IPP_TAG_KEYWORD;
+ attr->values[0].string.text = _cupsStrAlloc("no-hold");
+
+ cupsdAddEvent(CUPSD_EVENT_JOB_CONFIG_CHANGED, cupsdFindDest(job->dest), job,
+@@ -10719,7 +10694,6 @@
+ IPP_TAG_MIMETYPE)) != NULL)
+ {
+ _cupsStrFree(jformat->values[0].string.text);
+-
+ jformat->values[0].string.text = _cupsStrAlloc(mimetype);
+ }
+ else
+Index: scheduler/job.c
+===================================================================
+--- scheduler/job.c (revision 12588)
++++ scheduler/job.c (working copy)
+@@ -406,7 +406,10 @@
+
+ if ((attr = ippFindAttribute(job->attrs, "job-actual-printer-uri",
+ IPP_TAG_URI)) != NULL)
+- cupsdSetString(&attr->values[0].string.text, printer->uri);
++ {
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(printer->uri);
++ }
+ else
+ ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_URI,
+ "job-actual-printer-uri", NULL, printer->uri);
+@@ -1846,7 +1849,7 @@
+ }
+ else if (i >= (int)(sizeof(job->auth_env) / sizeof(job->auth_env[0])))
+ break;
+-
++
+ if (!strcmp(line, "username"))
+ cupsdSetStringf(job->auth_env + i, "AUTH_USERNAME=%s", data);
+ else if (!strcmp(line, "domain"))
+@@ -1950,7 +1953,10 @@
+
+ if ((attr = ippFindAttribute(job->attrs, "job-printer-uri",
+ IPP_TAG_URI)) != NULL)
+- cupsdSetString(&(attr->values[0].string.text), p->uri);
++ {
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(p->uri);
++ }
+
+ cupsdAddEvent(CUPSD_EVENT_JOB_STOPPED, p, job,
+ "Job #%d moved from %s to %s.", job->id, olddest,
+@@ -2153,7 +2159,10 @@
+ attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME);
+
+ if (attr)
+- cupsdSetString(&(attr->values[0].string.text), when);
++ {
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(when);
++ }
+ else
+ attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD,
+ "job-hold-until", NULL, when);
+@@ -2399,7 +2408,8 @@
+ if (attr)
+ {
+ attr->value_tag = IPP_TAG_KEYWORD;
+- cupsdSetString(&(attr->values[0].string.text), "no-hold");
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc("no-hold");
+ }
+
+ default :
+@@ -4146,7 +4156,10 @@
+ "job-printer-state-message",
+ IPP_TAG_TEXT);
+ if (job->printer_message)
+- cupsdSetString(&(job->printer_message->values[0].string.text), "");
++ {
++ _cupsStrFree(job->printer_message->values[0].string.text);
++ job->printer_message->values[0].string.text = _cupsStrAlloc("");
++ }
+
+ cupsdSetJobState(job, IPP_JOB_PROCESSING, CUPSD_JOB_DEFAULT, NULL);
+ cupsdSetPrinterState(printer, IPP_PRINTER_PROCESSING, 0);
+@@ -4708,10 +4721,15 @@
+
+ if (job->state_value != IPP_JOB_PROCESSING &&
+ job->status_level == CUPSD_LOG_INFO)
+- cupsdSetString(&(job->printer_message->values[0].string.text), "");
++ {
++ _cupsStrFree(job->printer_message->values[0].string.text);
++ job->printer_message->values[0].string.text = _cupsStrAlloc("");
++ }
+ else if (job->printer->state_message[0] && do_message)
+- cupsdSetString(&(job->printer_message->values[0].string.text),
+- job->printer->state_message);
++ {
++ _cupsStrFree(job->printer_message->values[0].string.text);
++ job->printer_message->values[0].string.text = _cupsStrAlloc(job->printer->state_message);
++ }
+
+ /*
+ * ... and the printer-state-reasons value...