[Pkg-cups-devel] r825 - in cupsys/trunk/debian: . filters local local/filters local/filters/pdf-filters/conf patches
Till Kamppeter
till-guest at alioth.debian.org
Fri Aug 15 12:59:31 UTC 2008
Author: till-guest
Date: Fri Aug 15 12:59:31 2008
New Revision: 825
Log:
Added cpdftocps filter, adjusted filter cost factors, removed "-r150" option from Ghostscript command line in pstopdf filter.
Added:
cupsys/trunk/debian/local/cpdftocps.convs
cupsys/trunk/debian/local/filters/cpdftocps
cupsys/trunk/debian/patches/pjl-display-ready-message.dpatch
Modified:
cupsys/trunk/debian/changelog
cupsys/trunk/debian/cups.install
cupsys/trunk/debian/filters/pstopdf
cupsys/trunk/debian/local/filters/pdf-filters/conf/imagetopdf.convs
cupsys/trunk/debian/local/filters/pdf-filters/conf/pdftopdf.convs
cupsys/trunk/debian/local/pstopdf.convs
cupsys/trunk/debian/patches/00list
cupsys/trunk/debian/rules
Modified: cupsys/trunk/debian/changelog
==============================================================================
--- cupsys/trunk/debian/changelog (original)
+++ cupsys/trunk/debian/changelog Fri Aug 15 12:59:31 2008
@@ -6,6 +6,27 @@
fonts any more. Backed out Johan Kiviniemi's patch of replacing
Courier by FreeMono.
+ * debian/local/filters/pdf-filters/conf/imagetopdf.convs: Reduced cost
+ factor to prefer this filter instead of imagetops.
+
+ [ Johan Kiviniemi ]
+ * debian/local/filters/cpdftocps, debian/local/cpdftocps.convs,
+ debian/cups.install, debian/rules:
+ - Add an application/vnd.cups-pdf → application/vnd.cups-postscript
+ filter, thus making the PDF filter chain possible for PostScript
+ printers.
+ - The filter’s cost is 22, making the total cost of pstopdf → pdftopdf →
+ cpdftocps 66 after the following change.
+ * debian/local/filters/pdf-filters/conf/pdftopdf.convs,
+ debian/local/pstopdf.convs, debian/rules:
+ - Change filter costs to prefer the PDF chain over pstops.
+ • pdftopdf: 22 instead of 66.
+ • pstopdf: 22 instead of 100.
+ • pstops: 100 instead of 66.
+ * Add pjl-display-ready-message.dpatch:
+ - According to the PJL spec, one should use "" (not "READY") to return the
+ display to the normal ready message.
+
-- Martin Pitt <mpitt at debian.org> Fri, 15 Aug 2008 10:02:32 +0200
cups (1.3.8-4) experimental; urgency=low
Modified: cupsys/trunk/debian/cups.install
==============================================================================
--- cupsys/trunk/debian/cups.install (original)
+++ cupsys/trunk/debian/cups.install Fri Aug 15 12:59:31 2008
@@ -51,6 +51,7 @@
usr/share/man/*/man8/cupsfilter.8.gz
../presubj usr/share/bug/cups/
../local/backends/* usr/lib/cups/backend-available/
+../local/filters/cpdftocps usr/lib/cups/filter/
../local/filters/oopstops usr/lib/cups/filter/
../local/filters/textonly usr/lib/cups/filter/
../local/*.ppd usr/share/ppd/cups-included/
Modified: cupsys/trunk/debian/filters/pstopdf
==============================================================================
--- cupsys/trunk/debian/filters/pstopdf (original)
+++ cupsys/trunk/debian/filters/pstopdf Fri Aug 15 12:59:31 2008
@@ -14,7 +14,7 @@
set -e
PSTOPDF=/usr/bin/ps2pdf13
-OPTIONS="-r150 -dAutoRotatePages=/None -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dNOPLATFONTS"
+OPTIONS="-dAutoRotatePages=/None -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dNOPLATFONTS"
echo "INFO: pstopdf argv[$#] = $@" >&2
Added: cupsys/trunk/debian/local/cpdftocps.convs
==============================================================================
--- (empty file)
+++ cupsys/trunk/debian/local/cpdftocps.convs Fri Aug 15 12:59:31 2008
@@ -0,0 +1 @@
+application/vnd.cups-pdf application/vnd.cups-postscript 22 cpdftocps
Added: cupsys/trunk/debian/local/filters/cpdftocps
==============================================================================
--- (empty file)
+++ cupsys/trunk/debian/local/filters/cpdftocps Fri Aug 15 12:59:31 2008
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+# application/vnd.cups-pdf -> application/vnd.cups-postscript filter
+
+# Contributed by Johan Kiviniemi. Licensed under the terms of the CUPS Debian
+# packaging.
+# The typical filter chain using this filter:
+# (something that outputs pdf)
+# -> pdftopdf
+# -> cpdftocps (runs pdftops -> pstops)
+# -> (postscript printer)
+
+# The emit-jcl option can be safely passed through to pstops, since pdftops
+# strips any JCL output by pdftopdf before processing the PDF. pstops then
+# simply does the right thing regarding JCL for pdftops’ output.
+
+set -e
+
+# These options are *not* passed through to pstops, since pdftopdf or
+# equivalent has already processed them.
+MASK='
+ brightness
+ Collate
+ cupsEvenDuplex
+ fitplot
+ gamma
+ hue
+ landscape
+ mirror
+ multiple-document-handling
+ natural-scaling
+ number-up
+ number-up-layout
+ orientation-requested
+ OutputOrder
+ page-border
+ page-bottom
+ page-label
+ page-left
+ page-ranges
+ page-right
+ page-set
+ page-top
+ position
+ saturation
+ scaling
+ sides
+'
+
+# Convert MASK to a regexp.
+MASK_RE=$(
+ set -- $MASK
+ IFS='|'
+ printf "%s" "$*"
+)
+
+# Annihilate all forms of the masked options from $5:
+# - <option>=parameter
+# - <option> (boolean)
+# - no<option> (boolean)
+MASKED_OPTS=$(
+ printf "%s" "$5" | \
+ sed -r -e 's/(^|\s+)(no)?('"$MASK_RE"')(=\S*)?//g' -e 's/^\s+//'
+)
+
+/usr/lib/cups/filter/pdftops "$@" | \
+ /usr/lib/cups/filter/pstops "$1" "$2" "$3" "$4" "$MASKED_OPTS"
+
+# vim:set et sw=2 sts=2:
Modified: cupsys/trunk/debian/local/filters/pdf-filters/conf/imagetopdf.convs
==============================================================================
--- cupsys/trunk/debian/local/filters/pdf-filters/conf/imagetopdf.convs (original)
+++ cupsys/trunk/debian/local/filters/pdf-filters/conf/imagetopdf.convs Fri Aug 15 12:59:31 2008
@@ -3,18 +3,18 @@
# PDF filters
#
-image/gif application/vnd.cups-pdf 66 imagetopdf
-image/png application/vnd.cups-pdf 66 imagetopdf
-image/jpeg application/vnd.cups-pdf 66 imagetopdf
-image/tiff application/vnd.cups-pdf 66 imagetopdf
-image/x-bitmap application/vnd.cups-pdf 66 imagetopdf
-image/x-photocd application/vnd.cups-pdf 66 imagetopdf
-image/x-portable-anymap application/vnd.cups-pdf 66 imagetopdf
-image/x-portable-bitmap application/vnd.cups-pdf 66 imagetopdf
-image/x-portable-graymap application/vnd.cups-pdf 66 imagetopdf
-image/x-portable-pixmap application/vnd.cups-pdf 66 imagetopdf
-image/x-sgi-rgb application/vnd.cups-pdf 66 imagetopdf
-image/x-xbitmap application/vnd.cups-pdf 66 imagetopdf
-image/x-xpixmap application/vnd.cups-pdf 66 imagetopdf
-image/x-xwindowdump application/vnd.cups-pdf 66 imagetopdf
-image/x-sun-raster application/vnd.cups-pdf 66 imagetopdf
+image/gif application/vnd.cups-pdf 33 imagetopdf
+image/png application/vnd.cups-pdf 33 imagetopdf
+image/jpeg application/vnd.cups-pdf 33 imagetopdf
+image/tiff application/vnd.cups-pdf 33 imagetopdf
+image/x-bitmap application/vnd.cups-pdf 33 imagetopdf
+image/x-photocd application/vnd.cups-pdf 33 imagetopdf
+image/x-portable-anymap application/vnd.cups-pdf 33 imagetopdf
+image/x-portable-bitmap application/vnd.cups-pdf 33 imagetopdf
+image/x-portable-graymap application/vnd.cups-pdf 33 imagetopdf
+image/x-portable-pixmap application/vnd.cups-pdf 33 imagetopdf
+image/x-sgi-rgb application/vnd.cups-pdf 33 imagetopdf
+image/x-xbitmap application/vnd.cups-pdf 33 imagetopdf
+image/x-xpixmap application/vnd.cups-pdf 33 imagetopdf
+image/x-xwindowdump application/vnd.cups-pdf 33 imagetopdf
+image/x-sun-raster application/vnd.cups-pdf 33 imagetopdf
Modified: cupsys/trunk/debian/local/filters/pdf-filters/conf/pdftopdf.convs
==============================================================================
--- cupsys/trunk/debian/local/filters/pdf-filters/conf/pdftopdf.convs (original)
+++ cupsys/trunk/debian/local/filters/pdf-filters/conf/pdftopdf.convs Fri Aug 15 12:59:31 2008
@@ -3,4 +3,4 @@
# PDF filters
#
-application/pdf application/vnd.cups-pdf 66 pdftopdf
+application/pdf application/vnd.cups-pdf 22 pdftopdf
Modified: cupsys/trunk/debian/local/pstopdf.convs
==============================================================================
--- cupsys/trunk/debian/local/pstopdf.convs (original)
+++ cupsys/trunk/debian/local/pstopdf.convs Fri Aug 15 12:59:31 2008
@@ -1 +1 @@
-application/postscript application/pdf 100 pstopdf
+application/postscript application/pdf 22 pstopdf
Modified: cupsys/trunk/debian/patches/00list
==============================================================================
--- cupsys/trunk/debian/patches/00list (original)
+++ cupsys/trunk/debian/patches/00list Fri Aug 15 12:59:31 2008
@@ -25,6 +25,7 @@
include_krb5_h_in_job_h.dpatch
search_mime_files_in_usr_share.dpatch
cupsfilter-path-typo.dpatch
+pjl-display-ready-message.dpatch
# Ubuntu patches
ubuntu-disable-browsing.dpatch
Added: cupsys/trunk/debian/patches/pjl-display-ready-message.dpatch
==============================================================================
--- (empty file)
+++ cupsys/trunk/debian/patches/pjl-display-ready-message.dpatch Fri Aug 15 12:59:31 2008
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## pjl-display-ready-message.dpatch by Johan Kiviniemi <debian at johan.kiviniemi.name>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: According to the PJL spec, one should use RDYMSG DISPLAY = "" to return
+## DP: the display to the normal ready message.
+
+ at DPATCH@
+diff -urNad cups~/cups/emit.c cups/cups/emit.c
+--- cups~/cups/emit.c 2008-07-12 01:48:49.000000000 +0300
++++ cups/cups/emit.c 2008-08-15 15:05:01.699303148 +0300
+@@ -475,7 +475,7 @@
+ */
+
+ fputs("\033%-12345X at PJL\n", fp);
+- fputs("@PJL RDYMSG DISPLAY = \"READY\"\n", fp);
++ fputs("@PJL RDYMSG DISPLAY = \"\"\n", fp);
+ fputs(ppd->jcl_end + 9, fp);
+ }
+ else
Modified: cupsys/trunk/debian/rules
==============================================================================
--- cupsys/trunk/debian/rules (original)
+++ cupsys/trunk/debian/rules Fri Aug 15 12:59:31 2008
@@ -87,10 +87,15 @@
# Move file detection and conversion rules to /usr/share/cups/mime/ so
# that the package manager does not consider them conffiles
install -d $(DEB_DESTDIR)/../cups/usr/share/cups/mime
- ( cd $(DEB_DESTDIR)/../cups/etc/cups; mv imagetopdf.* pdftopdf.* pdftoraster.* pdf.* texttopdf.* $(DEB_DESTDIR)/../cups/usr/share/cups/mime/ )
+ ( cd $(DEB_DESTDIR)/../cups/etc/cups; mv cpdftocps.* imagetopdf.* pdftopdf.* pdftoraster.* pdf.* texttopdf.* $(DEB_DESTDIR)/../cups/usr/share/cups/mime/ )
# Simple Ghostscript-based PostScript-to-PDF filter
install -m 0755 debian/filters/pstopdf $(DEB_DESTDIR)/../cups/usr/lib/cups/filter
+ # Increase the cost of pstops to prefer the PDF filter chain for
+ # PostScript printers.
+ sed -i -r -e '/\spstops$$/ { s/66/100/ }' \
+ debian/$(cdbs_curpkg)/etc/cups/mime.convs
+
binary-post-install/libcupsimage2-dev::
rm -r debian/libcupsimage2-dev/usr/share/doc/libcupsimage2-dev
ln -s libcupsimage2 debian/libcupsimage2-dev/usr/share/doc/libcupsimage2-dev
More information about the Pkg-cups-devel
mailing list