From 6fefeecb6abbb1f7dfe07ade1a0abef06dac5d32 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Sun, 23 May 2010 00:04:56 +0200 Subject: Imported Upstream version 3.0.2-20080211 --- ChangeLog | 109 ++++- README | 32 +- USAGE | 32 +- beh.in | 4 +- configure | 13 +- debian/README.Debian | 2 +- debian/control | 4 +- debian/copyright | 6 +- foomatic-gswrapper.1.in | 4 +- foomatic-gswrapper.in | 21 +- foomatic-rip.1.in | 12 +- foomatic-rip.in | 1156 +++++++++++++++++++++++++---------------------- 12 files changed, 794 insertions(+), 601 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ce4dd7..bc4063f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,110 @@ +2007-12-04 Till Kamppeter + + * foomatic-gswrapper.in: Let Ghostscript always use buffered + input. This works around a Ghostscript bug which prevents + printing encrypted PDF files with Adobe Reader 8.1.1 and + Ghostscript built as shared library (Ghostscript bug #689577, + Ubuntu bug #172264). + +2007-11-30 Till Kamppeter + + * foomatic-rip.in: More bug fixes: + o If the CUPS-style duples option + "-o sides={one|two}-sided[-{long|short}-edge]" was supplied, + the "Duplex" option could be set to "0", "LongEdge", or + "ShortEdge", which do not exist in the "Duplex" options in + PPD files (Thanks to Ricoh Japan for reporting this bug). + o Now all of "LongEdge", "DuplexNoTumble", or "ShortEdge", + "DuplexTumble", are converted to each other if supplied as + value to an enumerated choice option (usually "Duplex") and + this value is not in the list of choices. + o Removed the unused variable "$rangeend" from the + parsepageranges() function. + o Reset the best score for finding the narrowest page range + before treating each option, not only before the first + option. Now jobs with page overrides on more than one + option are executed correctly. + +2007-11-23 Till Kamppeter + + * foomatic-rip.in: Several fixes for bugs found while developing + the foomatic-rip test suite for the LSB 3.2: + o If an option had the default value "0" (enumerated choice, + numerical, string) in the PPD file, the first choice from + the list was set as default and not "0". + o When assigning a non-integer number to an integer option, + the "%%BeginFeature: ..." line of the option inserted into + the PostScript data stream still contained the non-integer + value. Only the value in the code piece was converted to + integer. + o If a non-integer "*FoomaticRIPDefault..." was given for an + integer option it was not converted to integer. + o Boolean options had "0" and "1" as values in the + "%%BeginFeature: ..." lines and not "False" and "True". + o PPD-supplied JCL/PJL options did not get merged with + driver-generated JCL/PJL options when there were spaces + between the JCL command and the "=" (ex: "@PJL SET TRAY = 1"). + o Now all of "0", "No", "Off", "False" or "1", "Yes", "On", + "True" are converted to each other if supplied as value to + an enumerated choice option and this value is not in the + list of choices. + +2007-10-11 Till Kamppeter + + * foomatic-rip.in: Allow the parameters of the "*Foomatic..." + lines which formerly had to be given without quotes also to be + given with double quotes. This is to support generation and + manipulation of Foomatic PPDs with the CUPS DDK. The PPD + generator of the CUPS DDK ("ppdc") can create these lines only + with quoted parameters (See http://www.cups.org/str.php?L2551). + +2007-07-18 Till Kamppeter + + * foomatic-rip.in: Added support for suppressing page accounting + on a per-driver basis. Page accounting is deactivated if a line + "*FoomaticNoPageAccounting: True" is found in the PPD file. + +2007-03-20 Till Kamppeter + + * foomatic-rip.in: Performance improvement: Do not match all forms + of DSC comments against every line. Check whether the line is a + DSC comment at all and pass it quickly through if not (Thanks to + Andreas Bolsch, Andreas dot Bolsch at alumni dot TU-Berlin dot + DE, for this patch). Will probably fix Ubuntu bug LP#78781 + (https://launchpad.net/bugs/78781). + + Fixed bug of custom page sizes not read from the PostScript code + when the size values are in more than one line (as the + "imagetops" CUPS filter outputs them when adapting a + user-supplied custom page size to the aspect ratio of the image, + to not waste roll paper). This fixes CUPS STR #1722 + (http://www.cups.org/str.php?L1722), Ubuntu bug LP#42234 + (https://launchpad.net/bugs/42234). + + Let data structure get written to debug log also if foomatic-rip + exits with an error (only in debug mode). + +2007-03-10 Till Kamppeter + + * foomatic-rip.in: Replaced sysread() and syswrite() by read() and + print() as sysread() and syswrite() is not compatible with the + read() and print() of the other operations. See Ubuntu bug #87597 + (https://launchpad.net/bugs/87597). + +2007-02-20 Till Kamppeter + + * foomatic-rip.in: Fixed problem of too high memory consumption + when binary output data of GhostScript is read line-wise and + does not contain line feeds (Ubuntu bug #85569 with driver + "eplaser", Red Hat bug #221194 with driver "lx5000"). Applied + same fix also to binary non-PostScript input data (only relevant + for non-CUPS printing systems). + + * README, USAGE, foomatic-rip.in, foomatic-rip.1.in, beh.in, + foomatic-gswrapper.1.in, debian/copyright, debian/control, + debian/README.Debian: Replaced "linuxprinting.org" by + "openprinting.org" or "OpenPrinting". + 2006-10-03 Till Kamppeter * foomatic-rip.in: Fixed bashism. @@ -7,7 +114,7 @@ * foomatic-gswrapper.in: Support for built-in redirection of standard output of PostScript programs ("-sstdout=%stderr") in newer GhostScript versions. More reliable then using /dev/fd/3 - (not always available difficult to check presence) or '|cat >3' + (not always available, difficult to check presence) or '|cat >3' (not seekable and some GhostScript output devices require seekability of the output file), diff --git a/README b/README index c0aca18..2219d7f 100644 --- a/README +++ b/README @@ -10,11 +10,9 @@ Filter scripts used by the printer spoolers to convert the incoming PostScript data into the printer's native format using a printer/driver specific, but spooler-independent PPD file. +Till Kamppeter -Grant Taylor -Till Kamppeter - -http://www.linuxprinting.org/ +http://www.openprinting.org/ This README contains mainly info for developers. See the file USAGE if you want to know how to use Foomatic. @@ -26,11 +24,18 @@ Copying This package and also the other Foomatic packages are under the GPL. See http://www.gnu.org/. -If you spot a data error or any other bug, send mail describing the bug to -foomatic-devel@linuxprinting.org -General discussion happens in the foomatic-devel forum/list thing at -www.linuxprinting.org. +Bugs +---- + +If you spot a data error or any other bug, either post on the Foomatic +developer mailing list + +http://lists.freestandards.org/mailman/listinfo/printing-foomatic + +or post on the OpenPrinting site support forum + +http://forums.openprinting.org/list.php?34 Intro @@ -38,20 +43,17 @@ Intro This is the stable version of Foomatic. See -http://www.linuxprinting.org/contribute.html#programming -http://www.linuxprinting.org/pipermail/foomatic-devel/2002q3/thread.html -http://www.linuxprinting.org/pipermail/foomatic-devel/2002q4/thread.html -http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/IV.Foomatic-Developer/IV.tutorial-handout-foomatic-development.html +http://www.freestandards.org/en/OpenPrinting/Database/HowToContribute#programming to know more about its development. Your suggestions, bug reports, patches, ... are welcome on -http://www.linuxprinting.org/newsportal/thread.php3?name=linuxprinting.foomatic.devel +http://forums.openprinting.org/list.php?34 For getting Foomatic PPD files for this version, go to -http://www.linuxprinting.org/ +http://www.openprinting.org/ See the README file of "foomatic-db-engine" for a (more or less) complete overview of Foomatic. @@ -68,7 +70,7 @@ GNUlpr - An enhanced LPD (http://sf.net/projects/lpr, development stopped) PPR - Page PRinter spooler (http://ppr.sourceforge.net/) PDQ - Print, Don't Queue (http://pdq.sf.net/, development stopped) CPS - Coherent Printing System (http://www.tww.cx/cps.php) ---- - Direct, spooler-less printing (http://www.linuxprinting.org/) +--- - Direct, spooler-less printing (http://www.openprinting.org/) Programs and important files from this package diff --git a/USAGE b/USAGE index dd3ede4..38c9190 100644 --- a/USAGE +++ b/USAGE @@ -9,10 +9,9 @@ Filter scripts used by the printer spoolers to convert the incoming PostScript data into the printer's native format using a printer/driver specific, but spooler-independent PPD file. +Till Kamppeter -Grant Taylor -Till Kamppeter -http://www.linuxprinting.org/ +http://www.openprinting.org/ This usage documentation file is written by Till Kamppeter @@ -94,26 +93,23 @@ the scripts when they are installed. Download sources: rlpr: http://freshmeat.net/projects/rlpr/ or - http://www.linuxprinting.org/download/printing/ + http://www.openprinting.org/download/printing/ netcat: http://freshmeat.net/projects/netcat/ This package does not require any other Foomatic package. it can be -used with PPD files downloaded from linuxprinting.org, with +used with PPD files downloaded from the OpenPrinting site, with manufacturer-supplied PPDs for PostScript printers, and probably with other PPD files. -Note: PPD files for native CUPS drivers, as the ones shipping with -CUPS or Gimp-Print cannot be used with other spoolers than CUPS. - For non-PostScript printers one also needs GhostScript (5.50 or newer, ESP GhostScript 7.05.4 or newer highly recommended) and the appropriate printer driver. For drivers which have to be compiled into GhostScript ("Execution -style: GhostScript" on the driver pages on linuxprinting.org) check -with "gs -h" whether the driver is in your GhostScript. If not you -need to compile the driver into your GhostScript or use a GhostScript -version which already contains it. +style: GhostScript" on the driver pages on the OpenPrinting site) +check with "gs -h" whether the driver is in your GhostScript. If not +you need to compile the driver into your GhostScript or use a +GhostScript version which already contains it. If the driver page says "Execution style: Uniprint", it is much easier, check whether the appropriate ".upp" file is in one of the @@ -215,19 +211,19 @@ If not, see, depending on your spooler: CUPS: - http://www.linuxprinting.org/cups-doc.html + http://www.openprinting.org/cups-doc.html LPD, LPRng, GNUlpr: - http://www.linuxprinting.org/lpd-doc.html + http://www.openprinting.org/lpd-doc.html PPR: - http://www.linuxprinting.org/ppr-doc.html + http://www.openprinting.org/ppr-doc.html PDQ: - http://www.linuxprinting.org/pdq-doc.html + http://www.openprinting.org/pdq-doc.html CPS: @@ -235,11 +231,11 @@ CPS: Direct, spooler-less printing: - http://www.linuxprinting.org/direct-doc.html + http://www.openprinting.org/direct-doc.html Usage of PPD files (for all spoolers): - http://www.linuxprinting.org/ppd-doc.html + http://www.openprinting.org/ppd-doc.html diff --git a/beh.in b/beh.in index 1cc2b09..fda6702 100644 --- a/beh.in +++ b/beh.in @@ -40,12 +40,12 @@ # Mark this filter world-readable and world-executable. Restart CUPS to # make the new backend known to the spooler. # -# See http://www.linuxprinting.org/cups-doc.html and the additional +# See http://www.openprinting.org/cups-doc.html and the additional # instructions below. # beh - Backend Error Handler # -# Copyright 2005 Till Kamppeter +# Copyright 2005 Till Kamppeter # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the diff --git a/configure b/configure index 58f1042..e3f169f 100755 --- a/configure +++ b/configure @@ -883,7 +883,7 @@ esac else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi @@ -2748,11 +2748,6 @@ esac *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -2791,6 +2786,12 @@ echo "$as_me: error: cannot find input file: $f" >&2;} fi;; esac done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub diff --git a/debian/README.Debian b/debian/README.Debian index 24d66e0..8d2a301 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -1,7 +1,7 @@ foomatic-filters for Debian --------------------------- -Note that the structure of the LinuxPrinting.org (foomatic) printer +Note that the structure of the OpenPrinting (foomatic) printer configuration system in Debian (and upstream) has changed from the 2.0 series. There are now 3 core packages: diff --git a/debian/control b/debian/control index 4a5deea..99b6acd 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Depends: ${perl:Depends}, ${misc:Depends}, ucf (>= 0.30) Recommends: cupsys-client | lpr | lprng | pdq | rlpr, gs-esp | gs, cupsys | enscript | a2ps | mpage, foomatic-db-engine Conflicts: foomatic-bin (<< 2.9), cupsomatic-ppd (<< 20030507) Replaces: foomatic-bin (<< 2.9), cupsomatic-ppd -Description: linuxprinting.org printer support - filters +Description: OpenPrinting printer support - filters Foomatic is a printer database designed to make it easier to set up common printers for use with Debian (and other operating systems). It provides the "glue" between a print spooler (like CUPS or lpr) and @@ -28,4 +28,4 @@ Description: linuxprinting.org printer support - filters For use with CUPS, you will need both the cupsys and cupsys-client packages installed on your system. . - Home Page: http://www.linuxprinting.org/ + Home Page: http://www.openprinting.org/ diff --git a/debian/copyright b/debian/copyright index ac6bcec..1c33c8f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,11 +1,11 @@ This package was debianized by Chris Lawrence on Sun, 13 Apr 2003 20:44:09 -0500. -It was downloaded from http://www.linuxprinting.org/download/foomatic/ +It was downloaded from http://www.openprinting.org/download/foomatic/ Upstream Authors: - Grant Taylor - Till Kamppeter + Original founder: Grant Taylor + Current maintainer: Till Kamppeter Copyright: diff --git a/foomatic-gswrapper.1.in b/foomatic-gswrapper.1.in index 38e7640..fd95941 100644 --- a/foomatic-gswrapper.1.in +++ b/foomatic-gswrapper.1.in @@ -26,4 +26,6 @@ project using output from the associated binary. .SH BUGS None so far. -Please send bug reports to foomatic-devel@linuxprinting.org. +Please send bug reports to the Foomatic mailing list: + +http://lists.freestandards.org/mailman/listinfo/printing-foomatic diff --git a/foomatic-gswrapper.in b/foomatic-gswrapper.in index e6b1049..d314c6a 100644 --- a/foomatic-gswrapper.in +++ b/foomatic-gswrapper.in @@ -17,7 +17,7 @@ my $configpath = "@sysconfdir@/foomatic"; # Read config file if present %conf = readConfFile("$configpath/filter.conf"); -# Set GhostScript path +# Set Ghostscript path my $gspath = "gs"; $gspath = $conf{gspath} if defined(%conf) and defined $conf{gspath}; my $execpath = "@EXECPATH@"; @@ -25,7 +25,7 @@ my $execpath = "@EXECPATH@"; $execpath = $conf{execpath} if defined(%conf) and defined $conf{execpath}; $ENV{'PATH'} = $execpath; -# Check whether we have a GhostScript version with redirection of the +# Check whether we have a Ghostscript version with redirection of the # standard output of the PostScript programs via '-sstdout=%stderr' my $gswithstdoutredirection = 0; if (`$gspath -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOMEDIAATTRS -sDEVICE=pswrite -sstdout=%stderr -sOutputFile=/dev/null -c '(hello\n) print flush' 2>&1` =~ /hello/) { @@ -34,7 +34,7 @@ if (`$gspath -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOMEDIAATTRS -sDEVICE=p grep (m!\-sOutputFile=\-! && do { - # If GhostScript does not support redirecting the standard output + # If Ghostscript does not support redirecting the standard output # of the PostScript program to standard error with # '-sstdout=%stderr', sen the job output data to fd 3; errors # will be on 2(stderr) and job ps program interpreter output on @@ -44,13 +44,14 @@ grep (m!\-sOutputFile=\-! # quoted properly below... }, @ARGV); -if (!$gswithstdoutredirection) { - grep (((m!^\-$!) || (m!^\-_$!)) - && do { - # Get the input from fd 0. - $_ = "/dev/fd/0"; - }, @ARGV); -} +grep (((m!^\-$!) || (m!^\-_$!) || (m!^/dev/fd/0$!)) + && do { + # Use always buffered input. This works around a Ghostscript + # bug which prevents printing encrypted PDF files with Adobe + # Reader 8.1.1 and Ghostscript built as shared library + # (Ghostscript bug #689577, Ubuntu bug #172264) + $_ = "-_"; + }, @ARGV); # Turn *off* -q (quiet!); now that stderr is useful! :) my @myargs = grep (! m!^\-q$!, @ARGV); diff --git a/foomatic-rip.1.in b/foomatic-rip.1.in index 0782314..367885e 100644 --- a/foomatic-rip.1.in +++ b/foomatic-rip.1.in @@ -190,13 +190,13 @@ immediately after the data is tranferred to the printer. directs your jobs to the LPD printer queue \fBlp\fR on the machine named \fBprintserver\fR. -See also http://www.linuxprinting.org/direct-doc.html +See also http://www.openprinting.org/direct-doc.html .SH "PRINTING WITH SPOOLER" -See the documentation on the Linux Printing Web site: +See the documentation on the OpenPrinting Web site: .ft CW -http://www.linuxprinting.org +http://www.openprinting.org/ \fR .SH FILES @@ -223,11 +223,13 @@ The PPD files of the currently defined printers returns 0 unless something unexpected happens. .SH AUTHOR -Till Kamppeter <\fItill.kamppeter@gmx.net\fR> with parts of Manfred +Till Kamppeter <\fItill.kamppeter@gmail.com\fR> with parts of Manfred Wassmanns's <\fImanolo@NCC-1701.B.Shuttle.de\fR> man pages for the Foomatic 2.0.x filters. .SH BUGS None so far. -Please send bug reports to foomatic-devel@linuxprinting.org. +Please send bug reports to the Foomatic mailing list: + +http://lists.freestandards.org/mailman/listinfo/printing-foomatic diff --git a/foomatic-rip.in b/foomatic-rip.in index a681753..18b06a0 100644 --- a/foomatic-rip.in +++ b/foomatic-rip.in @@ -26,12 +26,12 @@ my $ripversion='$Revision$'; # spoolers run the print filters as a special user, as "lp", not as # "root" or as the user who sent the job). -# See http://www.linuxprinting.org/cups-doc.html -# http://www.linuxprinting.org/lpd-doc.html -# http://www.linuxprinting.org/ppr-doc.html -# http://www.linuxprinting.org/pdq-doc.html -# http://www.linuxprinting.org/direct-doc.html -# http://www.linuxprinting.org/ppd-doc.html +# See http://www.openprinting.org/cups-doc.html +# http://www.openprinting.org/lpd-doc.html +# http://www.openprinting.org/ppr-doc.html +# http://www.openprinting.org/pdq-doc.html +# http://www.openprinting.org/direct-doc.html +# http://www.openprinting.org/ppd-doc.html # ========================================================================== # @@ -114,8 +114,8 @@ my $logfile = "/tmp/foomatic-rip"; # # foomatic-rip spooler-independent PS->Printer filter (RIP) of Foomatic # -# Copyright 2002 - 2004 Grant Taylor -# & Till Kamppeter +# Copyright 2002 - 2007 Grant Taylor +# & Till Kamppeter # & Helge Blischke # # This program is free software; you can redistribute it and/or modify it @@ -1132,7 +1132,7 @@ while() { $line =~ m!^([^\"]*)\"!; $cmd .= $1; $model = unhtmlify($cmd); - } elsif (m!^\*FoomaticIDs:\s*(\S+)\s+(\S+)\s*$!) { + } elsif (m!^\*FoomaticIDs:\s*\"?\s*(\S+?)\s+(\S+?)\s*\"?\s*$!) { # "*FoomaticIDs: " my $id = $1; my $driver = $2; @@ -1181,6 +1181,17 @@ while() { $line =~ m!^([^\"]*)\"!; $cmd .= $1; $dat->{'cmd'} = unhtmlify($cmd); + } elsif (m!^\*FoomaticNoPageAccounting:\s*\"?\s*(\S+?)\s*\"?\s*$!) { + # "*FoomaticRIPNoPageAccounting: " + my $value = $1; + # Apply the value + if ($value =~ /^True$/i) { + # Driver is not compatible with page accounting according to the + # Foomatic database, so turn it off for this driver + $ps_accounting = 0; + $accounting_prolog = ''; + print $logh "CUPS page accounting disabled by driver.\n"; + } } elsif (m!^\*cupsFilter:\s*\"(.*)$!) { # "*cupsFilter: " my $line = $1; @@ -1277,8 +1288,8 @@ while() { # Unmark the current argument to do not mis-interpret any keywords # as choices $currentargument = ""; - } elsif ((m!^\*FoomaticRIPOption ([^/:\s]+):\s*(\S+)\s+(\S+)\s+(\S)\s*$!) || - (m!^\*FoomaticRIPOption ([^/:\s]+):\s*(\S+)\s+(\S+)\s+(\S)\s+(\S+)\s*$!)){ + } elsif ((m!^\*FoomaticRIPOption ([^/:\s]+):\s*\"?\s*(\S+?)\s+(\S+)\s+(\S)\s*\"?\s*$!) || + (m!^\*FoomaticRIPOption ([^/:\s]+):\s*\"?\s*(\S+?)\s+(\S+)\s+(\S)\s+(\S+?)\s*\"?\s*$!)){ # "*FoomaticRIPOption