diff options
author | Heinrich Wendel <lanius@gentoo.org> | 2005-06-07 09:59:59 +0000 |
---|---|---|
committer | Heinrich Wendel <lanius@gentoo.org> | 2005-06-07 09:59:59 +0000 |
commit | a325718db92c13be59cc5f7326936a9f3a624784 (patch) | |
tree | 3986a7dece582c38f672fb371e9ed0c8a22d1a4d /net-print/cups | |
parent | version bump (diff) | |
download | historical-a325718db92c13be59cc5f7326936a9f3a624784.tar.gz historical-a325718db92c13be59cc5f7326936a9f3a624784.tar.bz2 historical-a325718db92c13be59cc5f7326936a9f3a624784.zip |
add pdftops to files, bug #93871
Package-Manager: portage-2.0.51.19
Diffstat (limited to 'net-print/cups')
-rw-r--r-- | net-print/cups/ChangeLog | 6 | ||||
-rw-r--r-- | net-print/cups/Manifest | 11 | ||||
-rw-r--r-- | net-print/cups/cups-1.1.23-r4.ebuild | 7 | ||||
-rw-r--r-- | net-print/cups/files/pdftops.pl | 162 |
4 files changed, 176 insertions, 10 deletions
diff --git a/net-print/cups/ChangeLog b/net-print/cups/ChangeLog index ff3fb17b998c..071f51963462 100644 --- a/net-print/cups/ChangeLog +++ b/net-print/cups/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-print/cups # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-print/cups/ChangeLog,v 1.133 2005/06/06 21:05:22 lanius Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-print/cups/ChangeLog,v 1.134 2005/06/07 09:59:59 lanius Exp $ + + 07 Jun 2005; Heinrich Wendel <lanius@gentoo.org> +files/pdftops.pl, + cups-1.1.23-r4.ebuild: + add pdftops to files, bug #93871 *cups-1.1.23-r4 (06 Jun 2005) diff --git a/net-print/cups/Manifest b/net-print/cups/Manifest index 8873d06c7f75..82d41d258fc6 100644 --- a/net-print/cups/Manifest +++ b/net-print/cups/Manifest @@ -2,10 +2,10 @@ Hash: SHA1 MD5 9ed3d5f241e1c197d5cc8b4518b9ca08 cups-1.1.23-r2.ebuild 4025 -MD5 7f97dcef316dab4d6fb41cc92ec22f39 cups-1.1.23-r4.ebuild 4533 +MD5 5a6b203e6c901193c7dfb6515aeb174b cups-1.1.23-r4.ebuild 4473 MD5 e36ac7a30dd61a5a58142aaec1fc6ddb cups-1.1.23-r1.ebuild 3916 MD5 d1237fcb5cd9914f1074e108c40f9698 cups-1.1.23-r3.ebuild 4330 -MD5 19c8d12315eea4470dd44c481227c78c ChangeLog 17453 +MD5 c46a9fb4b833ce51ec3811c2ce261423 ChangeLog 17584 MD5 26b4b081d538c195dc39bcb2ec8e6f3a metadata.xml 161 MD5 85bc20d893f097ef0f13947179c3838c files/cups-1.1.22-xpdf2-underflow.patch 2301 MD5 a097b6a9c53c9ef50a6f3662d802cdfa files/xpdf-pl3.patch 348 @@ -19,12 +19,13 @@ MD5 22c70e955df5567e6ed03f3992bd0128 files/digest-cups-1.1.23-r3 125 MD5 22c70e955df5567e6ed03f3992bd0128 files/digest-cups-1.1.23-r4 125 MD5 7888ddf6a0c4cfb38b8882651e22d66c files/cups-gcc4-amd64.patch 566 MD5 7bce495a238ee9dbebb61496f3b3ae51 files/disable-strip.patch 422 +MD5 f6149424fd2880c5017da501e876de59 files/pdftops.pl 5630 MD5 2fce5bedd61300fad1566a41f991a782 files/xpdf-goo-sizet.patch 1424 MD5 b041836e6ee51876ca7ec86869643018 files/cups.xinetd 368 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) -iD8DBQFCpLqnevY57Fted3ERAv7fAKC2nphVY7fhYL710kFWPo3yWDQfuwCeMyiI -WtZ339Lqb66PbY3CrHg6Ies= -=e8an +iD8DBQFCpXA8evY57Fted3ERAl5HAJsGl2O0rzE51ctdRmYjjC09+g4UtwCfWP4C +NDoiZlFyM6+ezsBzH8vARDk= +=6CQ3 -----END PGP SIGNATURE----- diff --git a/net-print/cups/cups-1.1.23-r4.ebuild b/net-print/cups/cups-1.1.23-r4.ebuild index 7327f07b95c1..49db9e7ad1a0 100644 --- a/net-print/cups/cups-1.1.23-r4.ebuild +++ b/net-print/cups/cups-1.1.23-r4.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-print/cups/cups-1.1.23-r4.ebuild,v 1.1 2005/06/06 21:05:22 lanius Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-print/cups/cups-1.1.23-r4.ebuild,v 1.2 2005/06/07 09:59:59 lanius Exp $ inherit eutils flag-o-matic pam @@ -10,8 +10,7 @@ DESCRIPTION="The Common Unix Printing System" HOMEPAGE="http://www.cups.org/" SRC_URI="ftp://ftp2.easysw.com/pub/cups/test/${MY_P}-source.tar.bz2 ftp://ftp.easysw.com/pub/cups/test/${MY_P}-source.tar.bz2 -ftp://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/cups/test/${MY_P}-source.tar.bz2 -http://www.srz.de/Members/bla/cups/filter/pdftops/pdftops.pl" +ftp://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/cups/test/${MY_P}-source.tar.bz2" LICENSE="GPL-2" SLOT="0" @@ -130,7 +129,7 @@ src_install() { # install pdftops filter exeinto /usr/lib/cups/filter/ - newexe ${DISTDIR}/pdftops.pl pdftops + newexe ${FILESDIR}/pdftops.pl pdftops dosed "s:/usr/local:/usr:" /usr/lib/cups/filter/pdftops } diff --git a/net-print/cups/files/pdftops.pl b/net-print/cups/files/pdftops.pl new file mode 100644 index 000000000000..8c6637f8df17 --- /dev/null +++ b/net-print/cups/files/pdftops.pl @@ -0,0 +1,162 @@ +#!/usr/bin/perl -w +# pdftops.pl - wrapper script for xpdf's pdftops utility to act as a CUPS filter +# ============================================================================== +# 1.00 - 2004-10-05/Bl +# Initial implementation +# +# Copyright: Helge Blischke / SRZ Berlin 2004 +# This program is free seoftware and governed by the GNU Public License Version 2. +# +# Description: +# ------------ +# This program wraps the pdftops utility from the xpdf 3.00 (and higher) suite +# to behave as a CUPS filter as a replacement for the original pdftops filter. +# +# The main purpose of this approach is to keep the properties of a PDF to be +# printed as undesturbed as possible, especially with respect to page size, +# scaling, and positioning. +# +# The pdftops utility reads a configuration file 'pdftops.conf' in the +# CUPS_SERVERROOT directory, which must exist but may be empty. The sample +# configuration file accompanying this program sets the defaults which +# seem plausible to me with respect to high end production printers. +# +# To give the user highest possible flexibility, this program accepts and +# evaluates a set of job attributes special to this filter, which are +# described below: +# +# pdf-pages=<f>,<l> +# expands to the -f and -l options of pdftops +# to select a page range to process. This is independent +# of the page-ranges attribute and may significantly +# increase throughput when printing page ranges. +# Either of these numbers may be omitted. +# +# pdf-paper=<name> +# pdf-paper=<width>x<height> +# <name> may be one of letter, legal , A4, A3, or match; +# <width> and <height> are the paper width and height +# in printers points (1/72 inch). This expands to +# either the -paper or the -paperh and -paperw options +# of pdftops +# +# pdf-opw=<password> +# pdf-upw=<password> +# expand to the -opw and -upw options of pdftops, +# respectively and permit printing of password +# protected PDFs. +# +# pdf-<option> where <option> is one of +# level1, level1sep, level2, level2sep, level3, level3sep, +# opi, nocrop, expand, noshrink, nocenter. +# See the pdftops manpage for a detailed description of +# the respective options. +# +# All other pdftops commandline options are refused. +# +# When printing from STDIN, the program copies the input to a temporary file +# in TMPDIR, which is deleted on exit. +# +# The return code of the pdftops utility, if nonzero, is used as the exit code +# of this program; error messages of the pdftops utility are only visible +# if 'debug' is specified as LogLevel in cupsd.conf. + +# +# Site specific parameters - modify as needed +# ------------------------------------------------------------------------------ +$pdftops_path = "/usr/local/bin/pdftops"; # path to the xpdf utility +# ------------------------------------------------------------------------------ + +use File::Copy; + +# +# Check the arguments +# +die ("ERROR: wrong number of arguments\n") if (scalar @ARGV < 5); + +$jobid = $username = $title = $copies = undef; +$jobid = shift; # Job ID +$username = shift; # Job requesting user name +$title = shift; # Job title +$copies = shift; # Number of requested copies +$options = shift; # Textual representation of job attributes +$pdffile = shift; # Pathname of PDF file to process + +# If we are reading from STDIN, we must copy the input to a temporary file +# as the PDF consumer needs a seekable input. + +if (! defined $pdffile) +{ + my $tmpfile = $ENV{TMPDIR} . "pdfin.$$.tmp"; + open (TEMP, ">$tmpfile") || die ("ERROR: pdftops wrapper: $tmpfile: $!\n"); + if (! copy (STDIN, TEMP)) + { + close (TEMP); + unlink $tmpfile; + die ("ERROR: pdftops wrapper: $tmpfile: $!\n"); + } + close (TEMP); + $pdffile = $tmpfile; + $delete_input = 1; # for deleting the temp file after converting +} + +# +# Check the options string for options to modify the bahaviour of the pdftops utility: +# +@optarr = split (/\s+/, $options); +$cmdopt = "-cfg " . $ENV{CUPS_SERVERROOT} . "/pdftops.conf"; # This cannot be changed +# The following are the (parameterless) command line options that may be used to change the +# defaults defiend by pdftops.conf +$simple = 'level1|level1sep|level2|level2sep|level3|level3sep|opi|nocrop|expand|noshrink|nocenter'; +foreach my $option (@optarr) +{ + if ($option =~ /^pdf-(.+)$/) + { # We assume this is an option to evaluate + my $optkey = $1; # possible pdftops option + if ($optkey =~ /^pages=(\d*),(\d*)$/) + { + # We do this hack here to avoid clashes with the page-ranges atrribute + # which is handled by the pstops filter. And we allow one of the numbers + # to be omitted. + my $first = $1; + my $lastp = $2; + $cmdopt .= " -f $1" if ($1); # first page + $cmdopt .= " -l $2" if ($2); # last page + } + elsif ($optkey =~ /^paper=(letter|legal|A4|A3|match)$/) + { + $cmdopt .= " -paper $1"; # paper name + } + elsif ($optkey =~ /^paper=(\d+)x(\d+)$/) + { + $cmdopt .= " -paperw $1 -paperh $2"; # paper dimensions + } + elsif ($optkey =~ /^(o|u)pw=(\S+)$/) + { + $cmdopt .= " $1" . 'pw ' . $2; # owner/user password + } + elsif ($optkey =~ /^($simple)$/) + { + $cmdopt .= ' -' . $1; # allowed simple options + } + else + { + warn ("ERROR: pdftops wrapper: illegal attribute \"pdf-$optkey\"\n"); + } + } + # All other attributes are processed elsewhere +} +# +# Complete the command +# +warn ("ERROR: pdftops-options: $cmdopt\n"); +$rc = system ("$pdftops_path $cmdopt $pdffile -"); +if ($rc) +{ + $ir = $rc & 127; + $rc >>= 8; + warn ("ERROR: pdftops_path exited with ", ($ir) ? "signal $ir, " : " exit code $rc", "\n"); + exit $rc; +} +unlink ($pdffile) if (defined $delete_input); # Delete the temp file if any +exit 0; |