From 30e562fe3a7c605f77850f73a66fa187dc6ac293 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 12 Oct 2013 10:41:13 +0200 Subject: [PATCH] cups: update to 1.6.4. --- srcpkgs/cups/INSTALL | 5 + srcpkgs/cups/libcups.INSTALL | 5 + .../cups-1.6.0-fix-install-perms.patch | 25 +++++ .../cups/patches/cups-1.6.2-statedir.patch | 12 ++ srcpkgs/cups/patches/cups-avahi-address.patch | 75 +++++++++++++ srcpkgs/cups/patches/cups-dbus-utf8.patch | 106 ++++++++++++++++++ srcpkgs/cups/patches/cups-enum-all.patch | 17 +++ srcpkgs/cups/patches/cups-res_init.patch | 26 +++++ ...rash-on-avahi-threaded-poll-shutdown.patch | 19 ++++ srcpkgs/cups/template | 5 +- 10 files changed, 292 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/cups/INSTALL create mode 100644 srcpkgs/cups/libcups.INSTALL create mode 100644 srcpkgs/cups/patches/cups-1.6.0-fix-install-perms.patch create mode 100644 srcpkgs/cups/patches/cups-1.6.2-statedir.patch create mode 100644 srcpkgs/cups/patches/cups-avahi-address.patch create mode 100644 srcpkgs/cups/patches/cups-dbus-utf8.patch create mode 100644 srcpkgs/cups/patches/cups-enum-all.patch create mode 100644 srcpkgs/cups/patches/cups-res_init.patch create mode 100644 srcpkgs/cups/patches/cupsd-no-crash-on-avahi-threaded-poll-shutdown.patch diff --git a/srcpkgs/cups/INSTALL b/srcpkgs/cups/INSTALL new file mode 100644 index 00000000000..194905c853a --- /dev/null +++ b/srcpkgs/cups/INSTALL @@ -0,0 +1,5 @@ +case ${ACTION} in +post) + chgrp -R lp etc/cups + ;; +esac diff --git a/srcpkgs/cups/libcups.INSTALL b/srcpkgs/cups/libcups.INSTALL new file mode 100644 index 00000000000..194905c853a --- /dev/null +++ b/srcpkgs/cups/libcups.INSTALL @@ -0,0 +1,5 @@ +case ${ACTION} in +post) + chgrp -R lp etc/cups + ;; +esac diff --git a/srcpkgs/cups/patches/cups-1.6.0-fix-install-perms.patch b/srcpkgs/cups/patches/cups-1.6.0-fix-install-perms.patch new file mode 100644 index 00000000000..4675a110690 --- /dev/null +++ b/srcpkgs/cups/patches/cups-1.6.0-fix-install-perms.patch @@ -0,0 +1,25 @@ +Index: Makedefs.in +=================================================================== +--- cups-1.6.0/Makedefs.in (Revision 10520) ++++ cups-1.6.0/Makedefs.in (Arbeitskopie) +@@ -40,14 +40,14 @@ + # Installation programs... + # + +-INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@ +-INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@ ++INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@ ++INSTALL_COMPDATA = $(INSTALL) -c -m 644 @INSTALL_GZIP@ + INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@ +-INSTALL_DATA = $(INSTALL) -c -m 444 ++INSTALL_DATA = $(INSTALL) -c -m 644 + INSTALL_DIR = $(INSTALL) -d +-INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@ +-INSTALL_MAN = $(INSTALL) -c -m 444 +-INSTALL_SCRIPT = $(INSTALL) -c -m 555 ++INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@ ++INSTALL_MAN = $(INSTALL) -c -m 644 ++INSTALL_SCRIPT = $(INSTALL) -c -m 755 + + # + # Default user, group, and system groups for the scheduler... diff --git a/srcpkgs/cups/patches/cups-1.6.2-statedir.patch b/srcpkgs/cups/patches/cups-1.6.2-statedir.patch new file mode 100644 index 00000000000..3e836657de8 --- /dev/null +++ b/srcpkgs/cups/patches/cups-1.6.2-statedir.patch @@ -0,0 +1,12 @@ +diff -ruN cups-1.6.2.orig/config-scripts/cups-directories.m4 cups-1.6.2/config-scripts/cups-directories.m4 +--- cups-1.6.2.orig/config-scripts/cups-directories.m4 2012-10-01 03:55:23.000000000 +0200 ++++ cups-1.6.2/config-scripts/cups-directories.m4 2013-04-02 00:11:41.000000000 +0200 +@@ -429,7 +429,7 @@ + ;; + *) + # All others +- CUPS_STATEDIR="$localstatedir/run/cups" ++ CUPS_STATEDIR="/run/cups" + ;; + esac + AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR") diff --git a/srcpkgs/cups/patches/cups-avahi-address.patch b/srcpkgs/cups/patches/cups-avahi-address.patch new file mode 100644 index 00000000000..a03d1adbb99 --- /dev/null +++ b/srcpkgs/cups/patches/cups-avahi-address.patch @@ -0,0 +1,75 @@ +diff -up cups-1.6.2/cups/http-support.c.avahi-address cups-1.6.2/cups/http-support.c +--- cups-1.6.2/cups/http-support.c.avahi-address 2013-03-11 18:44:36.000000000 +0000 ++++ cups-1.6.2/cups/http-support.c 2013-04-04 15:39:06.651847041 +0100 +@@ -2121,7 +2121,7 @@ http_resolve_cb( + const char *type, /* I - Registration type */ + const char *domain, /* I - Domain (unused) */ + const char *hostTarget, /* I - Hostname */ +- const AvahiAddress *address, /* I - Address (unused) */ ++ const AvahiAddress *address, /* I - Address */ + uint16_t port, /* I - Port number */ + AvahiStringList *txt, /* I - TXT record */ + AvahiLookupResultFlags flags, /* I - Lookup flags (unused) */ +@@ -2253,36 +2253,37 @@ http_resolve_cb( + + DEBUG_printf(("8http_resolve_cb: Looking up \"%s\".", hostTarget)); + +- snprintf(fqdn, sizeof(fqdn), "%d", ntohs(port)); +- if ((addrlist = httpAddrGetList(hostTarget, AF_UNSPEC, fqdn)) != NULL) ++ int error = getnameinfo(&(address->data), ++ address->proto == AVAHI_PROTO_INET ? ++ sizeof (AvahiIPv4Address) : ++ (address->proto == AVAHI_PROTO_INET6 ? ++ sizeof (AvahiIPv6Address) : ++ sizeof (address->data)), ++ fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD); ++ ++ if (!error) + { +- for (addr = addrlist; addr; addr = addr->next) ++ DEBUG_printf(("8http_resolve_cb: Found \"%s\".", fqdn)); ++ ++ if ((hostptr = fqdn + strlen(fqdn) - 6) <= fqdn || ++ _cups_strcasecmp(hostptr, ".local")) + { +- int error = getnameinfo(&(addr->addr.addr), +- httpAddrLength(&(addr->addr)), +- fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD); +- +- if (!error) +- { +- DEBUG_printf(("8http_resolve_cb: Found \"%s\".", fqdn)); +- +- if ((hostptr = fqdn + strlen(fqdn) - 6) <= fqdn || +- _cups_strcasecmp(hostptr, ".local")) +- { +- hostTarget = fqdn; +- break; +- } +- } ++ hostTarget = fqdn; ++ } ++ } + #ifdef DEBUG +- else +- DEBUG_printf(("8http_resolve_cb: \"%s\" did not resolve: %d", +- httpAddrString(&(addr->addr), fqdn, sizeof(fqdn)), +- error)); ++ else ++ DEBUG_printf(("8http_resolve_cb: \"%s\" did not resolve: %d", ++ httpAddrString(&(addr->addr), fqdn, sizeof(fqdn)), ++ error)); + #endif /* DEBUG */ +- } ++ } else { ++ /* ++ * Use the IP address that responded... ++ */ + +- httpAddrFreeList(addrlist); +- } ++ avahi_address_snprint (fqdn, sizeof (fqdn), address); ++ hostTarget = fqdn; + } + + /* diff --git a/srcpkgs/cups/patches/cups-dbus-utf8.patch b/srcpkgs/cups/patches/cups-dbus-utf8.patch new file mode 100644 index 00000000000..0bcd4a16333 --- /dev/null +++ b/srcpkgs/cups/patches/cups-dbus-utf8.patch @@ -0,0 +1,106 @@ +diff -up cups-1.6.1/notifier/dbus.c.dbus-utf8 cups-1.6.1/notifier/dbus.c +--- cups-1.6.1/notifier/dbus.c.dbus-utf8 2012-01-20 19:00:32.000000000 +0000 ++++ cups-1.6.1/notifier/dbus.c 2012-10-31 11:04:47.686973616 +0000 +@@ -31,6 +31,9 @@ + #include + #include + #include ++#include ++#include ++#include + + #ifdef HAVE_DBUS + # include +@@ -157,10 +160,82 @@ enum + * Local functions... + */ + +-static int acquire_lock(int *fd, char *lockfile, size_t locksize); ++static int acquire_lock(int *fd, char *lockfile, size_t locksize); ++static const char *validate_utf8(const char *str); + + + /* ++ * 'validate_utf8()' - Convert to valid UTF-8 ++ */ ++ ++static const char * ++validate_utf8 (const char *str) ++{ ++ static char *buffer = NULL; ++ static size_t buflen = 0; ++ char *p; ++ size_t str_len; ++ unsigned int i; ++ mbstate_t instate, outstate; ++ ++ if (str == NULL) ++ { ++ free (buffer); ++ return (NULL); ++ } ++ ++ /* Is it already valid? */ ++ if (mbstowcs (NULL, str, 0) != (size_t) -1) ++ return str; ++ ++ /* Make sure our buffer is at least as large as the input string */ ++ str_len = strlen (str); ++ if (str_len > buflen) ++ { ++ if (buffer == NULL) ++ /* Set encoding type to UTF-8 the first time we need to */ ++ setlocale (LC_CTYPE, "en_US.UTF-8"); ++ ++ buflen = str_len + 1; ++ buffer = realloc (buffer, buflen); ++ } ++ ++ memset (&instate, '\0', sizeof (mbstate_t)); ++ memset (&outstate, '\0', sizeof (mbstate_t)); ++ p = buffer; ++ i = 0; ++ while (i < str_len) ++ { ++ wchar_t wc; ++ size_t used, written; ++ mbstate_t orig_instate = instate; ++ used = mbrtowc (&wc, str + i, str_len - i, &instate); ++ switch (used) ++ { ++ case (size_t) -2: ++ case (size_t) -1: ++ wc = L'?'; /* so replacement is never longer than original char */ ++ instate = orig_instate; ++ /* fallthru */ ++ case 0: ++ used = 1; ++ } ++ ++ written = wcrtomb (p, wc, &outstate); ++ if (written != -1) ++ { ++ p += written; ++ assert (p - buffer < buflen); ++ } ++ ++ i += used; ++ } ++ ++ *p = '\0'; ++ return buffer; ++} ++ ++/* + * 'main()' - Read events and send DBUS notifications. + */ + +@@ -366,7 +441,7 @@ main(int argc, /* I - Number of comm + attr = ippFindAttribute(msg, "notify-text", IPP_TAG_TEXT); + if (attr) + { +- const char *val = ippGetString(attr, 0, NULL); ++ const char *val = validate_utf8 (ippGetString(attr, 0, NULL)); + if (!dbus_message_iter_append_string(&iter, &val)) + goto bail; + } diff --git a/srcpkgs/cups/patches/cups-enum-all.patch b/srcpkgs/cups/patches/cups-enum-all.patch new file mode 100644 index 00000000000..0ac39835ea1 --- /dev/null +++ b/srcpkgs/cups/patches/cups-enum-all.patch @@ -0,0 +1,17 @@ +diff -up cups-1.6.2/cups/dest.c.enum-all cups-1.6.2/cups/dest.c +--- cups-1.6.2/cups/dest.c.enum-all 2013-06-04 10:58:36.169786250 +0100 ++++ cups-1.6.2/cups/dest.c 2013-06-04 10:59:02.147900811 +0100 +@@ -2724,9 +2724,12 @@ cups_dnssd_browse_cb( + break; + + case AVAHI_BROWSER_REMOVE: +- case AVAHI_BROWSER_ALL_FOR_NOW: + case AVAHI_BROWSER_CACHE_EXHAUSTED: + break; ++ ++ case AVAHI_BROWSER_ALL_FOR_NOW: ++ avahi_simple_poll_quit(data->simple_poll); ++ break; + } + } + diff --git a/srcpkgs/cups/patches/cups-res_init.patch b/srcpkgs/cups/patches/cups-res_init.patch new file mode 100644 index 00000000000..94a81a457fc --- /dev/null +++ b/srcpkgs/cups/patches/cups-res_init.patch @@ -0,0 +1,26 @@ +diff -up cups-1.6b1/cups/http-addr.c.res_init cups-1.6b1/cups/http-addr.c +--- cups-1.6b1/cups/http-addr.c.res_init 2012-05-17 00:57:03.000000000 +0200 ++++ cups-1.6b1/cups/http-addr.c 2012-05-25 15:51:51.323916352 +0200 +@@ -254,7 +254,8 @@ httpAddrLookup( + + if (error) + { +- if (error == EAI_FAIL) ++ if (error == EAI_FAIL || error == EAI_AGAIN || error == EAI_NODATA || ++ error == EAI_NONAME) + cg->need_res_init = 1; + + return (httpAddrString(addr, name, namelen)); +diff -up cups-1.6b1/cups/http-addrlist.c.res_init cups-1.6b1/cups/http-addrlist.c +--- cups-1.6b1/cups/http-addrlist.c.res_init 2012-04-23 19:26:57.000000000 +0200 ++++ cups-1.6b1/cups/http-addrlist.c 2012-05-25 16:05:05.930377452 +0200 +@@ -540,7 +540,8 @@ httpAddrGetList(const char *hostname, /* + } + else + { +- if (error == EAI_FAIL) ++ if (error == EAI_FAIL || error == EAI_AGAIN || error == EAI_NODATA || ++ error == EAI_NONAME) + cg->need_res_init = 1; + + _cupsSetError(IPP_INTERNAL_ERROR, gai_strerror(error), 0); diff --git a/srcpkgs/cups/patches/cupsd-no-crash-on-avahi-threaded-poll-shutdown.patch b/srcpkgs/cups/patches/cupsd-no-crash-on-avahi-threaded-poll-shutdown.patch new file mode 100644 index 00000000000..ee36936f80c --- /dev/null +++ b/srcpkgs/cups/patches/cupsd-no-crash-on-avahi-threaded-poll-shutdown.patch @@ -0,0 +1,19 @@ +Description: Fixed crash which sometimes happens on shutdown of the CUPS + daemon, caused by a wrong shutdown sequence for shutting down the Avahi + threaded poll. +Author: Till Kamppeter +Bug-Upstream: http://cups.org/str.php?L4180 +Bug-Upstream: http://cups.org/str.php?L4213 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1034045 +Last-Updated: 2012-10-16 + +--- a/scheduler/dirsvc.c ++++ b/scheduler/dirsvc.c +@@ -1333,6 +1333,7 @@ + DNSSDMaster = NULL; + + # else /* HAVE_AVAHI */ ++ avahi_threaded_poll_stop(DNSSDMaster); + avahi_client_free(DNSSDClient); + DNSSDClient = NULL; + diff --git a/srcpkgs/cups/template b/srcpkgs/cups/template index 03023d7a161..e30ac8a62bb 100644 --- a/srcpkgs/cups/template +++ b/srcpkgs/cups/template @@ -1,6 +1,6 @@ # Template file for 'cups' pkgname=cups -version=1.6.3 +version=1.6.4 revision=1 patch_args="-Np1" short_desc="Common Unix Printing System" @@ -8,7 +8,7 @@ maintainer="Juan RP " homepage="http://www.cups.org/" license="GPL-2" distfiles="http://www.cups.org/software/${version}/cups-${version}-source.tar.gz" -checksum=853ef93a60a82ad9288f9bc5c6c0bcd3b7d30b3df5bc6a8a0340d403955dcf3e +checksum=9452ab7720c0075627407ca13a2ecba4fc03f8bfae7d2cbb9e93f41785a8ad68 hostmakedepends="automake pkg-config poppler-utils" makedepends="acl-devel libjpeg-turbo-devel libpng-devel>=1.5.10 tiff-devel @@ -51,7 +51,6 @@ do_install() { # install some more configuration files that will get filled by cupsd for f in printers classes client subscriptions; do touch ${DESTDIR}/etc/cups/${f}.conf - chgrp lp ${DESTDIR}/etc/cups/${f}.conf done echo "# see 'man client.conf'" >> ${DESTDIR}/etc/cups/client.conf