New package: cups-1.5.3.
This commit is contained in:
parent
7b624aaf24
commit
b00319b688
47 changed files with 6418 additions and 0 deletions
|
@ -973,3 +973,9 @@ libutempter.so.0 libutempter libutempter-devel
|
|||
libxatracker.so.1 MesaLib MesaLib-devel
|
||||
libtumbler-1.so.0 tumbler tumbler-devel
|
||||
libwebrtc_audio_processing.so.0 webrtc-audio-processing webrtc-audio-processing-devel
|
||||
libcupsmime.so.1 libcups cups-devel
|
||||
libcupsppdc.so.1 libcups cups-devel
|
||||
libcupscgi.so.1 libcups cups-devel
|
||||
libcupsdriver.so.1 libcups cups-devel
|
||||
libcups.so.2 libcups cups-devel
|
||||
libcupsimage.so.2 libcups cups-devel
|
||||
|
|
1
srcpkgs/cups-devel
Symbolic link
1
srcpkgs/cups-devel
Symbolic link
|
@ -0,0 +1 @@
|
|||
cups
|
13
srcpkgs/cups/cups-devel.template
Normal file
13
srcpkgs/cups/cups-devel.template
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Template file for 'cups-devel'.
|
||||
#
|
||||
short_desc="${short_desc} -- development files"
|
||||
long_desc="${long_desc}
|
||||
|
||||
This package contains files for development, headers, static libs, etc."
|
||||
|
||||
Add_dependency run libcups ">=${version}"
|
||||
|
||||
do_install() {
|
||||
vmove usr/include usr
|
||||
vmove usr/bin/cups-config usr/bin
|
||||
}
|
22
srcpkgs/cups/cups.rshlibs
Normal file
22
srcpkgs/cups/cups.rshlibs
Normal file
|
@ -0,0 +1,22 @@
|
|||
libcupsimage.so.2
|
||||
libcups.so.2
|
||||
libpthread.so.0
|
||||
libc.so.6
|
||||
libm.so.6
|
||||
libcupsdriver.so.1
|
||||
libusb-1.0.so.0
|
||||
libcupscgi.so.1
|
||||
libdbus-1.so.3
|
||||
libcupsppdc.so.1
|
||||
libstdc++.so.6
|
||||
libgcc_s.so.1
|
||||
libcupsmime.so.1
|
||||
libssl.so.1
|
||||
libcrypto.so.1
|
||||
libpam.so.0
|
||||
libacl.so.1
|
||||
libgssapi_krb5.so.2
|
||||
libkrb5.so.3
|
||||
libavahi-common.so.3
|
||||
libavahi-client.so.3
|
||||
libsystemd-daemon.so.0
|
2
srcpkgs/cups/depends
Normal file
2
srcpkgs/cups/depends
Normal file
|
@ -0,0 +1,2 @@
|
|||
abi_depends=">=1.5.3"
|
||||
api_depends="${abi_depends}"
|
5
srcpkgs/cups/files/cups.logrotate
Normal file
5
srcpkgs/cups/files/cups.logrotate
Normal file
|
@ -0,0 +1,5 @@
|
|||
/var/log/cups/*_log {
|
||||
missingok
|
||||
notifempty
|
||||
sharedscripts
|
||||
}
|
3
srcpkgs/cups/files/cups.pam
Normal file
3
srcpkgs/cups/files/cups.pam
Normal file
|
@ -0,0 +1,3 @@
|
|||
auth required pam_unix.so
|
||||
account required pam_unix.so
|
||||
session required pam_unix.so
|
15
srcpkgs/cups/libcups.rshlibs
Normal file
15
srcpkgs/cups/libcups.rshlibs
Normal file
|
@ -0,0 +1,15 @@
|
|||
libgssapi_krb5.so.2
|
||||
libssl.so.1
|
||||
libcrypto.so.1
|
||||
libpthread.so.0
|
||||
libm.so.6
|
||||
libz.so.1
|
||||
libc.so.6
|
||||
libtiff.so.5
|
||||
libpng14.so.14
|
||||
libjpeg.so.8
|
||||
libcrypt.so.1
|
||||
libstdc++.so.6
|
||||
libgcc_s.so.1
|
||||
libavahi-common.so.3
|
||||
libavahi-client.so.3
|
10
srcpkgs/cups/libcups.template
Normal file
10
srcpkgs/cups/libcups.template
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Template file for 'libcups'.
|
||||
#
|
||||
short_desc="${short_desc} -- runtime shared libraries"
|
||||
long_desc="${long_desc}
|
||||
|
||||
This package contains the runtime shared libraries."
|
||||
|
||||
do_install() {
|
||||
vmove "usr/lib/*.so*" usr/lib
|
||||
}
|
33
srcpkgs/cups/patches/cups-0755.patch
Normal file
33
srcpkgs/cups/patches/cups-0755.patch
Normal file
|
@ -0,0 +1,33 @@
|
|||
diff -up cups-1.5.3/Makedefs.in.0755 cups-1.5.3/Makedefs.in
|
||||
--- cups-1.5.3/Makedefs.in.0755 2012-05-15 16:51:31.000000000 +0200
|
||||
+++ cups-1.5.3/Makedefs.in 2012-05-15 16:52:59.246906315 +0200
|
||||
@@ -41,14 +41,14 @@ SHELL = /bin/sh
|
||||
# Installation programs...
|
||||
#
|
||||
|
||||
-INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
|
||||
+INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@
|
||||
INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
|
||||
INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
|
||||
INSTALL_DATA = $(INSTALL) -c -m 444
|
||||
INSTALL_DIR = $(INSTALL) -d
|
||||
-INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
|
||||
+INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@
|
||||
INSTALL_MAN = $(INSTALL) -c -m 444
|
||||
-INSTALL_SCRIPT = $(INSTALL) -c -m 555
|
||||
+INSTALL_SCRIPT = $(INSTALL) -c -m 755
|
||||
|
||||
#
|
||||
# Default user, group, and system groups for the scheduler...
|
||||
diff -up cups-1.5.3/scheduler/Makefile.0755 cups-1.5.3/scheduler/Makefile
|
||||
--- cups-1.5.3/scheduler/Makefile.0755 2011-05-12 00:17:34.000000000 +0200
|
||||
+++ cups-1.5.3/scheduler/Makefile 2012-05-15 16:51:31.703516547 +0200
|
||||
@@ -213,7 +213,7 @@ install-data:
|
||||
install-exec:
|
||||
echo Installing programs in $(SBINDIR)...
|
||||
$(INSTALL_DIR) -m 755 $(SBINDIR)
|
||||
- $(INSTALL_BIN) -m 500 cupsd $(SBINDIR)
|
||||
+ $(INSTALL_BIN) -m 755 cupsd $(SBINDIR)
|
||||
$(INSTALL_BIN) cupsfilter $(SBINDIR)
|
||||
-if test "x`uname`" = xDarwin; then \
|
||||
$(INSTALL_DIR) $(BUILDROOT)/System/Library/Printers/Libraries; \
|
42
srcpkgs/cups/patches/cups-avahi-1-config.patch
Normal file
42
srcpkgs/cups/patches/cups-avahi-1-config.patch
Normal file
|
@ -0,0 +1,42 @@
|
|||
diff -up cups-1.5.2/config.h.in.avahi-1-config cups-1.5.2/config.h.in
|
||||
--- cups-1.5.2/config.h.in.avahi-1-config 2011-06-16 21:12:16.000000000 +0100
|
||||
+++ cups-1.5.2/config.h.in 2012-03-14 15:04:51.365347165 +0000
|
||||
@@ -390,6 +390,13 @@
|
||||
|
||||
|
||||
/*
|
||||
+ * Do we have Avahi for DNS Service Discovery?
|
||||
+ */
|
||||
+
|
||||
+#undef HAVE_AVAHI
|
||||
+
|
||||
+
|
||||
+/*
|
||||
* Do we have <sys/ioctl.h>?
|
||||
*/
|
||||
|
||||
diff -up cups-1.5.2/config-scripts/cups-dnssd.m4.avahi-1-config cups-1.5.2/config-scripts/cups-dnssd.m4
|
||||
--- cups-1.5.2/config-scripts/cups-dnssd.m4.avahi-1-config 2011-05-12 06:21:56.000000000 +0100
|
||||
+++ cups-1.5.2/config-scripts/cups-dnssd.m4 2012-03-14 15:04:51.365347165 +0000
|
||||
@@ -23,6 +23,21 @@ AC_ARG_WITH(dnssd-includes, [ --with-dn
|
||||
DNSSDLIBS=""
|
||||
DNSSD_BACKEND=""
|
||||
|
||||
+AC_ARG_ENABLE(avahi, [ --enable-avahi turn on DNS Service Discovery support, default=no],
|
||||
+ [if test x$enable_avahi = xyes; then
|
||||
+ AC_MSG_CHECKING(for Avahi)
|
||||
+ if $PKGCONFIG --exists avahi-client; then
|
||||
+ AC_MSG_RESULT(yes)
|
||||
+ CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`"
|
||||
+ DNSSDLIBS="`$PKGCONFIG --libs avahi-client`"
|
||||
+ DNSSD_BACKEND="dnssd"
|
||||
+ AC_DEFINE(HAVE_AVAHI)
|
||||
+ enable_dnssd=no
|
||||
+ else
|
||||
+ AC_MSG_RESULT(no)
|
||||
+ fi
|
||||
+ fi])
|
||||
+
|
||||
if test x$enable_dnssd != xno; then
|
||||
AC_CHECK_HEADER(dns_sd.h, [
|
||||
case "$uname" in
|
1118
srcpkgs/cups/patches/cups-avahi-2-backend.patch
Normal file
1118
srcpkgs/cups/patches/cups-avahi-2-backend.patch
Normal file
File diff suppressed because it is too large
Load diff
381
srcpkgs/cups/patches/cups-avahi-3-timeouts.patch
Normal file
381
srcpkgs/cups/patches/cups-avahi-3-timeouts.patch
Normal file
|
@ -0,0 +1,381 @@
|
|||
diff -up cups-1.5.2/scheduler/cupsd.h.avahi-3-timeouts cups-1.5.2/scheduler/cupsd.h
|
||||
--- cups-1.5.2/scheduler/cupsd.h.avahi-3-timeouts 2011-05-11 23:17:34.000000000 +0100
|
||||
+++ cups-1.5.2/scheduler/cupsd.h 2012-03-14 15:06:36.509476983 +0000
|
||||
@@ -140,6 +140,15 @@ extern const char *cups_hstrerror(int);
|
||||
|
||||
typedef void (*cupsd_selfunc_t)(void *data);
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+/*
|
||||
+ * Timeout callback function type...
|
||||
+ */
|
||||
+
|
||||
+typedef struct _cupsd_timeout_s cupsd_timeout_t;
|
||||
+typedef void (*cupsd_timeoutfunc_t)(cupsd_timeout_t *timeout, void *data);
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
|
||||
/*
|
||||
* Globals...
|
||||
@@ -173,6 +182,11 @@ VAR int Launchd VALUE(0);
|
||||
/* Running from launchd */
|
||||
#endif /* HAVE_LAUNCH_H */
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+VAR cups_array_t *Timeouts; /* Timed callbacks for main loop */
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
@@ -242,6 +256,20 @@ extern void cupsdStopSelect(void);
|
||||
extern void cupsdStartServer(void);
|
||||
extern void cupsdStopServer(void);
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+extern void cupsdInitTimeouts(void);
|
||||
+extern cupsd_timeout_t *cupsdAddTimeout (const struct timeval *tv,
|
||||
+ cupsd_timeoutfunc_t cb,
|
||||
+ void *data);
|
||||
+extern cupsd_timeout_t *cupsdNextTimeout (long *delay);
|
||||
+extern void cupsdRunTimeout (cupsd_timeout_t *timeout);
|
||||
+extern void cupsdUpdateTimeout (cupsd_timeout_t *timeout,
|
||||
+ const struct timeval *tv);
|
||||
+extern void cupsdRemoveTimeout (cupsd_timeout_t *timeout);
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+extern int cupsdRemoveFile(const char *filename);
|
||||
+
|
||||
|
||||
/*
|
||||
* End of "$Id: cupsd.h 9766 2011-05-11 22:17:34Z mike $".
|
||||
diff -up cups-1.5.2/scheduler/main.c.avahi-3-timeouts cups-1.5.2/scheduler/main.c
|
||||
--- cups-1.5.2/scheduler/main.c.avahi-3-timeouts 2012-03-14 15:04:17.655305548 +0000
|
||||
+++ cups-1.5.2/scheduler/main.c 2012-03-14 15:06:36.511476986 +0000
|
||||
@@ -146,6 +146,10 @@ main(int argc, /* I - Number of comm
|
||||
int launchd_idle_exit;
|
||||
/* Idle exit on select timeout? */
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
+#ifdef HAVE_AVAHI
|
||||
+ cupsd_timeout_t *tmo; /* Next scheduled timed callback */
|
||||
+ long tmo_delay; /* Time before it must be called */
|
||||
+#endif /* HAVE_AVAHI */
|
||||
|
||||
|
||||
#ifdef HAVE_GETEUID
|
||||
@@ -535,6 +539,14 @@ main(int argc, /* I - Number of comm
|
||||
|
||||
httpInitialize();
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+ /*
|
||||
+ * Initialize timed callback structures.
|
||||
+ */
|
||||
+
|
||||
+ cupsdInitTimeouts();
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
cupsdStartServer();
|
||||
|
||||
/*
|
||||
@@ -874,6 +886,16 @@ main(int argc, /* I - Number of comm
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+ /*
|
||||
+ * If a timed callback is due, run it.
|
||||
+ */
|
||||
+
|
||||
+ tmo = cupsdNextTimeout (&tmo_delay);
|
||||
+ if (tmo && tmo_delay == 0)
|
||||
+ cupsdRunTimeout (tmo);
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
#ifndef __APPLE__
|
||||
/*
|
||||
* Update the network interfaces once a minute...
|
||||
@@ -1787,6 +1809,10 @@ select_timeout(int fds) /* I - Number
|
||||
cupsd_job_t *job; /* Job information */
|
||||
cupsd_subscription_t *sub; /* Subscription information */
|
||||
const char *why; /* Debugging aid */
|
||||
+#ifdef HAVE_AVAHI
|
||||
+ cupsd_timeout_t *tmo; /* Timed callback */
|
||||
+ long tmo_delay; /* Seconds before calling it */
|
||||
+#endif /* HAVE_AVAHI */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1829,6 +1855,19 @@ select_timeout(int fds) /* I - Number
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+ /*
|
||||
+ * See if there are any scheduled timed callbacks to run.
|
||||
+ */
|
||||
+
|
||||
+ if ((tmo = cupsdNextTimeout(&tmo_delay)) != NULL &&
|
||||
+ (now + tmo_delay) < timeout)
|
||||
+ {
|
||||
+ timeout = tmo_delay;
|
||||
+ why = "run a timed callback";
|
||||
+ }
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
/*
|
||||
* Check whether we are accepting new connections...
|
||||
*/
|
||||
diff -up cups-1.5.2/scheduler/Makefile.avahi-3-timeouts cups-1.5.2/scheduler/Makefile
|
||||
--- cups-1.5.2/scheduler/Makefile.avahi-3-timeouts 2012-03-14 15:04:17.685305586 +0000
|
||||
+++ cups-1.5.2/scheduler/Makefile 2012-03-14 15:06:36.508476980 +0000
|
||||
@@ -39,7 +39,8 @@ CUPSDOBJS = \
|
||||
server.o \
|
||||
statbuf.o \
|
||||
subscriptions.o \
|
||||
- sysman.o
|
||||
+ sysman.o \
|
||||
+ timeout.o
|
||||
LIBOBJS = \
|
||||
filter.o \
|
||||
mime.o \
|
||||
diff -up cups-1.5.2/scheduler/timeout.c.avahi-3-timeouts cups-1.5.2/scheduler/timeout.c
|
||||
--- cups-1.5.2/scheduler/timeout.c.avahi-3-timeouts 2012-03-14 15:06:36.552477037 +0000
|
||||
+++ cups-1.5.2/scheduler/timeout.c 2012-03-14 15:06:36.552477037 +0000
|
||||
@@ -0,0 +1,235 @@
|
||||
+/*
|
||||
+ * "$Id$"
|
||||
+ *
|
||||
+ * Timeout functions for the Common UNIX Printing System (CUPS).
|
||||
+ *
|
||||
+ * Copyright (C) 2010, 2011 Red Hat, Inc.
|
||||
+ * Authors:
|
||||
+ * Tim Waugh <twaugh@redhat.com>
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions
|
||||
+ * are met:
|
||||
+ *
|
||||
+ * Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer.
|
||||
+ *
|
||||
+ * Redistributions in binary form must reproduce the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer in the
|
||||
+ * documentation and/or other materials provided with the distribution.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
+ * "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
|
||||
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS 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.
|
||||
+ *
|
||||
+ * Contents:
|
||||
+ *
|
||||
+ * cupsdInitTimeouts() - Initialise timeout structure.
|
||||
+ * cupsdAddTimeout() - Add a timed callback.
|
||||
+ * cupsdNextTimeout() - Find the next enabled timed callback.
|
||||
+ * cupsdUpdateTimeout() - Adjust the time of a timed callback or disable it.
|
||||
+ * cupsdRemoveTimeout() - Discard a timed callback.
|
||||
+ * compare_timeouts() - Compare timed callbacks for array sorting.
|
||||
+ */
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#ifdef HAVE_AVAHI /* Applies to entire file... */
|
||||
+
|
||||
+/*
|
||||
+ * Include necessary headers...
|
||||
+ */
|
||||
+
|
||||
+#include "cupsd.h"
|
||||
+
|
||||
+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
|
||||
+# include <malloc.h>
|
||||
+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */
|
||||
+
|
||||
+#ifdef HAVE_AVAHI
|
||||
+# include <avahi-common/timeval.h>
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+
|
||||
+struct _cupsd_timeout_s
|
||||
+{
|
||||
+ struct timeval when;
|
||||
+ int enabled;
|
||||
+ cupsd_timeoutfunc_t callback;
|
||||
+ void *data;
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * Local functions...
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * 'compare_timeouts()' - Compare timed callbacks for array sorting.
|
||||
+ */
|
||||
+
|
||||
+static int
|
||||
+compare_addrs (void *p0, void *p1)
|
||||
+{
|
||||
+ if (p0 == p1)
|
||||
+ return (0);
|
||||
+ if (p0 < p1)
|
||||
+ return (-1);
|
||||
+ return (1);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+compare_timeouts (cupsd_timeout_t *p0, cupsd_timeout_t *p1)
|
||||
+{
|
||||
+ int addrsdiff = compare_addrs (p0, p1);
|
||||
+ int tvdiff;
|
||||
+
|
||||
+ if (addrsdiff == 0)
|
||||
+ return (0);
|
||||
+
|
||||
+ if (!p0->enabled || !p1->enabled)
|
||||
+ {
|
||||
+ if (!p0->enabled && !p1->enabled)
|
||||
+ return (addrsdiff);
|
||||
+
|
||||
+ return (p0->enabled ? -1 : 1);
|
||||
+ }
|
||||
+
|
||||
+ tvdiff = avahi_timeval_compare (&p0->when, &p1->when);
|
||||
+ if (tvdiff != 0)
|
||||
+ return (tvdiff);
|
||||
+
|
||||
+ return (addrsdiff);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdInitTimeouts()' - Initialise timeout structures.
|
||||
+ */
|
||||
+
|
||||
+void
|
||||
+cupsdInitTimeouts(void)
|
||||
+{
|
||||
+ Timeouts = cupsArrayNew ((cups_array_func_t)compare_timeouts, NULL);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdAddTimeout()' - Add a timed callback.
|
||||
+ */
|
||||
+
|
||||
+cupsd_timeout_t * /* O - Timeout handle */
|
||||
+cupsdAddTimeout(const struct timeval *tv, /* I - Absolute time */
|
||||
+ cupsd_timeoutfunc_t cb, /* I - Callback function */
|
||||
+ void *data) /* I - User data */
|
||||
+{
|
||||
+ cupsd_timeout_t *timeout;
|
||||
+
|
||||
+ timeout = malloc (sizeof(cupsd_timeout_t));
|
||||
+ if (timeout != NULL)
|
||||
+ {
|
||||
+ timeout->enabled = (tv != NULL);
|
||||
+ if (tv)
|
||||
+ {
|
||||
+ timeout->when.tv_sec = tv->tv_sec;
|
||||
+ timeout->when.tv_usec = tv->tv_usec;
|
||||
+ }
|
||||
+
|
||||
+ timeout->callback = cb;
|
||||
+ timeout->data = data;
|
||||
+ cupsArrayAdd (Timeouts, timeout);
|
||||
+ }
|
||||
+
|
||||
+ return timeout;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdNextTimeout()' - Find the next enabled timed callback.
|
||||
+ */
|
||||
+
|
||||
+cupsd_timeout_t * /* O - Next enabled timeout or NULL */
|
||||
+cupsdNextTimeout(long *delay) /* O - Seconds before scheduled */
|
||||
+{
|
||||
+ cupsd_timeout_t *first = cupsArrayFirst (Timeouts);
|
||||
+ struct timeval curtime;
|
||||
+
|
||||
+ if (first && !first->enabled)
|
||||
+ first = NULL;
|
||||
+
|
||||
+ if (first && delay)
|
||||
+ {
|
||||
+ gettimeofday (&curtime, NULL);
|
||||
+ if (avahi_timeval_compare (&curtime, &first->when) > 0)
|
||||
+ {
|
||||
+ *delay = 0;
|
||||
+ } else {
|
||||
+ *delay = 1 + first->when.tv_sec - curtime.tv_sec;
|
||||
+ if (first->when.tv_usec < curtime.tv_usec)
|
||||
+ (*delay)--;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return (first);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdRunTimeout()' - Run a timed callback.
|
||||
+ */
|
||||
+
|
||||
+void
|
||||
+cupsdRunTimeout(cupsd_timeout_t *timeout) /* I - Timeout */
|
||||
+{
|
||||
+ if (!timeout)
|
||||
+ return;
|
||||
+ timeout->enabled = 0;
|
||||
+ if (!timeout->callback)
|
||||
+ return;
|
||||
+ timeout->callback (timeout, timeout->data);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdUpdateTimeout()' - Adjust the time of a timed callback or disable it.
|
||||
+ */
|
||||
+
|
||||
+void
|
||||
+cupsdUpdateTimeout(cupsd_timeout_t *timeout, /* I - Timeout */
|
||||
+ const struct timeval *tv) /* I - Absolute time or NULL */
|
||||
+{
|
||||
+ cupsArrayRemove (Timeouts, timeout);
|
||||
+ timeout->enabled = (tv != NULL);
|
||||
+ if (tv)
|
||||
+ {
|
||||
+ timeout->when.tv_sec = tv->tv_sec;
|
||||
+ timeout->when.tv_usec = tv->tv_usec;
|
||||
+ }
|
||||
+ cupsArrayAdd (Timeouts, timeout);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdRemoveTimeout()' - Discard a timed callback.
|
||||
+ */
|
||||
+
|
||||
+void
|
||||
+cupsdRemoveTimeout(cupsd_timeout_t *timeout) /* I - Timeout */
|
||||
+{
|
||||
+ cupsArrayRemove (Timeouts, timeout);
|
||||
+ free (timeout);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+#endif /* HAVE_AVAHI ... from top of file */
|
||||
+
|
||||
+/*
|
||||
+ * End of "$Id$".
|
||||
+ */
|
529
srcpkgs/cups/patches/cups-avahi-4-poll.patch
Normal file
529
srcpkgs/cups/patches/cups-avahi-4-poll.patch
Normal file
|
@ -0,0 +1,529 @@
|
|||
diff -up cups-1.5.2/scheduler/avahi.c.avahi-4-poll cups-1.5.2/scheduler/avahi.c
|
||||
--- cups-1.5.2/scheduler/avahi.c.avahi-4-poll 2012-03-14 15:07:29.477542381 +0000
|
||||
+++ cups-1.5.2/scheduler/avahi.c 2012-03-14 15:07:29.477542381 +0000
|
||||
@@ -0,0 +1,441 @@
|
||||
+/*
|
||||
+ * "$Id$"
|
||||
+ *
|
||||
+ * Avahi poll implementation for the CUPS scheduler.
|
||||
+ *
|
||||
+ * Copyright (C) 2010, 2011 Red Hat, Inc.
|
||||
+ * Authors:
|
||||
+ * Tim Waugh <twaugh@redhat.com>
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions
|
||||
+ * are met:
|
||||
+ *
|
||||
+ * Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer.
|
||||
+ *
|
||||
+ * Redistributions in binary form must reproduce the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer in the
|
||||
+ * documentation and/or other materials provided with the distribution.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
+ * "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
|
||||
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS 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.
|
||||
+ *
|
||||
+ * Contents:
|
||||
+ *
|
||||
+ * watch_read_cb - Read callback for file descriptor
|
||||
+ * watch_write_cb - Write callback for file descriptor
|
||||
+ * watched_fd_add_select() - Call cupsdAddSelect() as needed
|
||||
+ * watch_new() - Create a new file descriptor watch
|
||||
+ * watch_free() - Free a file descriptor watch
|
||||
+ * watch_update() - Update watched events for a file descriptor
|
||||
+ * watch_get_events() - Get events that happened for a file descriptor
|
||||
+ * timeout_cb() - Run a timed Avahi callback
|
||||
+ * timeout_new() - Set a wakeup time
|
||||
+ * timeout_update() - Update the expiration time for a timeout
|
||||
+ * timeout_free() - Free a timeout
|
||||
+ * compare_watched_fds() - Compare watched file descriptors for array sorting
|
||||
+ * avahi_cups_poll_new() - Create a new Avahi main loop object for CUPS
|
||||
+ * avahi_cups_poll_free() - Free an Avahi main loop object for CUPS
|
||||
+ * avahi_cups_poll_get() - Get the abstract poll API structure
|
||||
+ */
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#ifdef HAVE_AVAHI /* Applies to entire file... */
|
||||
+
|
||||
+/*
|
||||
+ * Include necessary headers...
|
||||
+ */
|
||||
+
|
||||
+#include "cupsd.h"
|
||||
+
|
||||
+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
|
||||
+# include <malloc.h>
|
||||
+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */
|
||||
+
|
||||
+#ifdef HAVE_AVAHI
|
||||
+# include <avahi-common/timeval.h>
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+
|
||||
+typedef struct
|
||||
+{
|
||||
+ AvahiCupsPoll *cups_poll;
|
||||
+
|
||||
+ int fd;
|
||||
+ AvahiWatchEvent occurred;
|
||||
+ cups_array_t *watches;
|
||||
+} cupsd_watched_fd_t;
|
||||
+
|
||||
+struct AvahiWatch
|
||||
+{
|
||||
+ cupsd_watched_fd_t *watched_fd;
|
||||
+
|
||||
+ AvahiWatchEvent events;
|
||||
+ AvahiWatchCallback callback;
|
||||
+ void *userdata;
|
||||
+};
|
||||
+
|
||||
+struct AvahiTimeout
|
||||
+{
|
||||
+ AvahiCupsPoll *cups_poll;
|
||||
+ AvahiTimeoutCallback callback;
|
||||
+ void *userdata;
|
||||
+ cupsd_timeout_t *cupsd_timeout;
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * Local functions...
|
||||
+ */
|
||||
+
|
||||
+static AvahiWatch * watch_new(const AvahiPoll *api,
|
||||
+ int fd,
|
||||
+ AvahiWatchEvent events,
|
||||
+ AvahiWatchCallback callback,
|
||||
+ void *userdata);
|
||||
+static void watch_free(AvahiWatch *watch);
|
||||
+static void watch_update(AvahiWatch *watch,
|
||||
+ AvahiWatchEvent events);
|
||||
+static AvahiWatchEvent watch_get_events(AvahiWatch *watch);
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_read_cb' - Read callback for file descriptor
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+watch_read_cb (void *userdata)
|
||||
+{
|
||||
+ AvahiWatch *watch;
|
||||
+ cupsd_watched_fd_t *watched_fd = userdata;
|
||||
+ watched_fd->occurred |= AVAHI_WATCH_IN;
|
||||
+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches);
|
||||
+ watch;
|
||||
+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches))
|
||||
+ {
|
||||
+ if (watch->events & watched_fd->occurred)
|
||||
+ {
|
||||
+ (watch->callback) (watch, watched_fd->fd,
|
||||
+ AVAHI_WATCH_IN, watch->userdata);
|
||||
+ watched_fd->occurred &= ~AVAHI_WATCH_IN;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_write_cb' - Write callback for file descriptor
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+watch_write_cb (void *userdata)
|
||||
+{
|
||||
+ AvahiWatch *watch;
|
||||
+ cupsd_watched_fd_t *watched_fd = userdata;
|
||||
+ watched_fd->occurred |= AVAHI_WATCH_OUT;
|
||||
+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches);
|
||||
+ watch;
|
||||
+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches))
|
||||
+ {
|
||||
+ if (watch->events & watched_fd->occurred)
|
||||
+ {
|
||||
+ (watch->callback) (watch, watched_fd->fd,
|
||||
+ AVAHI_WATCH_OUT, watch->userdata);
|
||||
+ watched_fd->occurred &= ~AVAHI_WATCH_OUT;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watched_fd_add_select' - Call cupsdAddSelect() as needed
|
||||
+ */
|
||||
+
|
||||
+static int /* O - Watches? */
|
||||
+watched_fd_add_select (cupsd_watched_fd_t *watched_fd)
|
||||
+{
|
||||
+ AvahiWatch *watch;
|
||||
+ cupsd_selfunc_t read_cb = NULL, write_cb = NULL;
|
||||
+ int any_watches = 0;
|
||||
+
|
||||
+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches);
|
||||
+ watch;
|
||||
+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches))
|
||||
+ {
|
||||
+ any_watches = 1;
|
||||
+ if (watch->events & (AVAHI_WATCH_IN |
|
||||
+ AVAHI_WATCH_ERR |
|
||||
+ AVAHI_WATCH_HUP))
|
||||
+ {
|
||||
+ read_cb = (cupsd_selfunc_t)watch_read_cb;
|
||||
+ if (write_cb != NULL)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (watch->events & AVAHI_WATCH_OUT)
|
||||
+ {
|
||||
+ write_cb = (cupsd_selfunc_t)watch_write_cb;
|
||||
+ if (read_cb != NULL)
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (read_cb || write_cb)
|
||||
+ cupsdAddSelect (watched_fd->fd, read_cb, write_cb, watched_fd);
|
||||
+ else
|
||||
+ cupsdRemoveSelect (watched_fd->fd);
|
||||
+
|
||||
+ return (any_watches);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_new' - Create a new file descriptor watch
|
||||
+ */
|
||||
+
|
||||
+static AvahiWatch *
|
||||
+watch_new (const AvahiPoll *api,
|
||||
+ int fd,
|
||||
+ AvahiWatchEvent events,
|
||||
+ AvahiWatchCallback callback,
|
||||
+ void *userdata)
|
||||
+{
|
||||
+ cupsd_watched_fd_t key, *watched_fd;
|
||||
+ AvahiCupsPoll *cups_poll = api->userdata;
|
||||
+ AvahiWatch *watch = malloc(sizeof(AvahiWatch));
|
||||
+ if (watch == NULL)
|
||||
+ return (NULL);
|
||||
+
|
||||
+ watch->events = events;
|
||||
+ watch->callback = callback;
|
||||
+ watch->userdata = userdata;
|
||||
+
|
||||
+ key.fd = fd;
|
||||
+ watched_fd = cupsArrayFind (cups_poll->watched_fds, &key);
|
||||
+ if (watched_fd == NULL)
|
||||
+ {
|
||||
+ watched_fd = malloc(sizeof(cupsd_watched_fd_t));
|
||||
+ if (watched_fd == NULL)
|
||||
+ {
|
||||
+ free (watch);
|
||||
+ return (NULL);
|
||||
+ }
|
||||
+
|
||||
+ watched_fd->fd = fd;
|
||||
+ watched_fd->occurred = 0;
|
||||
+ watched_fd->cups_poll = cups_poll;
|
||||
+ watched_fd->watches = cupsArrayNew (NULL, NULL);
|
||||
+ cupsArrayAdd (cups_poll->watched_fds, watched_fd);
|
||||
+ }
|
||||
+
|
||||
+ watch->watched_fd = watched_fd;
|
||||
+ cupsArrayAdd(watched_fd->watches, watch);
|
||||
+ watched_fd_add_select (watched_fd);
|
||||
+ return (watch);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_free' - Free a file descriptor watch
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+watch_free (AvahiWatch *watch)
|
||||
+{
|
||||
+ cupsd_watched_fd_t *watched_fd = watch->watched_fd;
|
||||
+ AvahiCupsPoll *cups_poll = watched_fd->cups_poll;
|
||||
+
|
||||
+ cupsArrayRemove (watched_fd->watches, watch);
|
||||
+ free (watch);
|
||||
+
|
||||
+ if (!watched_fd_add_select (watched_fd))
|
||||
+ {
|
||||
+ /* No more watches */
|
||||
+ cupsArrayRemove (cups_poll->watched_fds, watched_fd);
|
||||
+ free (watched_fd);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_update' - Update watched events for a file descriptor
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+watch_update (AvahiWatch *watch,
|
||||
+ AvahiWatchEvent events)
|
||||
+{
|
||||
+ watch->events = events;
|
||||
+ watched_fd_add_select (watch->watched_fd);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_get_events' - Get events that happened for a file descriptor
|
||||
+ */
|
||||
+
|
||||
+static AvahiWatchEvent
|
||||
+watch_get_events (AvahiWatch *watch)
|
||||
+{
|
||||
+ return (watch->watched_fd->occurred);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'timeout_cb()' - Run a timed Avahi callback
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+timeout_cb (cupsd_timeout_t *cupsd_timeout, void *userdata)
|
||||
+{
|
||||
+ AvahiTimeout *timeout = userdata;
|
||||
+ (timeout->callback) (timeout, timeout->userdata);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'timeout_new' - Set a wakeup time
|
||||
+ */
|
||||
+
|
||||
+static AvahiTimeout *
|
||||
+timeout_new (const AvahiPoll *api,
|
||||
+ const struct timeval *tv,
|
||||
+ AvahiTimeoutCallback callback,
|
||||
+ void *userdata)
|
||||
+{
|
||||
+ AvahiTimeout *timeout;
|
||||
+ AvahiCupsPoll *cups_poll = api->userdata;
|
||||
+
|
||||
+ timeout = malloc(sizeof(AvahiTimeout));
|
||||
+ if (timeout == NULL)
|
||||
+ return (NULL);
|
||||
+
|
||||
+ timeout->cups_poll = cups_poll;
|
||||
+ timeout->callback = callback;
|
||||
+ timeout->userdata = userdata;
|
||||
+ timeout->cupsd_timeout = cupsdAddTimeout (tv,
|
||||
+ (cupsd_timeoutfunc_t)timeout_cb,
|
||||
+ timeout);
|
||||
+ cupsArrayAdd (cups_poll->timeouts, timeout);
|
||||
+ return (timeout);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'timeout_update' - Update the expiration time for a timeout
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+timeout_update (AvahiTimeout *timeout,
|
||||
+ const struct timeval *tv)
|
||||
+{
|
||||
+ cupsdUpdateTimeout (timeout->cupsd_timeout, tv);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * ' timeout_free' - Free a timeout
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+timeout_free (AvahiTimeout *timeout)
|
||||
+{
|
||||
+ cupsArrayRemove (timeout->cups_poll->timeouts, timeout);
|
||||
+ cupsdRemoveTimeout (timeout->cupsd_timeout);
|
||||
+ free (timeout);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'compare_watched_fds' - Compare watched file descriptors for array sorting
|
||||
+ */
|
||||
+static int
|
||||
+compare_watched_fds(cupsd_watched_fd_t *p0,
|
||||
+ cupsd_watched_fd_t *p1)
|
||||
+{
|
||||
+ /*
|
||||
+ * Compare by fd (no two elements have the same fd)
|
||||
+ */
|
||||
+
|
||||
+ if (p0->fd == p1->fd)
|
||||
+ return 0;
|
||||
+
|
||||
+ return (p0->fd < p1->fd ? -1 : 1);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'avahi_cups_poll_new' - Create a new Avahi main loop object for CUPS
|
||||
+ */
|
||||
+
|
||||
+AvahiCupsPoll *
|
||||
+avahi_cups_poll_new (void)
|
||||
+{
|
||||
+ AvahiCupsPoll *cups_poll = malloc(sizeof(AvahiCupsPoll));
|
||||
+ if (cups_poll == NULL)
|
||||
+ return (NULL);
|
||||
+
|
||||
+ cups_poll->watched_fds = cupsArrayNew ((cups_array_func_t)compare_watched_fds,
|
||||
+ NULL);
|
||||
+ cups_poll->timeouts = cupsArrayNew (NULL, NULL);
|
||||
+
|
||||
+ cups_poll->api.userdata = cups_poll;
|
||||
+ cups_poll->api.watch_new = watch_new;
|
||||
+ cups_poll->api.watch_free = watch_free;
|
||||
+ cups_poll->api.watch_update = watch_update;
|
||||
+ cups_poll->api.watch_get_events = watch_get_events;
|
||||
+
|
||||
+ cups_poll->api.timeout_new = timeout_new;
|
||||
+ cups_poll->api.timeout_update = timeout_update;
|
||||
+ cups_poll->api.timeout_free = timeout_free;
|
||||
+
|
||||
+ return (cups_poll);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'avahi_cups_poll_free' - Free an Avahi main loop object for CUPS
|
||||
+ */
|
||||
+void
|
||||
+avahi_cups_poll_free (AvahiCupsPoll *cups_poll)
|
||||
+{
|
||||
+ cupsd_watched_fd_t *watched_fd;
|
||||
+
|
||||
+ for (watched_fd = (cupsd_watched_fd_t*)cupsArrayFirst(cups_poll->watched_fds);
|
||||
+ watched_fd;
|
||||
+ watched_fd = (cupsd_watched_fd_t*)cupsArrayNext(cups_poll->watched_fds))
|
||||
+ cupsArrayClear (watched_fd->watches);
|
||||
+
|
||||
+ cupsArrayClear (cups_poll->watched_fds);
|
||||
+ cupsArrayClear (cups_poll->timeouts);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'avahi_cups_poll_get' - Get the abstract poll API structure
|
||||
+ */
|
||||
+
|
||||
+const AvahiPoll *
|
||||
+avahi_cups_poll_get (AvahiCupsPoll *cups_poll)
|
||||
+{
|
||||
+ return (&cups_poll->api);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+#endif /* HAVE_AVAHI ... from top of file */
|
||||
+
|
||||
+/*
|
||||
+ * End of "$Id$".
|
||||
+ */
|
||||
diff -up cups-1.5.2/scheduler/avahi.h.avahi-4-poll cups-1.5.2/scheduler/avahi.h
|
||||
--- cups-1.5.2/scheduler/avahi.h.avahi-4-poll 2012-03-14 15:07:29.477542381 +0000
|
||||
+++ cups-1.5.2/scheduler/avahi.h 2012-03-14 15:07:29.477542381 +0000
|
||||
@@ -0,0 +1,69 @@
|
||||
+/*
|
||||
+ * "$Id$"
|
||||
+ *
|
||||
+ * Avahi poll implementation for the CUPS scheduler.
|
||||
+ *
|
||||
+ * Copyright (C) 2010, 2011 Red Hat, Inc.
|
||||
+ * Authors:
|
||||
+ * Tim Waugh <twaugh@redhat.com>
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions
|
||||
+ * are met:
|
||||
+ *
|
||||
+ * Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer.
|
||||
+ *
|
||||
+ * Redistributions in binary form must reproduce the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer in the
|
||||
+ * documentation and/or other materials provided with the distribution.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
+ * "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
|
||||
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS 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.
|
||||
+ */
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#ifdef HAVE_AVAHI
|
||||
+# include <avahi-client/client.h>
|
||||
+# include <avahi-client/publish.h>
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+#ifdef HAVE_AUTHORIZATION_H
|
||||
+# include <Security/Authorization.h>
|
||||
+#endif /* HAVE_AUTHORIZATION_H */
|
||||
+
|
||||
+
|
||||
+#ifdef HAVE_AVAHI
|
||||
+typedef struct
|
||||
+{
|
||||
+ AvahiPoll api;
|
||||
+ cups_array_t *watched_fds;
|
||||
+ cups_array_t *timeouts;
|
||||
+} AvahiCupsPoll;
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+/*
|
||||
+ * Prototypes...
|
||||
+ */
|
||||
+
|
||||
+#ifdef HAVE_AVAHI
|
||||
+extern AvahiCupsPoll * avahi_cups_poll_new(void);
|
||||
+extern void avahi_cups_poll_free(AvahiCupsPoll *cups_poll);
|
||||
+extern const AvahiPoll *avahi_cups_poll_get(AvahiCupsPoll *cups_poll);
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * End of "$Id$".
|
||||
+ */
|
||||
diff -up cups-1.5.2/scheduler/Makefile.avahi-4-poll cups-1.5.2/scheduler/Makefile
|
||||
--- cups-1.5.2/scheduler/Makefile.avahi-4-poll 2012-03-14 15:06:36.508476980 +0000
|
||||
+++ cups-1.5.2/scheduler/Makefile 2012-03-14 15:07:29.476542380 +0000
|
||||
@@ -17,6 +17,7 @@ include ../Makedefs
|
||||
|
||||
CUPSDOBJS = \
|
||||
auth.o \
|
||||
+ avahi.o \
|
||||
banners.o \
|
||||
cert.o \
|
||||
classes.o \
|
1272
srcpkgs/cups/patches/cups-avahi-5-services.patch
Normal file
1272
srcpkgs/cups/patches/cups-avahi-5-services.patch
Normal file
File diff suppressed because it is too large
Load diff
12
srcpkgs/cups/patches/cups-banners.patch
Normal file
12
srcpkgs/cups/patches/cups-banners.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
diff -up cups-1.5b1/scheduler/banners.c.banners cups-1.5b1/scheduler/banners.c
|
||||
--- cups-1.5b1/scheduler/banners.c.banners 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/banners.c 2011-05-23 17:35:30.000000000 +0200
|
||||
@@ -110,6 +110,8 @@ cupsdLoadBanners(const char *d) /* I -
|
||||
if ((ext = strrchr(dent->filename, '.')) != NULL)
|
||||
if (!strcmp(ext, ".bck") ||
|
||||
!strcmp(ext, ".bak") ||
|
||||
+ !strcmp(ext, ".rpmnew") ||
|
||||
+ !strcmp(ext, ".rpmsave") ||
|
||||
!strcmp(ext, ".sav"))
|
||||
continue;
|
||||
|
42
srcpkgs/cups/patches/cups-build.patch
Normal file
42
srcpkgs/cups/patches/cups-build.patch
Normal file
|
@ -0,0 +1,42 @@
|
|||
diff -up cups-1.5b1/Makedefs.in.build cups-1.5b1/Makedefs.in
|
||||
--- cups-1.5b1/Makedefs.in.build 2011-05-04 06:28:00.000000000 +0200
|
||||
+++ cups-1.5b1/Makedefs.in 2011-05-24 15:54:03.000000000 +0200
|
||||
@@ -138,7 +138,7 @@ BACKLIBS = @BACKLIBS@
|
||||
BANNERTOPS = @BANNERTOPS@
|
||||
BUILDDIRS = @BUILDDIRS@
|
||||
CFLAGS = @CPPFLAGS@ @CFLAGS@
|
||||
-COMMONLIBS = @LIBS@
|
||||
+COMMONLIBS = @LIBS@ $(DNSSDLIBS)
|
||||
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@
|
||||
CXXLIBS = @CXXLIBS@
|
||||
DBUS_NOTIFIER = @DBUS_NOTIFIER@
|
||||
diff -up cups-1.5b1/scheduler/dirsvc.c.build cups-1.5b1/scheduler/dirsvc.c
|
||||
--- cups-1.5b1/scheduler/dirsvc.c.build 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/dirsvc.c 2011-05-24 15:55:26.000000000 +0200
|
||||
@@ -2047,7 +2047,7 @@ cupsdUpdateDNSSDName(void)
|
||||
|
||||
WebIFRef = DNSSDRef;
|
||||
if ((error = DNSServiceRegister(&WebIFRef,
|
||||
- kDNSServiceFlagsShareConnection,
|
||||
+ 0,
|
||||
0, webif, "_http._tcp", NULL,
|
||||
NULL, htons(DNSSDPort), 7,
|
||||
"\006path=/", dnssdRegisterCallback,
|
||||
@@ -2769,7 +2769,7 @@ dnssdRegisterPrinter(cupsd_printer_t *p)
|
||||
do
|
||||
{
|
||||
p->ipp_ref = DNSSDRef;
|
||||
- if ((se = DNSServiceRegister(&p->ipp_ref, kDNSServiceFlagsShareConnection,
|
||||
+ if ((se = DNSServiceRegister(&p->ipp_ref, 0,
|
||||
0, name, regtype, NULL, NULL,
|
||||
htons(DNSSDPort), ipp_len, ipp_txt,
|
||||
dnssdRegisterCallback,
|
||||
@@ -2866,7 +2866,7 @@ dnssdRegisterPrinter(cupsd_printer_t *p)
|
||||
|
||||
p->printer_ref = DNSSDRef;
|
||||
if ((se = DNSServiceRegister(&p->printer_ref,
|
||||
- kDNSServiceFlagsShareConnection,
|
||||
+ 0,
|
||||
0, name, "_printer._tcp", NULL, NULL,
|
||||
htons(printer_port), printer_len, printer_txt,
|
||||
dnssdRegisterCallback,
|
89
srcpkgs/cups/patches/cups-cups-get-classes.patch
Normal file
89
srcpkgs/cups/patches/cups-cups-get-classes.patch
Normal file
|
@ -0,0 +1,89 @@
|
|||
diff -up cups-1.5.0/cups/dest.c.cups-get-classes cups-1.5.0/cups/dest.c
|
||||
--- cups-1.5.0/cups/dest.c.cups-get-classes 2011-05-20 04:49:49.000000000 +0100
|
||||
+++ cups-1.5.0/cups/dest.c 2011-09-14 12:10:05.111635428 +0100
|
||||
@@ -534,6 +534,7 @@ _cupsGetDests(http_t *http, /* I -
|
||||
char uri[1024]; /* printer-uri value */
|
||||
int num_options; /* Number of options */
|
||||
cups_option_t *options; /* Options */
|
||||
+ int get_classes; /* Whether we need to fetch class */
|
||||
#ifdef __APPLE__
|
||||
char media_default[41]; /* Default paper size */
|
||||
#endif /* __APPLE__ */
|
||||
@@ -590,6 +591,8 @@ _cupsGetDests(http_t *http, /* I -
|
||||
* printer-uri [for IPP_GET_PRINTER_ATTRIBUTES]
|
||||
*/
|
||||
|
||||
+ get_classes = (op == CUPS_GET_PRINTERS);
|
||||
+
|
||||
request = ippNewRequest(op);
|
||||
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
@@ -647,6 +650,23 @@ _cupsGetDests(http_t *http, /* I -
|
||||
attr->value_tag != IPP_TAG_URI)
|
||||
continue;
|
||||
|
||||
+ if (get_classes &&
|
||||
+
|
||||
+ /* Is this a class? */
|
||||
+ ((attr->value_tag == IPP_TAG_ENUM &&
|
||||
+ !strcmp(attr->name, "printer-type") &&
|
||||
+ (attr->values[0].integer & CUPS_PRINTER_CLASS)) ||
|
||||
+
|
||||
+ /* Or, is this an attribute from CUPS 1.2 or later? */
|
||||
+ !strcmp(attr->name, "auth-info-required") ||
|
||||
+ !strncmp(attr->name, "marker-", 7) ||
|
||||
+ !strcmp(attr->name, "printer-commands") ||
|
||||
+ !strcmp(attr->name, "printer-is-shared")))
|
||||
+ /* We are talking to a recent enough CUPS server that
|
||||
+ * CUPS_GET_PRINTERS returns classes as well.
|
||||
+ */
|
||||
+ get_classes = 0;
|
||||
+
|
||||
if (!strcmp(attr->name, "auth-info-required") ||
|
||||
!strcmp(attr->name, "device-uri") ||
|
||||
!strcmp(attr->name, "marker-change-time") ||
|
||||
@@ -738,6 +758,28 @@ _cupsGetDests(http_t *http, /* I -
|
||||
continue;
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * If we sent a CUPS_GET_CLASSES request, check whether
|
||||
+ * CUPS_GET_PRINTERS already gave us this destination and exit
|
||||
+ * early if so.
|
||||
+ */
|
||||
+
|
||||
+ if (op == CUPS_GET_CLASSES && num_dests > 0)
|
||||
+ {
|
||||
+ int diff;
|
||||
+ cups_find_dest (printer_name, NULL, num_dests, *dests, 0, &diff);
|
||||
+ if (diff == 0)
|
||||
+ {
|
||||
+ /*
|
||||
+ * Found it. The CUPS server already gave us the classes in
|
||||
+ * its CUPS_GET_PRINTERS response.
|
||||
+ */
|
||||
+
|
||||
+ cupsFreeOptions(num_options, options);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if ((dest = cups_add_dest(printer_name, NULL, &num_dests, dests)) != NULL)
|
||||
{
|
||||
dest->num_options = num_options;
|
||||
@@ -754,6 +796,15 @@ _cupsGetDests(http_t *http, /* I -
|
||||
}
|
||||
|
||||
/*
|
||||
+ * If this is a CUPS_GET_PRINTERS request but we didn't see any
|
||||
+ * classes we might be talking to an older CUPS server that requires
|
||||
+ * CUPS_GET_CLASSES as well.
|
||||
+ */
|
||||
+
|
||||
+ if (get_classes)
|
||||
+ num_dests = _cupsGetDests (http, CUPS_GET_CLASSES, name, dests);
|
||||
+
|
||||
+ /*
|
||||
* Return the count...
|
||||
*/
|
||||
|
27
srcpkgs/cups/patches/cups-direct-usb.patch
Normal file
27
srcpkgs/cups/patches/cups-direct-usb.patch
Normal file
|
@ -0,0 +1,27 @@
|
|||
diff -up cups-1.5b1/backend/usb-unix.c.direct-usb cups-1.5b1/backend/usb-unix.c
|
||||
--- cups-1.5b1/backend/usb-unix.c.direct-usb 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/backend/usb-unix.c 2011-05-23 17:52:14.000000000 +0200
|
||||
@@ -102,6 +102,9 @@ print_device(const char *uri, /* I - De
|
||||
_cups_strncasecmp(hostname, "Minolta", 7);
|
||||
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
|
||||
|
||||
+ if (use_bc && !strncmp(uri, "usb:/dev/", 9))
|
||||
+ use_bc = 0;
|
||||
+
|
||||
if ((device_fd = open_device(uri, &use_bc)) == -1)
|
||||
{
|
||||
if (getenv("CLASS") != NULL)
|
||||
@@ -331,12 +334,7 @@ open_device(const char *uri, /* I - Dev
|
||||
if (!strncmp(uri, "usb:/dev/", 9))
|
||||
#ifdef __linux
|
||||
{
|
||||
- /*
|
||||
- * Do not allow direct devices anymore...
|
||||
- */
|
||||
-
|
||||
- errno = ENODEV;
|
||||
- return (-1);
|
||||
+ return (open(uri + 4, O_RDWR | O_EXCL));
|
||||
}
|
||||
else if (!strncmp(uri, "usb://", 6))
|
||||
{
|
38
srcpkgs/cups/patches/cups-dnssd-deviceid.patch
Normal file
38
srcpkgs/cups/patches/cups-dnssd-deviceid.patch
Normal file
|
@ -0,0 +1,38 @@
|
|||
diff -up cups-1.5b1/backend/dnssd.c.dnssd-deviceid cups-1.5b1/backend/dnssd.c
|
||||
--- cups-1.5b1/backend/dnssd.c.dnssd-deviceid 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/backend/dnssd.c 2011-05-24 17:28:18.000000000 +0200
|
||||
@@ -817,15 +817,22 @@ query_callback(
|
||||
if (device->device_id)
|
||||
free(device->device_id);
|
||||
|
||||
+ if (device_id[0])
|
||||
+ {
|
||||
+ /* Mark this as the real device ID. */
|
||||
+ ptr = device_id + strlen(device_id);
|
||||
+ snprintf(ptr, sizeof(device_id) - (ptr - device_id), "FZY:0;");
|
||||
+ }
|
||||
+
|
||||
if (!device_id[0] && strcmp(model, "Unknown"))
|
||||
{
|
||||
if (make_and_model[0])
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;",
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;",
|
||||
make_and_model, model);
|
||||
else if (!_cups_strncasecmp(model, "designjet ", 10))
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s", model + 10);
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s;FZY:1;", model + 10);
|
||||
else if (!_cups_strncasecmp(model, "stylus ", 7))
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s", model + 7);
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s;FZY:1;", model + 7);
|
||||
else if ((ptr = strchr(model, ' ')) != NULL)
|
||||
{
|
||||
/*
|
||||
@@ -835,7 +842,7 @@ query_callback(
|
||||
memcpy(make_and_model, model, ptr - model);
|
||||
make_and_model[ptr - model] = '\0';
|
||||
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s",
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;",
|
||||
make_and_model, ptr + 1);
|
||||
}
|
||||
}
|
21
srcpkgs/cups/patches/cups-driverd-timeout.patch
Normal file
21
srcpkgs/cups/patches/cups-driverd-timeout.patch
Normal file
|
@ -0,0 +1,21 @@
|
|||
diff -up cups-1.5.0/scheduler/ipp.c.driverd-timeout cups-1.5.0/scheduler/ipp.c
|
||||
--- cups-1.5.0/scheduler/ipp.c.driverd-timeout 2011-10-10 17:03:41.801690962 +0100
|
||||
+++ cups-1.5.0/scheduler/ipp.c 2011-10-10 17:03:41.861689834 +0100
|
||||
@@ -5723,7 +5723,7 @@ copy_model(cupsd_client_t *con, /* I -
|
||||
close(temppipe[1]);
|
||||
|
||||
/*
|
||||
- * Wait up to 30 seconds for the PPD file to be copied...
|
||||
+ * Wait up to 70 seconds for the PPD file to be copied...
|
||||
*/
|
||||
|
||||
total = 0;
|
||||
@@ -5743,7 +5743,7 @@ copy_model(cupsd_client_t *con, /* I -
|
||||
FD_SET(temppipe[0], &input);
|
||||
FD_SET(CGIPipes[0], &input);
|
||||
|
||||
- timeout.tv_sec = 30;
|
||||
+ timeout.tv_sec = 70;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
if ((i = select(maxfd, &input, NULL, NULL, &timeout)) < 0)
|
130
srcpkgs/cups/patches/cups-eggcups.patch
Normal file
130
srcpkgs/cups/patches/cups-eggcups.patch
Normal file
|
@ -0,0 +1,130 @@
|
|||
diff -up cups-1.5.3/backend/ipp.c.eggcups cups-1.5.3/backend/ipp.c
|
||||
--- cups-1.5.3/backend/ipp.c.eggcups 2012-05-05 01:00:01.000000000 +0200
|
||||
+++ cups-1.5.3/backend/ipp.c 2012-05-15 16:50:41.142868986 +0200
|
||||
@@ -138,6 +138,70 @@ static cups_array_t *state_reasons; /* A
|
||||
static char tmpfilename[1024] = "";
|
||||
/* Temporary spool file name */
|
||||
|
||||
+#if HAVE_DBUS
|
||||
+#include <dbus/dbus.h>
|
||||
+
|
||||
+static DBusConnection *dbus_connection = NULL;
|
||||
+
|
||||
+static int
|
||||
+init_dbus (void)
|
||||
+{
|
||||
+ DBusConnection *connection;
|
||||
+ DBusError error;
|
||||
+
|
||||
+ if (dbus_connection &&
|
||||
+ !dbus_connection_get_is_connected (dbus_connection)) {
|
||||
+ dbus_connection_unref (dbus_connection);
|
||||
+ dbus_connection = NULL;
|
||||
+ }
|
||||
+
|
||||
+ dbus_error_init (&error);
|
||||
+ connection = dbus_bus_get (getuid () ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &error);
|
||||
+ if (connection == NULL) {
|
||||
+ dbus_error_free (&error);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ dbus_connection = connection;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+dbus_broadcast_queued_remote (const char *printer_uri,
|
||||
+ ipp_status_t status,
|
||||
+ unsigned int local_job_id,
|
||||
+ unsigned int remote_job_id,
|
||||
+ const char *username,
|
||||
+ const char *printer_name)
|
||||
+{
|
||||
+ DBusMessage *message;
|
||||
+ DBusMessageIter iter;
|
||||
+ const char *errstr;
|
||||
+
|
||||
+ if (!dbus_connection || !dbus_connection_get_is_connected (dbus_connection)) {
|
||||
+ if (init_dbus () || !dbus_connection)
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ errstr = ippErrorString (status);
|
||||
+ message = dbus_message_new_signal ("/com/redhat/PrinterSpooler",
|
||||
+ "com.redhat.PrinterSpooler",
|
||||
+ "JobQueuedRemote");
|
||||
+ dbus_message_iter_init_append (message, &iter);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &printer_uri);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &errstr);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &local_job_id);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &remote_job_id);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &username);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &printer_name);
|
||||
+
|
||||
+ dbus_connection_send (dbus_connection, message, NULL);
|
||||
+ dbus_connection_flush (dbus_connection);
|
||||
+ dbus_message_unref (message);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif /* HAVE_DBUS */
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
@@ -1520,6 +1584,15 @@ main(int argc, /* I - Number of comm
|
||||
_("Print file accepted - job ID %d."), job_id);
|
||||
}
|
||||
|
||||
+#if HAVE_DBUS
|
||||
+ dbus_broadcast_queued_remote (argv[0],
|
||||
+ ipp_status,
|
||||
+ atoi (argv[1]),
|
||||
+ job_id,
|
||||
+ argv[2],
|
||||
+ getenv ("PRINTER"));
|
||||
+#endif /* HAVE_DBUS */
|
||||
+
|
||||
fprintf(stderr, "DEBUG: job-id=%d\n", job_id);
|
||||
ippDelete(response);
|
||||
|
||||
diff -up cups-1.5.3/backend/Makefile.eggcups cups-1.5.3/backend/Makefile
|
||||
--- cups-1.5.3/backend/Makefile.eggcups 2012-04-23 19:42:12.000000000 +0200
|
||||
+++ cups-1.5.3/backend/Makefile 2012-05-15 16:48:17.253871982 +0200
|
||||
@@ -212,7 +212,7 @@ dnssd: dnssd.o ../cups/$(LIBCUPS) libbac
|
||||
|
||||
ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
- $(CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
|
||||
+ $(CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS) $(SERVERLIBS)
|
||||
$(RM) http
|
||||
$(LN) ipp http
|
||||
|
||||
diff -up cups-1.5.3/scheduler/subscriptions.c.eggcups cups-1.5.3/scheduler/subscriptions.c
|
||||
--- cups-1.5.3/scheduler/subscriptions.c.eggcups 2012-02-12 06:48:09.000000000 +0100
|
||||
+++ cups-1.5.3/scheduler/subscriptions.c 2012-05-15 16:48:17.253871982 +0200
|
||||
@@ -1314,13 +1314,13 @@ cupsd_send_dbus(cupsd_eventmask_t event,
|
||||
what = "PrinterAdded";
|
||||
else if (event & CUPSD_EVENT_PRINTER_DELETED)
|
||||
what = "PrinterRemoved";
|
||||
- else if (event & CUPSD_EVENT_PRINTER_CHANGED)
|
||||
- what = "QueueChanged";
|
||||
else if (event & CUPSD_EVENT_JOB_CREATED)
|
||||
what = "JobQueuedLocal";
|
||||
else if ((event & CUPSD_EVENT_JOB_STATE) && job &&
|
||||
job->state_value == IPP_JOB_PROCESSING)
|
||||
what = "JobStartedLocal";
|
||||
+ else if (event & (CUPSD_EVENT_PRINTER_CHANGED|CUPSD_EVENT_JOB_STATE_CHANGED|CUPSD_EVENT_PRINTER_STATE_CHANGED))
|
||||
+ what = "QueueChanged";
|
||||
else
|
||||
return;
|
||||
|
||||
@@ -1356,7 +1356,7 @@ cupsd_send_dbus(cupsd_eventmask_t event,
|
||||
dbus_message_append_iter_init(message, &iter);
|
||||
if (dest)
|
||||
dbus_message_iter_append_string(&iter, dest->name);
|
||||
- if (job)
|
||||
+ if (job && strcmp (what, "QueueChanged") != 0)
|
||||
{
|
||||
dbus_message_iter_append_uint32(&iter, job->id);
|
||||
dbus_message_iter_append_string(&iter, job->username);
|
32
srcpkgs/cups/patches/cups-filter-debug.patch
Normal file
32
srcpkgs/cups/patches/cups-filter-debug.patch
Normal file
|
@ -0,0 +1,32 @@
|
|||
diff -up cups-1.5b1/scheduler/job.c.filter-debug cups-1.5b1/scheduler/job.c
|
||||
--- cups-1.5b1/scheduler/job.c.filter-debug 2011-05-24 15:58:07.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/job.c 2011-05-24 15:58:07.000000000 +0200
|
||||
@@ -557,10 +557,28 @@ cupsdContinueJob(cupsd_job_t *job) /* I
|
||||
|
||||
if (!filters)
|
||||
{
|
||||
+ mime_filter_t *current;
|
||||
+
|
||||
cupsdLogJob(job, CUPSD_LOG_ERROR,
|
||||
"Unable to convert file %d to printable format!",
|
||||
job->current_file);
|
||||
|
||||
+ cupsdLogJob(job, CUPSD_LOG_ERROR,
|
||||
+ "Required: %s/%s -> %s/%s",
|
||||
+ job->filetypes[job->current_file]->super,
|
||||
+ job->filetypes[job->current_file]->type,
|
||||
+ job->printer->filetype->super,
|
||||
+ job->printer->filetype->type);
|
||||
+
|
||||
+ for (current = (mime_filter_t *)cupsArrayFirst(MimeDatabase->srcs);
|
||||
+ current;
|
||||
+ current = (mime_filter_t *)cupsArrayNext(MimeDatabase->srcs))
|
||||
+ cupsdLogJob(job, CUPSD_LOG_ERROR,
|
||||
+ "Available: %s/%s -> %s/%s (%s)",
|
||||
+ current->src->super, current->src->type,
|
||||
+ current->dst->super, current->dst->type,
|
||||
+ current->filter);
|
||||
+
|
||||
abort_message = "Aborting job because it cannot be printed.";
|
||||
abort_state = IPP_JOB_ABORTED;
|
||||
|
50
srcpkgs/cups/patches/cups-getpass.patch
Normal file
50
srcpkgs/cups/patches/cups-getpass.patch
Normal file
|
@ -0,0 +1,50 @@
|
|||
diff -up cups-1.5b1/cups/usersys.c.getpass cups-1.5b1/cups/usersys.c
|
||||
--- cups-1.5b1/cups/usersys.c.getpass 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/cups/usersys.c 2011-05-24 15:41:33.000000000 +0200
|
||||
@@ -43,6 +43,8 @@
|
||||
#include "cups-private.h"
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <termios.h>
|
||||
+#include <signal.h>
|
||||
#ifdef WIN32
|
||||
# include <windows.h>
|
||||
#else
|
||||
@@ -501,13 +503,31 @@ _cupsGetPassword(const char *prompt) /*
|
||||
* empty password is treated as canceling the authentication request.
|
||||
*/
|
||||
|
||||
- const char *password = getpass(prompt);
|
||||
- /* Password string */
|
||||
-
|
||||
- if (!password || !password[0])
|
||||
- return (NULL);
|
||||
- else
|
||||
+ static char password[100];
|
||||
+ struct termios oldtio, newtio;
|
||||
+ sigset_t oldset, newset;
|
||||
+ int nread;
|
||||
+ sigprocmask (SIG_BLOCK, NULL, &newset);
|
||||
+ sigaddset (&newset, SIGINT);
|
||||
+ sigaddset (&newset, SIGTSTP);
|
||||
+ sigprocmask (SIG_BLOCK, &newset, &oldset);
|
||||
+ tcgetattr (STDIN_FILENO, &oldtio);
|
||||
+ newtio = oldtio;
|
||||
+ newtio.c_lflag &= ~ECHO;
|
||||
+ tcsetattr (STDIN_FILENO, TCSAFLUSH, &newtio);
|
||||
+ fputs (prompt, stdout);
|
||||
+ fflush (stdout);
|
||||
+ nread = read (STDIN_FILENO, password, sizeof (password));
|
||||
+ tcsetattr (STDIN_FILENO, TCSAFLUSH, &oldtio);
|
||||
+ fputc ('\n', stdout);
|
||||
+ sigprocmask (SIG_SETMASK, &oldset, NULL);
|
||||
+ if (nread > 0)
|
||||
+ {
|
||||
+ password[nread - 1] = '\0';
|
||||
return (password);
|
||||
+ }
|
||||
+ else
|
||||
+ return (NULL);
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
21
srcpkgs/cups/patches/cups-hp-deviceid-oid.patch
Normal file
21
srcpkgs/cups/patches/cups-hp-deviceid-oid.patch
Normal file
|
@ -0,0 +1,21 @@
|
|||
diff -up cups-1.5b1/backend/snmp.c.hp-deviceid-oid cups-1.5b1/backend/snmp.c
|
||||
--- cups-1.5b1/backend/snmp.c.hp-deviceid-oid 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/backend/snmp.c 2011-05-24 17:24:48.000000000 +0200
|
||||
@@ -187,6 +187,7 @@ static const int UriOID[] = { CUPS_OID_p
|
||||
static const int LexmarkProductOID[] = { 1,3,6,1,4,1,641,2,1,2,1,2,1,-1 };
|
||||
static const int LexmarkProductOID2[] = { 1,3,6,1,4,1,674,10898,100,2,1,2,1,2,1,-1 };
|
||||
static const int LexmarkDeviceIdOID[] = { 1,3,6,1,4,1,641,2,1,2,1,3,1,-1 };
|
||||
+static const int HPDeviceIdOID[] = { 1,3,6,1,4,1,11,2,3,9,1,1,7,0,-1 };
|
||||
static const int XeroxProductOID[] = { 1,3,6,1,4,1,128,2,1,3,1,2,0,-1 };
|
||||
static cups_array_t *DeviceURIs = NULL;
|
||||
static int HostNameLookups = 0;
|
||||
@@ -1006,6 +1007,9 @@ read_snmp_response(int fd) /* I - SNMP
|
||||
_cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
|
||||
packet.community, CUPS_ASN1_GET_REQUEST,
|
||||
DEVICE_PRODUCT, XeroxProductOID);
|
||||
+ _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
|
||||
+ packet.community, CUPS_ASN1_GET_REQUEST,
|
||||
+ DEVICE_ID, HPDeviceIdOID);
|
||||
break;
|
||||
|
||||
case DEVICE_DESCRIPTION :
|
1042
srcpkgs/cups/patches/cups-icc.patch
Normal file
1042
srcpkgs/cups/patches/cups-icc.patch
Normal file
File diff suppressed because it is too large
Load diff
63
srcpkgs/cups/patches/cups-logrotate.patch
Normal file
63
srcpkgs/cups/patches/cups-logrotate.patch
Normal file
|
@ -0,0 +1,63 @@
|
|||
diff -up cups-1.5b1/scheduler/log.c.logrotate cups-1.5b1/scheduler/log.c
|
||||
--- cups-1.5b1/scheduler/log.c.logrotate 2011-05-14 01:04:16.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/log.c 2011-05-24 15:47:20.000000000 +0200
|
||||
@@ -32,6 +32,9 @@
|
||||
#include "cupsd.h"
|
||||
#include <stdarg.h>
|
||||
#include <syslog.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <unistd.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -71,12 +74,10 @@ cupsdCheckLogFile(cups_file_t **lf, /* I
|
||||
return (1);
|
||||
|
||||
/*
|
||||
- * Format the filename as needed...
|
||||
+ * Format the filename...
|
||||
*/
|
||||
|
||||
- if (!*lf ||
|
||||
- (strncmp(logname, "/dev/", 5) && cupsFileTell(*lf) > MaxLogSize &&
|
||||
- MaxLogSize > 0))
|
||||
+ if (strncmp(logname, "/dev/", 5))
|
||||
{
|
||||
/*
|
||||
* Handle format strings...
|
||||
@@ -186,6 +187,34 @@ cupsdCheckLogFile(cups_file_t **lf, /* I
|
||||
}
|
||||
|
||||
/*
|
||||
+ * Has someone else (i.e. logrotate) already rotated the log for us?
|
||||
+ */
|
||||
+ else if (strncmp(filename, "/dev/", 5))
|
||||
+ {
|
||||
+ struct stat st;
|
||||
+ if (stat(filename, &st) || st.st_size == 0)
|
||||
+ {
|
||||
+ /* File is either missing or has zero size. */
|
||||
+
|
||||
+ cupsFileClose(*lf);
|
||||
+ if ((*lf = cupsFileOpen(filename, "a")) == NULL)
|
||||
+ {
|
||||
+ syslog(LOG_ERR, "Unable to open log file \"%s\" - %s", filename,
|
||||
+ strerror(errno));
|
||||
+
|
||||
+ return (0);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Change ownership and permissions of non-device logs...
|
||||
+ */
|
||||
+
|
||||
+ fchown(cupsFileNumber(*lf), RunUser, Group);
|
||||
+ fchmod(cupsFileNumber(*lf), LogFilePerm);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
* Do we need to rotate the log?
|
||||
*/
|
||||
|
48
srcpkgs/cups/patches/cups-lpr-help.patch
Normal file
48
srcpkgs/cups/patches/cups-lpr-help.patch
Normal file
|
@ -0,0 +1,48 @@
|
|||
diff -up cups-1.5b1/berkeley/lpr.c.lpr-help cups-1.5b1/berkeley/lpr.c
|
||||
--- cups-1.5b1/berkeley/lpr.c.lpr-help 2011-03-21 23:02:00.000000000 +0100
|
||||
+++ cups-1.5b1/berkeley/lpr.c 2011-05-23 17:58:06.000000000 +0200
|
||||
@@ -24,6 +24,31 @@
|
||||
#include <cups/cups-private.h>
|
||||
|
||||
|
||||
+static void
|
||||
+usage (const char *name)
|
||||
+{
|
||||
+ _cupsLangPrintf(stdout,
|
||||
+"Usage: %s [OPTION] [ file(s) ]\n"
|
||||
+"Print files.\n\n"
|
||||
+" -E force encryption\n"
|
||||
+" -H server[:port] specify alternate server\n"
|
||||
+" -C title, -J title, -T title\n"
|
||||
+" set the job name\n\n"
|
||||
+" -P destination/instance print to named printer\n"
|
||||
+" -U username specify alternate username\n"
|
||||
+" -# num-copies set number of copies\n"
|
||||
+" -h disable banner printing\n"
|
||||
+" -l print without filtering\n"
|
||||
+" -m send email on completion\n"
|
||||
+" -o option[=value] set a job option\n"
|
||||
+" -p format text file with header\n"
|
||||
+" -q hold job for printing\n"
|
||||
+" -r delete files after printing\n"
|
||||
+"\nWith no file given, read standard input.\n"
|
||||
+, name);
|
||||
+}
|
||||
+
|
||||
+
|
||||
/*
|
||||
* 'main()' - Parse options and send files for printing.
|
||||
*/
|
||||
@@ -270,6 +294,12 @@ main(int argc, /* I - Number of comm
|
||||
break;
|
||||
|
||||
default :
|
||||
+ if (!strcmp (argv[i], "--help"))
|
||||
+ {
|
||||
+ usage (argv[0]);
|
||||
+ return (0);
|
||||
+ }
|
||||
+
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unknown option \"%c\"."), argv[0],
|
||||
argv[i][1]);
|
16
srcpkgs/cups/patches/cups-multilib.patch
Normal file
16
srcpkgs/cups/patches/cups-multilib.patch
Normal file
|
@ -0,0 +1,16 @@
|
|||
diff -up cups-1.5b1/cups-config.in.multilib cups-1.5b1/cups-config.in
|
||||
--- cups-1.5b1/cups-config.in.multilib 2010-06-16 02:48:25.000000000 +0200
|
||||
+++ cups-1.5b1/cups-config.in 2011-05-23 17:33:31.000000000 +0200
|
||||
@@ -22,8 +22,10 @@ prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
bindir=@bindir@
|
||||
includedir=@includedir@
|
||||
-libdir=@libdir@
|
||||
-imagelibdir=@libdir@
|
||||
+# Fetch libdir from gnutls's pkg-config script. This is a bit
|
||||
+# of a cheat, but the cups-devel package requires gnutls-devel anyway.
|
||||
+libdir=`pkg-config --variable=libdir gnutls`
|
||||
+imagelibdir=`pkg-config --variable=libdir gnutls`
|
||||
datarootdir=@datadir@
|
||||
datadir=@datadir@
|
||||
sysconfdir=@sysconfdir@
|
12
srcpkgs/cups/patches/cups-no-export-ssllibs.patch
Normal file
12
srcpkgs/cups/patches/cups-no-export-ssllibs.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
diff -up cups-1.5.3/config-scripts/cups-ssl.m4.no-export-ssllibs cups-1.5.3/config-scripts/cups-ssl.m4
|
||||
--- cups-1.5.3/config-scripts/cups-ssl.m4.no-export-ssllibs 2012-03-21 05:45:48.000000000 +0100
|
||||
+++ cups-1.5.3/config-scripts/cups-ssl.m4 2012-05-15 16:47:13.753314620 +0200
|
||||
@@ -173,7 +173,7 @@ AC_SUBST(IPPALIASES)
|
||||
AC_SUBST(SSLFLAGS)
|
||||
AC_SUBST(SSLLIBS)
|
||||
|
||||
-EXPORT_SSLLIBS="$SSLLIBS"
|
||||
+EXPORT_SSLLIBS=""
|
||||
AC_SUBST(EXPORT_SSLLIBS)
|
||||
|
||||
dnl
|
38
srcpkgs/cups/patches/cups-no-gcrypt.patch
Normal file
38
srcpkgs/cups/patches/cups-no-gcrypt.patch
Normal file
|
@ -0,0 +1,38 @@
|
|||
diff -ruN cups-1.4.7.orig//config-scripts/cups-ssl.m4 cups-1.4.7/config-scripts/cups-ssl.m4
|
||||
--- cups-1.5.0.orig//config-scripts/cups-ssl.m4 2011-01-11 08:05:58.000000000 +0100
|
||||
+++ cups-1.5.0/config-scripts/cups-ssl.m4 2011-08-02 10:44:26.011047900 +0200
|
||||
@@ -96,7 +96,6 @@
|
||||
dnl Then look for GNU TLS...
|
||||
if test $have_ssl = 0 -a "x$enable_gnutls" != "xno" -a "x$PKGCONFIG" != x; then
|
||||
AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
|
||||
- AC_PATH_PROG(LIBGCRYPTCONFIG,libgcrypt-config)
|
||||
if $PKGCONFIG --exists gnutls; then
|
||||
have_ssl=1
|
||||
SSLLIBS=`$PKGCONFIG --libs gnutls`
|
||||
@@ -110,16 +109,6 @@
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
AC_DEFINE(HAVE_GNUTLS)
|
||||
fi
|
||||
-
|
||||
- if test $have_ssl = 1; then
|
||||
- if $PKGCONFIG --exists gcrypt; then
|
||||
- SSLLIBS="$SSLLIBS `$PKGCONFIG --libs gcrypt`"
|
||||
- SSLFLAGS="$SSLFLAGS `$PKGCONFIG --cflags gcrypt`"
|
||||
- elif test "x$LIBGCRYPTCONFIG" != x; then
|
||||
- SSLLIBS="$SSLLIBS `$LIBGCRYPTCONFIG --libs`"
|
||||
- SSLFLAGS="$SSLFLAGS `$LIBGCRYPTCONFIG --cflags`"
|
||||
- fi
|
||||
- fi
|
||||
fi
|
||||
|
||||
dnl Check for the OpenSSL library last...
|
||||
--- cups-1.5.0.orig//cups/http-private.h 2011-01-22 01:07:22.000000000 +0100
|
||||
+++ cups-1.5.0/cups/http-private.h 2011-08-02 10:42:43.341604107 +0200
|
||||
@@ -93,7 +93,6 @@
|
||||
# elif defined HAVE_GNUTLS
|
||||
# include <gnutls/gnutls.h>
|
||||
# include <gnutls/x509.h>
|
||||
-# include <gcrypt.h>
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
# include <CoreFoundation/CoreFoundation.h>
|
||||
# include <Security/Security.h>
|
18
srcpkgs/cups/patches/cups-no-gzip-man.patch
Normal file
18
srcpkgs/cups/patches/cups-no-gzip-man.patch
Normal file
|
@ -0,0 +1,18 @@
|
|||
diff -up cups-1.5b1/config-scripts/cups-manpages.m4.no-gzip-man cups-1.5b1/config-scripts/cups-manpages.m4
|
||||
--- cups-1.5b1/config-scripts/cups-manpages.m4.no-gzip-man 2011-05-12 07:21:56.000000000 +0200
|
||||
+++ cups-1.5b1/config-scripts/cups-manpages.m4 2011-05-23 17:25:50.000000000 +0200
|
||||
@@ -69,10 +69,10 @@ case "$uname" in
|
||||
;;
|
||||
Linux* | GNU* | Darwin*)
|
||||
# Linux, GNU Hurd, and Mac OS X
|
||||
- MAN1EXT=1.gz
|
||||
- MAN5EXT=5.gz
|
||||
- MAN7EXT=7.gz
|
||||
- MAN8EXT=8.gz
|
||||
+ MAN1EXT=1
|
||||
+ MAN5EXT=5
|
||||
+ MAN7EXT=7
|
||||
+ MAN8EXT=8
|
||||
MAN8DIR=8
|
||||
;;
|
||||
*)
|
11
srcpkgs/cups/patches/cups-peercred.patch
Normal file
11
srcpkgs/cups/patches/cups-peercred.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
diff -up cups-1.5b1/scheduler/auth.c.peercred cups-1.5b1/scheduler/auth.c
|
||||
--- cups-1.5b1/scheduler/auth.c.peercred 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/auth.c 2011-05-23 18:00:18.000000000 +0200
|
||||
@@ -52,6 +52,7 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
+#define _GNU_SOURCE
|
||||
#include "cupsd.h"
|
||||
#include <grp.h>
|
||||
#ifdef HAVE_SHADOW_H
|
37
srcpkgs/cups/patches/cups-pid.patch
Normal file
37
srcpkgs/cups/patches/cups-pid.patch
Normal file
|
@ -0,0 +1,37 @@
|
|||
diff -up cups-1.5b1/scheduler/main.c.pid cups-1.5b1/scheduler/main.c
|
||||
--- cups-1.5b1/scheduler/main.c.pid 2011-05-18 22:44:16.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/main.c 2011-05-23 18:01:20.000000000 +0200
|
||||
@@ -311,6 +311,8 @@ main(int argc, /* I - Number of comm
|
||||
* Setup signal handlers for the parent...
|
||||
*/
|
||||
|
||||
+ pid_t pid;
|
||||
+
|
||||
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
|
||||
sigset(SIGUSR1, parent_handler);
|
||||
sigset(SIGCHLD, parent_handler);
|
||||
@@ -334,7 +336,7 @@ main(int argc, /* I - Number of comm
|
||||
signal(SIGHUP, SIG_IGN);
|
||||
#endif /* HAVE_SIGSET */
|
||||
|
||||
- if (fork() > 0)
|
||||
+ if ((pid = fork()) > 0)
|
||||
{
|
||||
/*
|
||||
* OK, wait for the child to startup and send us SIGUSR1 or to crash
|
||||
@@ -346,7 +348,15 @@ main(int argc, /* I - Number of comm
|
||||
sleep(1);
|
||||
|
||||
if (parent_signal == SIGUSR1)
|
||||
+ {
|
||||
+ FILE *f = fopen ("/var/run/cupsd.pid", "w");
|
||||
+ if (f)
|
||||
+ {
|
||||
+ fprintf (f, "%d\n", pid);
|
||||
+ fclose (f);
|
||||
+ }
|
||||
return (0);
|
||||
+ }
|
||||
|
||||
if (wait(&i) < 0)
|
||||
{
|
26
srcpkgs/cups/patches/cups-res_init.patch
Normal file
26
srcpkgs/cups/patches/cups-res_init.patch
Normal file
|
@ -0,0 +1,26 @@
|
|||
diff -up cups-1.5b1/cups/http-addr.c.res_init cups-1.5b1/cups/http-addr.c
|
||||
--- cups-1.5b1/cups/http-addr.c.res_init 2011-04-16 01:38:13.000000000 +0200
|
||||
+++ cups-1.5b1/cups/http-addr.c 2011-05-24 15:56:50.000000000 +0200
|
||||
@@ -256,7 +256,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.5b1/cups/http-addrlist.c.res_init cups-1.5b1/cups/http-addrlist.c
|
||||
--- cups-1.5b1/cups/http-addrlist.c.res_init 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/cups/http-addrlist.c 2011-05-24 15:56:50.000000000 +0200
|
||||
@@ -386,7 +386,8 @@ httpAddrGetList(const char *hostname, /*
|
||||
|
||||
freeaddrinfo(results);
|
||||
}
|
||||
- else if (error == EAI_FAIL)
|
||||
+ else if (error == EAI_FAIL || error == EAI_AGAIN || error == EAI_NODATA ||
|
||||
+ error == EAI_NONAME)
|
||||
cg->need_res_init = 1;
|
||||
|
||||
#else
|
21
srcpkgs/cups/patches/cups-ricoh-deviceid-oid.patch
Normal file
21
srcpkgs/cups/patches/cups-ricoh-deviceid-oid.patch
Normal file
|
@ -0,0 +1,21 @@
|
|||
diff -up cups-1.5b1/backend/snmp.c.ricoh-deviceid-oid cups-1.5b1/backend/snmp.c
|
||||
--- cups-1.5b1/backend/snmp.c.ricoh-deviceid-oid 2011-05-24 17:29:48.000000000 +0200
|
||||
+++ cups-1.5b1/backend/snmp.c 2011-05-24 17:29:48.000000000 +0200
|
||||
@@ -188,6 +188,7 @@ static const int LexmarkProductOID[] = {
|
||||
static const int LexmarkProductOID2[] = { 1,3,6,1,4,1,674,10898,100,2,1,2,1,2,1,-1 };
|
||||
static const int LexmarkDeviceIdOID[] = { 1,3,6,1,4,1,641,2,1,2,1,3,1,-1 };
|
||||
static const int HPDeviceIdOID[] = { 1,3,6,1,4,1,11,2,3,9,1,1,7,0,-1 };
|
||||
+static const int RicohDeviceIdOID[] = { 1,3,6,1,4,1,367,3,2,1,1,1,11,0,-1 };
|
||||
static const int XeroxProductOID[] = { 1,3,6,1,4,1,128,2,1,3,1,2,0,-1 };
|
||||
static cups_array_t *DeviceURIs = NULL;
|
||||
static int HostNameLookups = 0;
|
||||
@@ -1005,6 +1006,9 @@ read_snmp_response(int fd) /* I - SNMP
|
||||
packet.community, CUPS_ASN1_GET_REQUEST,
|
||||
DEVICE_ID, LexmarkDeviceIdOID);
|
||||
_cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
|
||||
+ packet.community, CUPS_ASN1_GET_REQUEST,
|
||||
+ DEVICE_ID, RicohDeviceIdOID);
|
||||
+ _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
|
||||
packet.community, CUPS_ASN1_GET_REQUEST,
|
||||
DEVICE_PRODUCT, XeroxProductOID);
|
||||
_cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
|
11
srcpkgs/cups/patches/cups-serial.patch
Normal file
11
srcpkgs/cups/patches/cups-serial.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
diff -up cups-1.5b1/backend/serial.c.serial cups-1.5b1/backend/serial.c
|
||||
--- cups-1.5b1/backend/serial.c.serial 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/backend/serial.c 2011-05-23 17:34:33.000000000 +0200
|
||||
@@ -75,6 +75,7 @@
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#if defined(__linux) && defined(TIOCGSERIAL)
|
||||
+# include <linux/types.h>
|
||||
# include <linux/serial.h>
|
||||
# include <linux/ioctl.h>
|
||||
#endif /* __linux && TIOCGSERIAL */
|
190
srcpkgs/cups/patches/cups-serverbin-compat.patch
Normal file
190
srcpkgs/cups/patches/cups-serverbin-compat.patch
Normal file
|
@ -0,0 +1,190 @@
|
|||
diff -up cups-1.5b1/scheduler/conf.c.serverbin-compat cups-1.5b1/scheduler/conf.c
|
||||
--- cups-1.5b1/scheduler/conf.c.serverbin-compat 2011-05-20 06:24:54.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/conf.c 2011-05-23 17:20:33.000000000 +0200
|
||||
@@ -491,6 +491,9 @@ cupsdReadConfiguration(void)
|
||||
cupsdClearString(&ServerName);
|
||||
cupsdClearString(&ServerAdmin);
|
||||
cupsdSetString(&ServerBin, CUPS_SERVERBIN);
|
||||
+#ifdef __x86_64__
|
||||
+ cupsdSetString(&ServerBin_compat, "/usr/lib64/cups");
|
||||
+#endif /* __x86_64__ */
|
||||
cupsdSetString(&RequestRoot, CUPS_REQUESTS);
|
||||
cupsdSetString(&CacheDir, CUPS_CACHEDIR);
|
||||
cupsdSetString(&DataDir, CUPS_DATADIR);
|
||||
@@ -1378,7 +1381,12 @@ cupsdReadConfiguration(void)
|
||||
* Read the MIME type and conversion database...
|
||||
*/
|
||||
|
||||
+#ifdef __x86_64__
|
||||
+ snprintf(temp, sizeof(temp), "%s/filter:%s/filter", ServerBin,
|
||||
+ ServerBin_compat);
|
||||
+#else
|
||||
snprintf(temp, sizeof(temp), "%s/filter", ServerBin);
|
||||
+#endif
|
||||
snprintf(mimedir, sizeof(mimedir), "%s/mime", DataDir);
|
||||
|
||||
MimeDatabase = mimeNew();
|
||||
diff -up cups-1.5b1/scheduler/conf.h.serverbin-compat cups-1.5b1/scheduler/conf.h
|
||||
--- cups-1.5b1/scheduler/conf.h.serverbin-compat 2011-04-22 19:47:03.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/conf.h 2011-05-23 15:34:25.000000000 +0200
|
||||
@@ -105,6 +105,10 @@ VAR char *ConfigurationFile VALUE(NULL)
|
||||
/* Root directory for scheduler */
|
||||
*ServerBin VALUE(NULL),
|
||||
/* Root directory for binaries */
|
||||
+#ifdef __x86_64__
|
||||
+ *ServerBin_compat VALUE(NULL),
|
||||
+ /* Compat directory for binaries */
|
||||
+#endif /* __x86_64__ */
|
||||
*StateDir VALUE(NULL),
|
||||
/* Root directory for state data */
|
||||
*RequestRoot VALUE(NULL),
|
||||
diff -up cups-1.5b1/scheduler/env.c.serverbin-compat cups-1.5b1/scheduler/env.c
|
||||
--- cups-1.5b1/scheduler/env.c.serverbin-compat 2011-01-11 04:48:42.000000000 +0100
|
||||
+++ cups-1.5b1/scheduler/env.c 2011-05-23 17:07:17.000000000 +0200
|
||||
@@ -218,8 +218,13 @@ cupsdUpdateEnv(void)
|
||||
set_if_undefined("LD_PRELOAD", NULL);
|
||||
set_if_undefined("NLSPATH", NULL);
|
||||
if (find_env("PATH") < 0)
|
||||
+#ifdef __x86_64__
|
||||
+ cupsdSetEnvf("PATH", "%s/filter:%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR
|
||||
+ ":/bin:/usr/bin", ServerBin, ServerBin_compat);
|
||||
+#else /* ! defined(__x86_64__) */
|
||||
cupsdSetEnvf("PATH", "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR
|
||||
":/bin:/usr/bin", ServerBin);
|
||||
+#endif
|
||||
set_if_undefined("SERVER_ADMIN", ServerAdmin);
|
||||
set_if_undefined("SHLIB_PATH", NULL);
|
||||
set_if_undefined("SOFTWARE", CUPS_MINIMAL);
|
||||
diff -up cups-1.5b1/scheduler/ipp.c.serverbin-compat cups-1.5b1/scheduler/ipp.c
|
||||
--- cups-1.5b1/scheduler/ipp.c.serverbin-compat 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/ipp.c 2011-05-23 16:09:57.000000000 +0200
|
||||
@@ -2586,9 +2586,18 @@ add_printer(cupsd_client_t *con, /* I -
|
||||
* Could not find device in list!
|
||||
*/
|
||||
|
||||
+#ifdef __x86_64__
|
||||
+ snprintf(srcfile, sizeof(srcfile), "%s/backend/%s", ServerBin_compat,
|
||||
+ scheme);
|
||||
+ if (access(srcfile, X_OK))
|
||||
+ {
|
||||
+#endif /* __x86_64__ */
|
||||
send_ipp_status(con, IPP_NOT_POSSIBLE,
|
||||
_("Bad device-uri scheme \"%s\"."), scheme);
|
||||
return;
|
||||
+#ifdef __x86_64__
|
||||
+ }
|
||||
+#endif /* __x86_64__ */
|
||||
}
|
||||
}
|
||||
|
||||
diff -up cups-1.5b1/scheduler/job.c.serverbin-compat cups-1.5b1/scheduler/job.c
|
||||
--- cups-1.5b1/scheduler/job.c.serverbin-compat 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/job.c 2011-05-23 16:18:57.000000000 +0200
|
||||
@@ -1047,8 +1047,32 @@ cupsdContinueJob(cupsd_job_t *job) /* I
|
||||
i ++, filter = (mime_filter_t *)cupsArrayNext(filters))
|
||||
{
|
||||
if (filter->filter[0] != '/')
|
||||
- snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
|
||||
- filter->filter);
|
||||
+ {
|
||||
+ snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
|
||||
+ filter->filter);
|
||||
+#ifdef __x86_64__
|
||||
+ if (access(command, F_OK))
|
||||
+ {
|
||||
+ snprintf(command, sizeof(command), "%s/filter/%s",
|
||||
+ ServerBin_compat, filter->filter);
|
||||
+ if (!access(command, F_OK))
|
||||
+ {
|
||||
+ /* Not in the correct directory, but found it in the compat
|
||||
+ * directory. Issue a warning. */
|
||||
+ cupsdLogMessage(CUPSD_LOG_INFO,
|
||||
+ "Filter '%s' not in %s/filter!",
|
||||
+ filter->filter, ServerBin);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* Not in the compat directory either; make any error
|
||||
+ * messages use the correct directory name then. */
|
||||
+ snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
|
||||
+ filter->filter);
|
||||
+ }
|
||||
+ }
|
||||
+#endif /* __x86_64__ */
|
||||
+ }
|
||||
else
|
||||
strlcpy(command, filter->filter, sizeof(command));
|
||||
|
||||
@@ -1199,6 +1223,28 @@ cupsdContinueJob(cupsd_job_t *job) /* I
|
||||
{
|
||||
cupsdClosePipe(job->back_pipes);
|
||||
cupsdClosePipe(job->side_pipes);
|
||||
+#ifdef __x86_64__
|
||||
+ if (access(command, F_OK))
|
||||
+ {
|
||||
+ snprintf(command, sizeof(command), "%s/backend/%s", ServerBin_compat,
|
||||
+ scheme);
|
||||
+ if (!access(command, F_OK))
|
||||
+ {
|
||||
+ /* Not in the correct directory, but we found it in the compat
|
||||
+ * directory. Issue a warning. */
|
||||
+ cupsdLogMessage(CUPSD_LOG_INFO,
|
||||
+ "Backend '%s' not in %s/backend!", scheme,
|
||||
+ ServerBin);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* Not in the compat directory either; make any error
|
||||
+ messages use the correct directory name then. */
|
||||
+ snprintf(command, sizeof(command), "%s/backend/%s", ServerBin,
|
||||
+ scheme);
|
||||
+ }
|
||||
+ }
|
||||
+#endif /* __x86_64__ */
|
||||
|
||||
close(job->status_pipes[1]);
|
||||
job->status_pipes[1] = -1;
|
||||
diff -up cups-1.5b1/scheduler/printers.c.serverbin-compat cups-1.5b1/scheduler/printers.c
|
||||
--- cups-1.5b1/scheduler/printers.c.serverbin-compat 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/printers.c 2011-05-23 17:09:04.000000000 +0200
|
||||
@@ -1030,9 +1030,19 @@ cupsdLoadAllPrinters(void)
|
||||
* Backend does not exist, stop printer...
|
||||
*/
|
||||
|
||||
+#ifdef __x86_64__
|
||||
+ snprintf(line, sizeof(line), "%s/backend/%s", ServerBin_compat,
|
||||
+ p->device_uri);
|
||||
+ if (access(line, 0))
|
||||
+ {
|
||||
+#endif /* __x86_64__ */
|
||||
+
|
||||
p->state = IPP_PRINTER_STOPPED;
|
||||
snprintf(p->state_message, sizeof(p->state_message),
|
||||
"Backend %s does not exist!", line);
|
||||
+#ifdef __x86_64__
|
||||
+ }
|
||||
+#endif /* __x86_64__ */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3621,8 +3631,20 @@ add_printer_filter(
|
||||
else
|
||||
snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin, program);
|
||||
|
||||
+#ifdef __x86_64__
|
||||
+ if (_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser,
|
||||
+ cupsdLogFCMessage, p) == _CUPS_FILE_CHECK_MISSING) {
|
||||
+ snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin_compat,
|
||||
+ program);
|
||||
+ if (_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser,
|
||||
+ cupsdLogFCMessage, p) == _CUPS_FILE_CHECK_MISSING)
|
||||
+ snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin,
|
||||
+ program);
|
||||
+ }
|
||||
+#else /* ! defined(__x86_64__) */
|
||||
_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser,
|
||||
cupsdLogFCMessage, p);
|
||||
+#endif
|
||||
}
|
||||
|
||||
/*
|
115
srcpkgs/cups/patches/cups-snmp-quirks.patch
Normal file
115
srcpkgs/cups/patches/cups-snmp-quirks.patch
Normal file
|
@ -0,0 +1,115 @@
|
|||
diff -up cups-1.5.2/backend/snmp-supplies.c.snmp-quirks cups-1.5.2/backend/snmp-supplies.c
|
||||
--- cups-1.5.2/backend/snmp-supplies.c.snmp-quirks 2011-10-07 23:41:07.000000000 +0200
|
||||
+++ cups-1.5.2/backend/snmp-supplies.c 2012-02-06 10:48:47.543906526 +0100
|
||||
@@ -47,6 +47,13 @@
|
||||
|
||||
|
||||
/*
|
||||
+ * Printer quirks...
|
||||
+ */
|
||||
+
|
||||
+#define QUIRK_CAPACITY (1<<0)
|
||||
+
|
||||
+
|
||||
+/*
|
||||
* Local structures...
|
||||
*/
|
||||
|
||||
@@ -66,6 +73,12 @@ typedef struct /**** Printer state ta
|
||||
const char *keyword; /* IPP printer-state-reasons keyword */
|
||||
} backend_state_t;
|
||||
|
||||
+typedef struct /**** Quirk names table ****/
|
||||
+{
|
||||
+ int bit; /* Quirk bit */
|
||||
+ const char *keyword; /* cupsSNMPQuirks keyword */
|
||||
+} quirk_name_t;
|
||||
+
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
@@ -77,6 +90,7 @@ static int current_state = -1;
|
||||
static int charset = -1; /* Character set for supply names */
|
||||
static int num_supplies = 0;
|
||||
/* Number of supplies found */
|
||||
+static int quirks = 0; /* Printer quirks */
|
||||
static backend_supplies_t supplies[CUPS_MAX_SUPPLIES];
|
||||
/* Supply information */
|
||||
static int supply_state = -1;
|
||||
@@ -176,6 +190,15 @@ static const backend_state_t const suppl
|
||||
{ CUPS_TONER_EMPTY, "toner-empty-warning" }
|
||||
};
|
||||
|
||||
+static const quirk_name_t const quirk_names[] =
|
||||
+ {
|
||||
+ /*
|
||||
+ * The prtMarkerSuppliesLevel values are
|
||||
+ * percentages, not levels relative to the
|
||||
+ * stated capacity.
|
||||
+ */
|
||||
+ { QUIRK_CAPACITY, "capacity" }
|
||||
+ };
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
@@ -229,6 +252,9 @@ backendSNMPSupplies(
|
||||
|
||||
for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr))
|
||||
{
|
||||
+ if (quirks & QUIRK_CAPACITY)
|
||||
+ supplies[i].max_capacity = 100;
|
||||
+
|
||||
if (supplies[i].max_capacity > 0 && supplies[i].level >= 0)
|
||||
percent = 100 * supplies[i].level / supplies[i].max_capacity;
|
||||
else
|
||||
@@ -401,6 +427,7 @@ backend_init_supplies(
|
||||
http_addr_t *addr) /* I - Printer address */
|
||||
{
|
||||
int i, /* Looping var */
|
||||
+ len, /* Quirk name length */
|
||||
type; /* Current marker type */
|
||||
cups_file_t *cachefile; /* Cache file */
|
||||
const char *cachedir; /* CUPS_CACHEDIR value */
|
||||
@@ -462,6 +489,7 @@ backend_init_supplies(
|
||||
current_state = -1;
|
||||
num_supplies = -1;
|
||||
charset = -1;
|
||||
+ quirks = 0;
|
||||
|
||||
memset(supplies, 0, sizeof(supplies));
|
||||
|
||||
@@ -477,6 +505,34 @@ backend_init_supplies(
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (ppd &&
|
||||
+ (ppdattr = ppdFindAttr(ppd, "cupsSNMPQuirks", NULL)) != NULL &&
|
||||
+ ppdattr->value)
|
||||
+ {
|
||||
+ ptr = ppdattr->value;
|
||||
+ while (*ptr != '\0')
|
||||
+ {
|
||||
+ /*
|
||||
+ * Match keyword against quirk_names table.
|
||||
+ */
|
||||
+
|
||||
+ for (i = 0; i < sizeof (quirk_names) / sizeof (quirk_names[0]); i++)
|
||||
+ {
|
||||
+ len = strlen (quirk_names[i].keyword);
|
||||
+ if (!strncmp (ptr, quirk_names[i].keyword, len) &&
|
||||
+ (ptr[len] == '\0' || ptr[len] == ' '))
|
||||
+ quirks |= quirk_names[i].bit;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Advance to next keyword.
|
||||
+ */
|
||||
+
|
||||
+ ptr += strcspn (ptr, " ");
|
||||
+ ptr += strspn (ptr, " ");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
ppdClose(ppd);
|
||||
|
||||
/*
|
64
srcpkgs/cups/patches/cups-str3382.patch
Normal file
64
srcpkgs/cups/patches/cups-str3382.patch
Normal file
|
@ -0,0 +1,64 @@
|
|||
diff -up cups-1.5b1/cups/tempfile.c.str3382 cups-1.5b1/cups/tempfile.c
|
||||
--- cups-1.5b1/cups/tempfile.c.str3382 2010-03-24 01:45:34.000000000 +0100
|
||||
+++ cups-1.5b1/cups/tempfile.c 2011-05-24 16:04:47.000000000 +0200
|
||||
@@ -33,6 +33,7 @@
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
+# include <sys/types.h>
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
@@ -54,7 +55,7 @@ cupsTempFd(char *filename, /* I - Point
|
||||
char tmppath[1024]; /* Windows temporary directory */
|
||||
DWORD curtime; /* Current time */
|
||||
#else
|
||||
- struct timeval curtime; /* Current time */
|
||||
+ mode_t old_umask; /* Old umask before using mkstemp() */
|
||||
#endif /* WIN32 */
|
||||
|
||||
|
||||
@@ -105,33 +106,25 @@ cupsTempFd(char *filename, /* I - Point
|
||||
|
||||
snprintf(filename, len - 1, "%s/%05lx%08lx", tmpdir,
|
||||
GetCurrentProcessId(), curtime);
|
||||
-#else
|
||||
- /*
|
||||
- * Get the current time of day...
|
||||
- */
|
||||
-
|
||||
- gettimeofday(&curtime, NULL);
|
||||
-
|
||||
- /*
|
||||
- * Format a string using the hex time values...
|
||||
- */
|
||||
-
|
||||
- snprintf(filename, len - 1, "%s/%05x%08x", tmpdir, (unsigned)getpid(),
|
||||
- (unsigned)(curtime.tv_sec + curtime.tv_usec + tries));
|
||||
-#endif /* WIN32 */
|
||||
|
||||
/*
|
||||
* Open the file in "exclusive" mode, making sure that we don't
|
||||
* stomp on an existing file or someone's symlink crack...
|
||||
*/
|
||||
|
||||
-#ifdef WIN32
|
||||
fd = open(filename, _O_CREAT | _O_RDWR | _O_TRUNC | _O_BINARY,
|
||||
_S_IREAD | _S_IWRITE);
|
||||
-#elif defined(O_NOFOLLOW)
|
||||
- fd = open(filename, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW, 0600);
|
||||
#else
|
||||
- fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600);
|
||||
+
|
||||
+ /*
|
||||
+ * Use the standard mkstemp() call to make a temporary filename
|
||||
+ * securely. -- andrew.wood@jdplc.com
|
||||
+ */
|
||||
+ snprintf(filename, len - 1, "%s/cupsXXXXXX", tmpdir);
|
||||
+
|
||||
+ old_umask = umask(0077);
|
||||
+ fd = mkstemp(filename);
|
||||
+ umask(old_umask);
|
||||
#endif /* WIN32 */
|
||||
|
||||
if (fd < 0 && errno != EEXIST)
|
30
srcpkgs/cups/patches/cups-strict-ppd-line-length.patch
Normal file
30
srcpkgs/cups/patches/cups-strict-ppd-line-length.patch
Normal file
|
@ -0,0 +1,30 @@
|
|||
diff -up cups-1.5b1/cups/ppd.c.strict-ppd-line-length cups-1.5b1/cups/ppd.c
|
||||
--- cups-1.5b1/cups/ppd.c.strict-ppd-line-length 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/cups/ppd.c 2011-05-24 15:46:13.000000000 +0200
|
||||
@@ -2786,7 +2786,7 @@ ppd_read(cups_file_t *fp, /* I - Fil
|
||||
*lineptr++ = ch;
|
||||
col ++;
|
||||
|
||||
- if (col > (PPD_MAX_LINE - 1))
|
||||
+ if (col > (PPD_MAX_LINE - 1) && cg->ppd_conform == PPD_CONFORM_STRICT)
|
||||
{
|
||||
/*
|
||||
* Line is too long...
|
||||
@@ -2847,7 +2847,7 @@ ppd_read(cups_file_t *fp, /* I - Fil
|
||||
{
|
||||
col ++;
|
||||
|
||||
- if (col > (PPD_MAX_LINE - 1))
|
||||
+ if (col > (PPD_MAX_LINE - 1) && cg->ppd_conform == PPD_CONFORM_STRICT)
|
||||
{
|
||||
/*
|
||||
* Line is too long...
|
||||
@@ -2906,7 +2906,7 @@ ppd_read(cups_file_t *fp, /* I - Fil
|
||||
{
|
||||
col ++;
|
||||
|
||||
- if (col > (PPD_MAX_LINE - 1))
|
||||
+ if (col > (PPD_MAX_LINE - 1) && cg->ppd_conform == PPD_CONFORM_STRICT)
|
||||
{
|
||||
/*
|
||||
* Line is too long...
|
38
srcpkgs/cups/patches/cups-system-auth.patch
Normal file
38
srcpkgs/cups/patches/cups-system-auth.patch
Normal file
|
@ -0,0 +1,38 @@
|
|||
diff -up cups-1.5b1/conf/cups.password-auth.system-auth cups-1.5b1/conf/cups.password-auth
|
||||
--- cups-1.5b1/conf/cups.password-auth.system-auth 2011-05-23 17:27:27.000000000 +0200
|
||||
+++ cups-1.5b1/conf/cups.password-auth 2011-05-23 17:27:27.000000000 +0200
|
||||
@@ -0,0 +1,4 @@
|
||||
+#%PAM-1.0
|
||||
+# Use password-auth common PAM configuration for the daemon
|
||||
+auth include password-auth
|
||||
+account include password-auth
|
||||
diff -up cups-1.5b1/conf/cups.system-auth.system-auth cups-1.5b1/conf/cups.system-auth
|
||||
--- cups-1.5b1/conf/cups.system-auth.system-auth 2011-05-23 17:27:27.000000000 +0200
|
||||
+++ cups-1.5b1/conf/cups.system-auth 2011-05-23 17:27:27.000000000 +0200
|
||||
@@ -0,0 +1,3 @@
|
||||
+#%PAM-1.0
|
||||
+auth include system-auth
|
||||
+account include system-auth
|
||||
diff -up cups-1.5b1/conf/Makefile.system-auth cups-1.5b1/conf/Makefile
|
||||
--- cups-1.5b1/conf/Makefile.system-auth 2011-05-12 07:21:56.000000000 +0200
|
||||
+++ cups-1.5b1/conf/Makefile 2011-05-23 17:27:27.000000000 +0200
|
||||
@@ -90,10 +90,16 @@ install-data:
|
||||
done
|
||||
-if test x$(PAMDIR) != x; then \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(PAMDIR); \
|
||||
- if test -r $(BUILDROOT)$(PAMDIR)/cups ; then \
|
||||
- $(INSTALL_DATA) $(PAMFILE) $(BUILDROOT)$(PAMDIR)/cups.N ; \
|
||||
+ if test -f /etc/pam.d/password-auth; then \
|
||||
+ $(INSTALL_DATA) cups.password-auth $(BUILDROOT)$(PAMDIR)/cups; \
|
||||
+ elif test -f /etc/pam.d/system-auth; then \
|
||||
+ $(INSTALL_DATA) cups.system-auth $(BUILDROOT)$(PAMDIR)/cups; \
|
||||
else \
|
||||
- $(INSTALL_DATA) $(PAMFILE) $(BUILDROOT)$(PAMDIR)/cups ; \
|
||||
+ if test -r $(BUILDROOT)$(PAMDIR)/cups ; then \
|
||||
+ $(INSTALL_DATA) $(PAMFILE) $(BUILDROOT)$(PAMDIR)/cups.N ; \
|
||||
+ else \
|
||||
+ $(INSTALL_DATA) $(PAMFILE) $(BUILDROOT)$(PAMDIR)/cups ; \
|
||||
+ fi ; \
|
||||
fi ; \
|
||||
fi
|
||||
|
527
srcpkgs/cups/patches/cups-systemd-socket.patch
Normal file
527
srcpkgs/cups/patches/cups-systemd-socket.patch
Normal file
|
@ -0,0 +1,527 @@
|
|||
diff -up cups-1.5.2/config.h.in.systemd-socket cups-1.5.2/config.h.in
|
||||
--- cups-1.5.2/config.h.in.systemd-socket 2012-03-16 14:50:57.089449755 +0000
|
||||
+++ cups-1.5.2/config.h.in 2012-03-16 14:50:57.146449787 +0000
|
||||
@@ -503,6 +503,13 @@
|
||||
|
||||
|
||||
/*
|
||||
+ * Do we have systemd support?
|
||||
+ */
|
||||
+
|
||||
+#undef HAVE_SYSTEMD
|
||||
+
|
||||
+
|
||||
+/*
|
||||
* Various scripting languages...
|
||||
*/
|
||||
|
||||
diff -up cups-1.5.2/config-scripts/cups-systemd.m4.systemd-socket cups-1.5.2/config-scripts/cups-systemd.m4
|
||||
--- cups-1.5.2/config-scripts/cups-systemd.m4.systemd-socket 2012-03-16 14:50:57.146449787 +0000
|
||||
+++ cups-1.5.2/config-scripts/cups-systemd.m4 2012-03-16 14:50:57.146449787 +0000
|
||||
@@ -0,0 +1,36 @@
|
||||
+dnl
|
||||
+dnl "$Id$"
|
||||
+dnl
|
||||
+dnl systemd stuff for CUPS.
|
||||
+
|
||||
+dnl Find whether systemd is available
|
||||
+
|
||||
+SDLIBS=""
|
||||
+AC_ARG_WITH([systemdsystemunitdir],
|
||||
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
|
||||
+ [], [with_systemdsystemunitdir=$($PKGCONFIG --variable=systemdsystemunitdir systemd)])
|
||||
+if test "x$with_systemdsystemunitdir" != xno; then
|
||||
+ AC_MSG_CHECKING(for libsystemd-daemon)
|
||||
+ if $PKGCONFIG --exists libsystemd-daemon; then
|
||||
+ AC_MSG_RESULT(yes)
|
||||
+ SDCFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
|
||||
+ SDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
|
||||
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
|
||||
+ AC_DEFINE(HAVE_SYSTEMD)
|
||||
+ else
|
||||
+ AC_MSG_RESULT(no)
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then
|
||||
+ SYSTEMD_UNITS="cups.service cups.socket cups.path"
|
||||
+else
|
||||
+ SYSTEMD_UNITS=""
|
||||
+fi
|
||||
+
|
||||
+AC_SUBST(SYSTEMD_UNITS)
|
||||
+AC_SUBST(SDLIBS)
|
||||
+
|
||||
+dnl
|
||||
+dnl "$Id$"
|
||||
+dnl
|
||||
diff -up cups-1.5.2/configure.in.systemd-socket cups-1.5.2/configure.in
|
||||
--- cups-1.5.2/configure.in.systemd-socket 2011-08-31 02:36:33.000000000 +0100
|
||||
+++ cups-1.5.2/configure.in 2012-03-16 14:50:57.146449787 +0000
|
||||
@@ -37,6 +37,7 @@ sinclude(config-scripts/cups-pam.m4)
|
||||
sinclude(config-scripts/cups-largefile.m4)
|
||||
sinclude(config-scripts/cups-dnssd.m4)
|
||||
sinclude(config-scripts/cups-launchd.m4)
|
||||
+sinclude(config-scripts/cups-systemd.m4)
|
||||
sinclude(config-scripts/cups-defaults.m4)
|
||||
sinclude(config-scripts/cups-pdf.m4)
|
||||
sinclude(config-scripts/cups-scripting.m4)
|
||||
@@ -71,6 +72,9 @@ AC_OUTPUT(Makedefs
|
||||
conf/snmp.conf
|
||||
cups-config
|
||||
data/testprint
|
||||
+ data/cups.service
|
||||
+ data/cups.socket
|
||||
+ data/cups.path
|
||||
desktop/cups.desktop
|
||||
doc/help/ref-cupsd-conf.html
|
||||
doc/help/standard.html
|
||||
diff -up cups-1.5.2/cups/usersys.c.systemd-socket cups-1.5.2/cups/usersys.c
|
||||
--- cups-1.5.2/cups/usersys.c.systemd-socket 2012-03-16 14:50:57.054449734 +0000
|
||||
+++ cups-1.5.2/cups/usersys.c 2012-03-16 14:50:57.148449788 +0000
|
||||
@@ -778,7 +778,7 @@ cups_read_client_conf(
|
||||
struct stat sockinfo; /* Domain socket information */
|
||||
|
||||
if (!stat(CUPS_DEFAULT_DOMAINSOCKET, &sockinfo) &&
|
||||
- (sockinfo.st_mode & S_IRWXO) == S_IRWXO)
|
||||
+ (sockinfo.st_mode & (S_IROTH | S_IWOTH)) == (S_IROTH | S_IWOTH))
|
||||
cups_server = CUPS_DEFAULT_DOMAINSOCKET;
|
||||
else
|
||||
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
|
||||
diff -up cups-1.5.2/data/cups.path.in.systemd-socket cups-1.5.2/data/cups.path.in
|
||||
--- cups-1.5.2/data/cups.path.in.systemd-socket 2012-03-16 14:50:57.148449788 +0000
|
||||
+++ cups-1.5.2/data/cups.path.in 2012-03-16 14:50:57.148449788 +0000
|
||||
@@ -0,0 +1,8 @@
|
||||
+[Unit]
|
||||
+Description=CUPS Printer Service Spool
|
||||
+
|
||||
+[Path]
|
||||
+PathExistsGlob=@CUPS_REQUESTS@/d*
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=multi-user.target
|
||||
diff -up cups-1.5.2/data/cups.service.in.systemd-socket cups-1.5.2/data/cups.service.in
|
||||
--- cups-1.5.2/data/cups.service.in.systemd-socket 2012-03-16 14:50:57.149449788 +0000
|
||||
+++ cups-1.5.2/data/cups.service.in 2012-03-16 14:50:57.149449788 +0000
|
||||
@@ -0,0 +1,10 @@
|
||||
+[Unit]
|
||||
+Description=CUPS Printing Service
|
||||
+
|
||||
+[Service]
|
||||
+ExecStart=@sbindir@/cupsd -f
|
||||
+PrivateTmp=true
|
||||
+
|
||||
+[Install]
|
||||
+Also=cups.socket cups.path
|
||||
+WantedBy=printer.target
|
||||
diff -up cups-1.5.2/data/cups.socket.in.systemd-socket cups-1.5.2/data/cups.socket.in
|
||||
--- cups-1.5.2/data/cups.socket.in.systemd-socket 2012-03-16 14:50:57.150449788 +0000
|
||||
+++ cups-1.5.2/data/cups.socket.in 2012-03-16 14:50:57.150449788 +0000
|
||||
@@ -0,0 +1,11 @@
|
||||
+[Unit]
|
||||
+Description=CUPS Printing Service Sockets
|
||||
+
|
||||
+[Socket]
|
||||
+ListenStream=@CUPS_DEFAULT_DOMAINSOCKET@
|
||||
+ListenStream=631
|
||||
+ListenDatagram=0.0.0.0:631
|
||||
+BindIPv6Only=ipv6-only
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=sockets.target
|
||||
diff -up cups-1.5.2/data/Makefile.systemd-socket cups-1.5.2/data/Makefile
|
||||
--- cups-1.5.2/data/Makefile.systemd-socket 2011-05-12 06:21:56.000000000 +0100
|
||||
+++ cups-1.5.2/data/Makefile 2012-03-16 14:50:57.151449789 +0000
|
||||
@@ -112,6 +112,12 @@ install-data:
|
||||
$(INSTALL_DATA) $$file $(DATADIR)/ppdc; \
|
||||
done
|
||||
$(INSTALL_DIR) -m 755 $(DATADIR)/profiles
|
||||
+ if test "x$(SYSTEMD_UNITS)" != "x" ; then \
|
||||
+ $(INSTALL_DIR) -m 755 $(SYSTEMDUNITDIR); \
|
||||
+ for file in $(SYSTEMD_UNITS); do \
|
||||
+ $(INSTALL_DATA) $$file $(SYSTEMDUNITDIR); \
|
||||
+ done; \
|
||||
+ fi
|
||||
|
||||
|
||||
#
|
||||
@@ -159,6 +165,9 @@ uninstall:
|
||||
-$(RMDIR) $(DATADIR)/charsets
|
||||
-$(RMDIR) $(DATADIR)/banners
|
||||
-$(RMDIR) $(DATADIR)
|
||||
+ for file in $(SYSTEMD_UNITS); do \
|
||||
+ $(RM) $(SYSTEMDUNITDIR)/$$file; \
|
||||
+ done
|
||||
|
||||
|
||||
#
|
||||
diff -up cups-1.5.2/Makedefs.in.systemd-socket cups-1.5.2/Makedefs.in
|
||||
--- cups-1.5.2/Makedefs.in.systemd-socket 2012-03-16 14:50:57.081449751 +0000
|
||||
+++ cups-1.5.2/Makedefs.in 2012-03-16 14:50:57.152449790 +0000
|
||||
@@ -143,6 +143,7 @@ CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@
|
||||
CXXLIBS = @CXXLIBS@
|
||||
DBUS_NOTIFIER = @DBUS_NOTIFIER@
|
||||
DBUS_NOTIFIERLIBS = @DBUS_NOTIFIERLIBS@
|
||||
+SYSTEMD_UNITS = @SYSTEMD_UNITS@
|
||||
DNSSD_BACKEND = @DNSSD_BACKEND@
|
||||
DSOFLAGS = -L../cups @DSOFLAGS@
|
||||
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
|
||||
@@ -151,6 +152,7 @@ FONTS = @FONTS@
|
||||
IMGLIBS = @IMGLIBS@
|
||||
IMGFILTERS = @IMGFILTERS@
|
||||
LAUNCHDLIBS = @LAUNCHDLIBS@
|
||||
+SDLIBS = @SDLIBS@
|
||||
LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \
|
||||
-L../scheduler @LDARCHFLAGS@ \
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
@@ -267,6 +269,7 @@ PAMFILE = @PAMFILE@
|
||||
|
||||
DEFAULT_LAUNCHD_CONF = @DEFAULT_LAUNCHD_CONF@
|
||||
DBUSDIR = @DBUSDIR@
|
||||
+SYSTEMDUNITDIR = $(BUILDROOT)@systemdsystemunitdir@
|
||||
|
||||
|
||||
#
|
||||
diff -up cups-1.5.2/scheduler/client.h.systemd-socket cups-1.5.2/scheduler/client.h
|
||||
--- cups-1.5.2/scheduler/client.h.systemd-socket 2011-03-25 21:25:38.000000000 +0000
|
||||
+++ cups-1.5.2/scheduler/client.h 2012-03-16 14:50:57.153449791 +0000
|
||||
@@ -75,6 +75,9 @@ typedef struct
|
||||
int fd; /* File descriptor for this server */
|
||||
http_addr_t address; /* Bind address of socket */
|
||||
http_encryption_t encryption; /* To encrypt or not to encrypt... */
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+ int is_systemd; /* Is this a systemd socket? */
|
||||
+#endif /* HAVE_SYSTEMD */
|
||||
} cupsd_listener_t;
|
||||
|
||||
|
||||
diff -up cups-1.5.2/scheduler/dirsvc.c.systemd-socket cups-1.5.2/scheduler/dirsvc.c
|
||||
--- cups-1.5.2/scheduler/dirsvc.c.systemd-socket 2012-03-16 14:50:57.112449768 +0000
|
||||
+++ cups-1.5.2/scheduler/dirsvc.c 2012-03-16 14:50:57.155449792 +0000
|
||||
@@ -1512,7 +1512,7 @@ cupsdStartBrowsing(void)
|
||||
}
|
||||
}
|
||||
|
||||
- if (BrowseSocket >= 0)
|
||||
+ if (BrowseSocket >= 0 && !BrowseSocketIsSystemd)
|
||||
{
|
||||
/*
|
||||
* Bind the socket to browse port...
|
||||
@@ -1556,13 +1556,17 @@ cupsdStartBrowsing(void)
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to set broadcast mode - %s.",
|
||||
strerror(errno));
|
||||
|
||||
+ if (!BrowseSocketIsSystemd)
|
||||
+ {
|
||||
#ifdef WIN32
|
||||
- closesocket(BrowseSocket);
|
||||
+ closesocket(BrowseSocket);
|
||||
#else
|
||||
- close(BrowseSocket);
|
||||
+ close(BrowseSocket);
|
||||
#endif /* WIN32 */
|
||||
|
||||
- BrowseSocket = -1;
|
||||
+ BrowseSocket = -1;
|
||||
+ }
|
||||
+
|
||||
BrowseLocalProtocols &= ~BROWSE_CUPS;
|
||||
BrowseRemoteProtocols &= ~BROWSE_CUPS;
|
||||
|
||||
@@ -1885,15 +1889,22 @@ cupsdStopBrowsing(void)
|
||||
if (((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_CUPS) &&
|
||||
BrowseSocket >= 0)
|
||||
{
|
||||
- /*
|
||||
- * Close the socket and remove it from the input selection set.
|
||||
- */
|
||||
+ if (!BrowseSocketIsSystemd)
|
||||
+ {
|
||||
+ /*
|
||||
+ * Close the socket.
|
||||
+ */
|
||||
|
||||
#ifdef WIN32
|
||||
- closesocket(BrowseSocket);
|
||||
+ closesocket(BrowseSocket);
|
||||
#else
|
||||
- close(BrowseSocket);
|
||||
+ close(BrowseSocket);
|
||||
#endif /* WIN32 */
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Remove it from the input selection set.
|
||||
+ */
|
||||
|
||||
cupsdRemoveSelect(BrowseSocket);
|
||||
BrowseSocket = -1;
|
||||
@@ -5693,11 +5704,14 @@ update_cups_browse(void)
|
||||
strerror(errno));
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "CUPS browsing turned off.");
|
||||
|
||||
+ if (!BrowseSocketIsSystemd)
|
||||
+ {
|
||||
#ifdef WIN32
|
||||
- closesocket(BrowseSocket);
|
||||
+ closesocket(BrowseSocket);
|
||||
#else
|
||||
- close(BrowseSocket);
|
||||
+ close(BrowseSocket);
|
||||
#endif /* WIN32 */
|
||||
+ }
|
||||
|
||||
cupsdRemoveSelect(BrowseSocket);
|
||||
BrowseSocket = -1;
|
||||
diff -up cups-1.5.2/scheduler/dirsvc.h.systemd-socket cups-1.5.2/scheduler/dirsvc.h
|
||||
--- cups-1.5.2/scheduler/dirsvc.h.systemd-socket 2012-03-16 14:50:57.113449769 +0000
|
||||
+++ cups-1.5.2/scheduler/dirsvc.h 2012-03-16 14:50:57.157449792 +0000
|
||||
@@ -100,6 +100,8 @@ VAR int Browsing VALUE(TRUE),
|
||||
/* Short names for remote printers? */
|
||||
BrowseSocket VALUE(-1),
|
||||
/* Socket for browsing */
|
||||
+ BrowseSocketIsSystemd VALUE(0),
|
||||
+ /* BrowseSocket is systemd-provided? */
|
||||
BrowsePort VALUE(IPP_PORT),
|
||||
/* Port number for broadcasts */
|
||||
BrowseInterval VALUE(DEFAULT_INTERVAL),
|
||||
diff -up cups-1.5.2/scheduler/listen.c.systemd-socket cups-1.5.2/scheduler/listen.c
|
||||
--- cups-1.5.2/scheduler/listen.c.systemd-socket 2011-04-16 00:38:13.000000000 +0100
|
||||
+++ cups-1.5.2/scheduler/listen.c 2012-03-16 14:50:57.158449792 +0000
|
||||
@@ -401,7 +401,11 @@ cupsdStopListening(void)
|
||||
lis;
|
||||
lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
|
||||
{
|
||||
- if (lis->fd != -1)
|
||||
+ if (lis->fd != -1
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+ && !lis->is_systemd
|
||||
+#endif /* HAVE_SYSTEMD */
|
||||
+ )
|
||||
{
|
||||
#ifdef WIN32
|
||||
closesocket(lis->fd);
|
||||
diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
--- cups-1.5.2/scheduler/main.c.systemd-socket 2012-03-16 14:50:57.121449773 +0000
|
||||
+++ cups-1.5.2/scheduler/main.c 2012-03-16 14:51:55.409483636 +0000
|
||||
@@ -26,6 +26,8 @@
|
||||
* launchd_checkin() - Check-in with launchd and collect the listening
|
||||
* fds.
|
||||
* launchd_checkout() - Update the launchd KeepAlive file as needed.
|
||||
+ * systemd_checkin() - Check-in with systemd and collect the
|
||||
+ * listening fds.
|
||||
* parent_handler() - Catch USR1/CHLD signals...
|
||||
* process_children() - Process all dead children...
|
||||
* select_timeout() - Calculate the select timeout value.
|
||||
@@ -62,6 +64,10 @@
|
||||
# endif /* !LAUNCH_JOBKEY_SERVICEIPC */
|
||||
#endif /* HAVE_LAUNCH_H */
|
||||
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+#include <systemd/sd-daemon.h>
|
||||
+#endif /* HAVE_SYSTEMD */
|
||||
+
|
||||
#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
|
||||
# include <malloc.h>
|
||||
#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */
|
||||
@@ -78,6 +84,9 @@
|
||||
static void launchd_checkin(void);
|
||||
static void launchd_checkout(void);
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+static void systemd_checkin(void);
|
||||
+#endif /* HAVE_SYSTEMD */
|
||||
static void parent_handler(int sig);
|
||||
static void process_children(void);
|
||||
static void sigchld_handler(int sig);
|
||||
@@ -537,6 +546,13 @@ main(int argc, /* I - Number of comm
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+ /*
|
||||
+ * If we were started by systemd get the listen sockets file descriptors...
|
||||
+ */
|
||||
+ systemd_checkin();
|
||||
+#endif /* HAVE_SYSTEMD */
|
||||
+
|
||||
/*
|
||||
* Startup the server...
|
||||
*/
|
||||
@@ -759,6 +775,15 @@ main(int argc, /* I - Number of comm
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+ /*
|
||||
+ * If we were started by systemd get the listen sockets file
|
||||
+ * descriptors...
|
||||
+ */
|
||||
+
|
||||
+ systemd_checkin();
|
||||
+#endif /* HAVE_SYSTEMD */
|
||||
+
|
||||
/*
|
||||
* Startup the server...
|
||||
*/
|
||||
@@ -1584,6 +1609,139 @@ launchd_checkout(void)
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+static void
|
||||
+systemd_checkin(void)
|
||||
+{
|
||||
+ int n, fd;
|
||||
+
|
||||
+ n = sd_listen_fds(0);
|
||||
+ if (n < 0)
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Failed to acquire sockets from systemd - %s",
|
||||
+ strerror(-n));
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (n == 0)
|
||||
+ return;
|
||||
+
|
||||
+ for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd ++)
|
||||
+ {
|
||||
+ http_addr_t addr;
|
||||
+ socklen_t addrlen = sizeof (addr);
|
||||
+ int r;
|
||||
+ cupsd_listener_t *lis;
|
||||
+ char s[256];
|
||||
+
|
||||
+ r = sd_is_socket(fd, AF_UNSPEC, SOCK_STREAM, 1);
|
||||
+ if (r < 0)
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Unable to verify socket type - %s",
|
||||
+ strerror(-r));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (!r)
|
||||
+ {
|
||||
+ if (Browsing &&
|
||||
+ ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_CUPS))
|
||||
+ {
|
||||
+ r = sd_is_socket(fd, AF_UNSPEC, SOCK_DGRAM, 0);
|
||||
+ if (r < 0)
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Unable to verify socket type - %s",
|
||||
+ strerror(-r));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (r)
|
||||
+ {
|
||||
+ /*
|
||||
+ * This is the browse socket.
|
||||
+ */
|
||||
+
|
||||
+ char addrstr[256];
|
||||
+ if (getsockname(fd, (struct sockaddr*) &addr, &addrlen))
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Unable to get local address - %s",
|
||||
+ strerror(errno));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ httpAddrString (&addr, addrstr, sizeof (addrstr));
|
||||
+ BrowseSocket = fd;
|
||||
+ BrowseSocketIsSystemd = 1;
|
||||
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
+ "systemd_checkin: Matched browse (port %d) with fd %d:%s...",
|
||||
+ BrowsePort, fd, addrstr);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Socket not of the right type");
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (getsockname(fd, (struct sockaddr*) &addr, &addrlen))
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Unable to get local address - %s",
|
||||
+ strerror(errno));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Try to match the systemd socket address to one of the listeners...
|
||||
+ */
|
||||
+
|
||||
+ for (lis = (cupsd_listener_t *)cupsArrayFirst(Listeners);
|
||||
+ lis;
|
||||
+ lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
|
||||
+ if (httpAddrEqual(&lis->address, &addr))
|
||||
+ break;
|
||||
+
|
||||
+ if (lis)
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
+ "systemd_checkin: Matched existing listener %s with fd %d...",
|
||||
+ httpAddrString(&(lis->address), s, sizeof(s)), fd);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
+ "systemd_checkin: Adding new listener %s with fd %d...",
|
||||
+ httpAddrString(&addr, s, sizeof(s)), fd);
|
||||
+
|
||||
+ if ((lis = calloc(1, sizeof(cupsd_listener_t))) == NULL)
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Unable to allocate listener - "
|
||||
+ "%s.", strerror(errno));
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ }
|
||||
+
|
||||
+ cupsArrayAdd(Listeners, lis);
|
||||
+
|
||||
+ memcpy(&lis->address, &addr, sizeof(lis->address));
|
||||
+ }
|
||||
+
|
||||
+ lis->fd = fd;
|
||||
+ lis->is_systemd = 1;
|
||||
+
|
||||
+# ifdef HAVE_SSL
|
||||
+ if (_httpAddrPort(&(lis->address)) == 443)
|
||||
+ lis->encryption = HTTP_ENCRYPT_ALWAYS;
|
||||
+# endif /* HAVE_SSL */
|
||||
+ }
|
||||
+}
|
||||
+#endif /* HAVE_SYSTEMD */
|
||||
|
||||
/*
|
||||
* 'parent_handler()' - Catch USR1/CHLD signals...
|
||||
diff -up cups-1.5.2/scheduler/Makefile.systemd-socket cups-1.5.2/scheduler/Makefile
|
||||
--- cups-1.5.2/scheduler/Makefile.systemd-socket 2012-03-16 14:50:57.130449778 +0000
|
||||
+++ cups-1.5.2/scheduler/Makefile 2012-03-16 14:50:57.160449794 +0000
|
||||
@@ -382,7 +382,7 @@ cupsd: $(CUPSDOBJS) $(LIBCUPSMIME) ../cu
|
||||
$(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) -L. -lcupsmime \
|
||||
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
|
||||
$(LIBPAPER) $(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBS) \
|
||||
- $(LIBGSSAPI) $(LIBWRAP)
|
||||
+ $(LIBGSSAPI) $(LIBWRAP) $(SDLIBS)
|
||||
|
||||
cupsd-static: $(CUPSDOBJS) libcupsmime.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
@@ -390,7 +390,7 @@ cupsd-static: $(CUPSDOBJS) libcupsmime.a
|
||||
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \
|
||||
$(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBGSSAPI) \
|
||||
- $(LIBWRAP)
|
||||
+ $(LIBWRAP) $(SDLIBS)
|
||||
|
||||
|
||||
#
|
51
srcpkgs/cups/patches/cups-uri-compat.patch
Normal file
51
srcpkgs/cups/patches/cups-uri-compat.patch
Normal file
|
@ -0,0 +1,51 @@
|
|||
diff -up cups-1.5b1/backend/usb-unix.c.uri-compat cups-1.5b1/backend/usb-unix.c
|
||||
--- cups-1.5b1/backend/usb-unix.c.uri-compat 2011-05-24 15:59:05.000000000 +0200
|
||||
+++ cups-1.5b1/backend/usb-unix.c 2011-05-24 16:02:03.000000000 +0200
|
||||
@@ -63,11 +63,34 @@ print_device(const char *uri, /* I - De
|
||||
int device_fd; /* USB device */
|
||||
ssize_t tbytes; /* Total number of bytes written */
|
||||
struct termios opts; /* Parallel port options */
|
||||
+ char *fixed_uri = strdup (uri);
|
||||
+ char *p;
|
||||
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
+ p = strchr (fixed_uri, ':');
|
||||
+ if (p++ != NULL)
|
||||
+ {
|
||||
+ char *e;
|
||||
+ p += strspn (p, "/");
|
||||
+ e = strchr (p, '/');
|
||||
+ if (e > p)
|
||||
+ {
|
||||
+ size_t mfrlen = e - p;
|
||||
+ e++;
|
||||
+ if (!strncasecmp (e, p, mfrlen))
|
||||
+ {
|
||||
+ char *x = e + mfrlen;
|
||||
+ if (!strncmp (x, "%20", 3))
|
||||
+ /* Take mfr name out of mdl name for compatibility with
|
||||
+ * Fedora 11 before bug #507244 was fixed. */
|
||||
+ strcpy (e, x + 3); puts(fixed_uri);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Open the USB port device...
|
||||
*/
|
||||
@@ -107,10 +130,10 @@ print_device(const char *uri, /* I - De
|
||||
_cups_strncasecmp(hostname, "Minolta", 7);
|
||||
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
|
||||
|
||||
- if (use_bc && !strncmp(uri, "usb:/dev/", 9))
|
||||
+ if (use_bc && !strncmp(fixed_uri, "usb:/dev/", 9))
|
||||
use_bc = 0;
|
||||
|
||||
- if ((device_fd = open_device(uri, &use_bc)) == -1)
|
||||
+ if ((device_fd = open_device(fixed_uri, &use_bc)) == -1)
|
||||
{
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
52
srcpkgs/cups/patches/cups-usb-paperout.patch
Normal file
52
srcpkgs/cups/patches/cups-usb-paperout.patch
Normal file
|
@ -0,0 +1,52 @@
|
|||
diff -up cups-1.5b1/backend/usb-unix.c.usb-paperout cups-1.5b1/backend/usb-unix.c
|
||||
--- cups-1.5b1/backend/usb-unix.c.usb-paperout 2011-05-24 15:51:39.000000000 +0200
|
||||
+++ cups-1.5b1/backend/usb-unix.c 2011-05-24 15:51:39.000000000 +0200
|
||||
@@ -30,6 +30,11 @@
|
||||
|
||||
#include <sys/select.h>
|
||||
|
||||
+#ifdef __linux
|
||||
+#include <sys/ioctl.h>
|
||||
+#include <linux/lp.h>
|
||||
+#endif /* __linux */
|
||||
+
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
@@ -334,7 +339,19 @@ open_device(const char *uri, /* I - Dev
|
||||
if (!strncmp(uri, "usb:/dev/", 9))
|
||||
#ifdef __linux
|
||||
{
|
||||
- return (open(uri + 4, O_RDWR | O_EXCL));
|
||||
+ fd = open(uri + 4, O_RDWR | O_EXCL);
|
||||
+
|
||||
+ if (fd != -1)
|
||||
+ {
|
||||
+ /*
|
||||
+ * Tell the driver to return from write() with errno==ENOSPACE
|
||||
+ * on paper-out.
|
||||
+ */
|
||||
+ unsigned int t = 1;
|
||||
+ ioctl (fd, LPABORT, &t);
|
||||
+ }
|
||||
+
|
||||
+ return fd;
|
||||
}
|
||||
else if (!strncmp(uri, "usb://", 6))
|
||||
{
|
||||
@@ -400,7 +417,14 @@ open_device(const char *uri, /* I - Dev
|
||||
if (!strcmp(uri, device_uri))
|
||||
{
|
||||
/*
|
||||
- * Yes, return this file descriptor...
|
||||
+ * Yes, tell the driver to return from write() with
|
||||
+ * errno==ENOSPACE on paper-out.
|
||||
+ */
|
||||
+ unsigned int t = 1;
|
||||
+ ioctl (fd, LPABORT, &t);
|
||||
+
|
||||
+ /*
|
||||
+ * Return this file descriptor...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Printer using device file \"%s\"...\n",
|
93
srcpkgs/cups/template
Normal file
93
srcpkgs/cups/template
Normal file
|
@ -0,0 +1,93 @@
|
|||
# Template file for 'cups'
|
||||
pkgname=cups
|
||||
version=1.5.3
|
||||
patch_args="-Np1"
|
||||
homepage="http://www.cups.org/"
|
||||
license="GPL-2"
|
||||
distfiles="ftp://ftp.easysw.com/pub/cups/${version}/cups-${version}-source.tar.bz2"
|
||||
short_desc="Common Unix Printing System"
|
||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||
checksum=9d716a8ffcefdaff1c37f4a4b590f1d74ff9ff72383a18f3c883c9235907f93d
|
||||
long_desc="
|
||||
The Common UNIX Printing System (or CUPS(tm)) is a printing system and general
|
||||
replacement for lpd and the like. It supports the Internet Printing Protocol
|
||||
(IPP), and has its own filtering driver model for handling various document types."
|
||||
|
||||
make_dirs="
|
||||
/var/cache/cups/rss 0750 root root
|
||||
/var/run/cups/certs 0750 root root
|
||||
/var/log/cups 0750 root root
|
||||
/var/spool/cups/tmp 0750 root root
|
||||
/etc/cups/ssl 0700 root lp"
|
||||
|
||||
systemd_services="cups.service on"
|
||||
gtk_iconcache_dirs="/usr/share/icons/hicolor"
|
||||
|
||||
conf_files="
|
||||
/etc/cups/cups.conf
|
||||
/etc/cups/snmp.conf
|
||||
/etc/cups/printers.conf
|
||||
/etc/cups/classes.conf
|
||||
/etc/cups/client.conf
|
||||
/etc/cups/subscriptions.conf
|
||||
/etc/dbus-1/system.d/cups.conf
|
||||
/etc/logrotate.d/cups
|
||||
/etc/pam.d/cups"
|
||||
|
||||
subpackages="libcups cups-devel"
|
||||
|
||||
Add_dependency build automake
|
||||
Add_dependency build acl-devel
|
||||
Add_dependency build jpeg-devel
|
||||
Add_dependency build libpng-devel
|
||||
Add_dependency build tiff-devel
|
||||
Add_dependency build openssl-devel
|
||||
Add_dependency build pam-devel
|
||||
Add_dependency build mit-krb5-devel
|
||||
Add_dependency build poppler-devel
|
||||
Add_dependency build libusb-devel
|
||||
Add_dependency build avahi-libs-devel
|
||||
Add_dependency build systemd-devel
|
||||
|
||||
pre_configure() {
|
||||
aclocal -I config-scripts
|
||||
autoconf -I config-scripts
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
./configure ${CONFIGURE_SHARED_ARGS} --libdir=/usr/lib \
|
||||
--enable-acl --enable-dbus --enable-raw-printing \
|
||||
--disable-gnutls --enable-threads --with-logdir=/var/log/cups \
|
||||
--with-docdir=/usr/share/cups/doc --with-cups-user=daemon \
|
||||
--with-cups-group=lp --enable-pam=yes --disable-ldap \
|
||||
--enable-avahi --enable-pam --enable-ssl \
|
||||
--with-systemdsystemunitdir=/lib/systemd/system
|
||||
}
|
||||
|
||||
do_build() {
|
||||
make ${makejobs}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
make BUILDROOT=${DESTDIR} install
|
||||
# Remove sysvinit scripts.
|
||||
rm -rf ${DESTDIR}/etc/rc.d
|
||||
# Serial backend needs to run as root (Fedora bug #212577).
|
||||
chmod 700 ${DESTDIR}/usr/lib/cups/backend/serial
|
||||
# compress some driver files, adopted from Fedora
|
||||
find ${DESTDIR}/usr/share/cups/model -name "*.ppd"|xargs gzip -n9f
|
||||
# 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
|
||||
done
|
||||
echo "# see 'man client.conf'" >> ${DESTDIR}/etc/cups/client.conf
|
||||
echo "ServerName /var/run/cups/cups.sock" >> ${DESTDIR}/etc/cups/client.conf
|
||||
echo "# alternative: ServerName hostname-or-ip-address[:port] of a remote server" >> \
|
||||
${DESTDIR}/etc/cups/client.conf
|
||||
# fix .desktop file
|
||||
sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' \
|
||||
${DESTDIR}/usr/share/applications/cups.desktop
|
||||
# Install pam and logrotate files.
|
||||
vinstall ${FILESDIR}/cups.pam 644 etc/pam.d cups
|
||||
vinstall ${FILESDIR}/cups.logrotate 644 etc/logrotate.d cups
|
||||
}
|
1
srcpkgs/libcups
Symbolic link
1
srcpkgs/libcups
Symbolic link
|
@ -0,0 +1 @@
|
|||
cups
|
Loading…
Reference in a new issue