Package: cups-filters
Version: 1.0.42-1
Severity: serious
The latest upload of cups-filters failed to build on kfreebsd-*
filter/foomatic-rip/foomaticrip.c:159:6: error: conflicting types for 'gspath'
char gspath[PATH_MAX] = "gs";
^
In file included from filter/foomatic-rip/foomaticrip.c:24:0:
filter/foomatic-rip/foomaticrip.h:114:13: note: previous declaration of
'gspath' was here
extern char gspath[PATH_MAX];
^
filter/foomatic-rip/foomaticrip.c:164:6: error: conflicting types for 'echopath'
char echopath[PATH_MAX] = "echo";
^
In file included from filter/foomatic-rip/foomaticrip.c:24:0:
filter/foomatic-rip/foomaticrip.h:115:13: note: previous declaration of
'echopath' was here
extern char echopath[PATH_MAX];
^
filter/foomatic-rip/foomaticrip.c:167:6: error: conflicting types for
'cupsfilterpath'
char cupsfilterpath[PATH_MAX] = "/usr/local/lib/cups/filter:"
^
In file included from filter/foomatic-rip/foomaticrip.c:24:0:
filter/foomatic-rip/foomaticrip.h:108:13: note: previous declaration of
'cupsfilterpath' was here
extern char cupsfilterpath[PATH_MAX];
Reading the preprocessed output reveals that the cause is varying values
of PATH_MAX at different positions in the code. foomaticrip.h defines
PATH_MAX to 65536. However the system headers that are included later
by foomaticrip.c redefine it to 1024.
I made a patch to use the system PATH_MAX where available and this
fixed the build but I would be reluctant to use it without understanding
why things were done the way they were done in the first place.
Especially as the value used in in foomatic-rip.h does not match the
system value on linux.
filer/foomatic-rip does not exist in the testing version of the
package so I do not expect this bug directly affects testing.
However the version of cups in testing has build-depends which
are not satisfiable by the version of cups-filters in testing so
this needs to be dealt with before release.
diff -Nru cups-filters-1.0.42/debian/changelog
cups-filters-1.0.42/debian/changelog
--- cups-filters-1.0.42/debian/changelog 2013-12-06 22:36:35.000000000
+0000
+++ cups-filters-1.0.42/debian/changelog 2013-12-07 23:48:51.000000000
+0000
@@ -1,3 +1,10 @@
+cups-filters (1.0.42-1plugwash1) UNRELEASED; urgency=low
+
+ * Modify foomaticrip.h to use system header for PATH_MAX rather
+ than defining it's own version which conflicts on kfreebsd.
+
+ -- root <root@debian-kfbsd-amd64> Sat, 07 Dec 2013 23:47:52 +0000
+
cups-filters (1.0.42-1) unstable; urgency=low
* New upstream release 1.0.42:
diff -Nru cups-filters-1.0.42/debian/patches/series
cups-filters-1.0.42/debian/patches/series
--- cups-filters-1.0.42/debian/patches/series 2013-12-06 23:01:34.000000000
+0000
+++ cups-filters-1.0.42/debian/patches/series 2013-12-07 23:49:40.000000000
+0000
@@ -1 +1,2 @@
fix-pdf-landscape-printing.patch
+use-system-path-max.patch
diff -Nru cups-filters-1.0.42/debian/patches/use-system-path-max.patch
cups-filters-1.0.42/debian/patches/use-system-path-max.patch
--- cups-filters-1.0.42/debian/patches/use-system-path-max.patch
1970-01-01 01:00:00.000000000 +0100
+++ cups-filters-1.0.42/debian/patches/use-system-path-max.patch
2013-12-08 00:01:31.000000000 +0000
@@ -0,0 +1,45 @@
+Description: use system PATH_MAX
+ Modify foomaticrip.h to use limits.h for PATH_MAX rather
+ than defining it's own version which conflicts on kfreebsd.
+
+ Continue to define own version if PATH_MAX is not defined
+ by limits.h to avoid breaking the build on hurd.
+Author: Peter Michael Green <plugw...@.debian.org>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: http://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+Index: cups-filters-1.0.42/filter/foomatic-rip/foomaticrip.h
+===================================================================
+--- cups-filters-1.0.42.orig/filter/foomatic-rip/foomaticrip.h 2013-12-07
23:49:40.000000000 +0000
++++ cups-filters-1.0.42/filter/foomatic-rip/foomaticrip.h 2013-12-07
23:59:37.000000000 +0000
+@@ -33,6 +33,7 @@
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
++#include <limits.h>
+
+ /* This is the location of the debug logfile (and also the copy of the
+ * processed PostScript data) in case you have enabled debugging above.
+@@ -74,8 +75,9 @@
+ /* The spooler from which foomatic-rip was called. set in main() */
+ extern int spooler;
+
+-
+-#define PATH_MAX 65536
++#ifndef PATH_MAX
++ #define PATH_MAX 65536
++#endif
+
+ typedef struct {
+ char printer[256];