--- texlive-bin-2007.dfsg.1.orig/texmf/tpm/collection-binextra.tpm
+++ texlive-bin-2007.dfsg.1/texmf/tpm/collection-binextra.tpm
@@ -32,6 +32,7 @@
+
--- texlive-bin-2007.dfsg.1.orig/texmf/tpm/bin-dvipos.tpm
+++ texlive-bin-2007.dfsg.1/texmf/tpm/bin-dvipos.tpm
@@ -0,0 +1,76 @@
+
+
+
+ bin-dvipos
+ TLCore
+ 2007/02/05 09:35:04
+
+ popineau
+ dvipos
+
+
+ Jin-Hwan Cho, Shunsaku Hirata
+ 13898649
+
+
+
+bin/${ARCH}/dvipos
+bin/win32/dvipos.exe
+
+
+texmf/tpm/bin-dvipos.tpm
+
+ texmf/doc/man/man1/dvipos.*
+
+
+bin/alpha-linux/dvipos
+
+ bin/hppa-hpux/dvipos
+
+
+bin/i386-darwin/dvipos
+
+
+bin/i386-freebsd/dvipos
+
+
+bin/i386-linux/dvipos
+
+
+bin/i386-openbsd/dvipos
+
+
+bin/i386-solaris/dvipos
+
+ bin/mips-irix/dvipos
+
+
+bin/powerpc-aix/dvipos
+
+
+bin/powerpc-darwin/dvipos
+
+
+bin/powerpc-linux/dvipos
+
+
+bin/sparc-linux/dvipos
+
+
+bin/sparc-solaris/dvipos
+
+ bin/win32/dvipos.exe
+
+
+bin/x86_64-linux/dvipos
+
+
+texmf/tpm/bin-dvipos.tpm
+
+
+texmf/doc/man/man1/dvipos.1
+
+ TLCore/bin-dvipos
+
+
+
--- texlive-bin-2007.dfsg.1.orig/texmf/doc/man/man1/dvipos.1
+++ texlive-bin-2007.dfsg.1/texmf/doc/man/man1/dvipos.1
@@ -0,0 +1,153 @@
+.TH "DVIPOS" "1" "January 2007" "dvipos 20070107 (KPATHSEA)" "ConTeXt"
+.de URL
+\\$2 \(laURL: \\$1 \(ra\\$3
+..
+.if \n[.g] .mso www.tmac
+.de EX
+.in +3
+.nf
+.ft CW
+..
+.de EE
+.in -3
+.ft R
+.fi
+..
+
+.SH NAME
+dvipos \- compute positions in a DVI file
+
+.SH SYNOPSIS
+\fBdvipos\fP [ \fIOPTION\fP... ] \fIinfile[.dvi]\fP
+
+.SH DESCRIPTION
+\fBdvipos\fP parses a DVI file looking for \fIpos:\fP specials. It
+currently recognizes \fIpos:pxy\fP, \fIpos:pxywhd\fP,
+\fIpos:pxyplus\fP, \fIpos:begbox\fP, \fIpos:endbox\fP,
+\fIpos:beglines\fP, and \fIpos:endlines\fP. It then outputs the
+information from those specials along with information that only a DVI
+postprocessor could determine, such as the current \fIx\fP and \fIy\fP
+location. The output looks like:
+.EX
+\\pospxywhd{text:54}{54}{10663sp}{8535sp}{21326sp}{34081sp}{0sp}
+.EE
+and is suitable for including in a
+.BR tex (1)
+or
+.BR pdftex (1)
+auxilliary file, such as \fIdocument.tuo\fP, to be read in by the next
+run of the
+.BR tex (1)
+or similar typesetting engine.
+
+.SH OPTIONS
+
+.TP
+\fB-h, --help\fR
+print usage.
+.TP
+\fB-W, --warning\fR
+print warnings.
+.TP
+\fB-v, --verbose\fR
+print verbose output.
+.TP
+\fB-d, --debug\fR
+print
+.BR dvitype (1)
+debugging data.
+.TP
+\fB-s, --smashchars\fR
+regard height and depth as zero.
+.TP
+\fB-o, --output=\fIFILE\fR
+send all output to FILE. Without this option, output goes to stdout.
+.TP
+\fB-b, --bbox[=\fP\fIFILE\fP]\fR
+send bounding box to FILE (default FILE is \fIinfile.pos\fP).
+.TP
+\fB-f, --framed[=\fP\fIBASE\fP]\fR
+request copy of DVI file, \fIBASE.dvi\fP, with bounding boxes
+\fBframed\fP (default FILE is \fIinfile_frames.dvi\fP). See the
+\fB--framesize\fP option.
+.TP
+\fB-m, --mag=\fIINT\fR
+override
+.BR tex (1)
+magnification by INT.
+.TP
+\fB-w, --framesize=\fIINT\fR
+set frame rule size by INT (default 6554 = .1pt).
+.TP
+\fB-p, --pages=\fIX:Y\fR
+set page ranges from X to Y.
+
+.SH USAGE
+.B dvipos
+is run mostly behind the scenes by ConTeXt's
+.BR texexec (1)
+between runs of
+.BR tex (1)
+or
+.BR pdftex (1),
+in order to provide information to and get information about
+positional graphics. These graphics are provided by the MetaFun
+interface to
+.BR mpost (1).
+\fBdvipos\fP is not used (or needed) in PDF-output mode but is
+needed for DVI-output mode.
+.BR pdftex (1)
+starting with version 1.40 can produce position information even in
+DVI mode, so once the ConTeXt macros take advantage of this feature,
+the need for \fBdvipos\fP will fade.
+
+Until then, here is a typical use of \fBdvipos\fP:
+.EX
+dvipos notes.dvi
+.EE
+The position information that is output is collected by
+.BR texexec (1)
+to include in the \fInotes.tuo\fP auxilliary file to use in the next
+run.
+
+
+.SH EXAMPLES
+.TP
+Extract positions from \fIdoc.dvi\fP, with output to \fIdoc.loc\fP:
+\f(CWdvipos -o doc.loc doc.dvi\fP
+.TP
+Same as above, but also send bbox information to \fIdoc.pos\fP:
+\f(CWdvipos -b -o doc.loc doc.dvi\fP
+.TP
+Instead send bbox information to \fI/tmp/debug.pos\fP:
+\f(CWdvipos -b=/tmp/debug.pos -o doc.loc doc.dvi\fP
+
+.SH "SEE ALSO"
+.BR dvips (1),
+.BR dvitype (1),
+.BR mpost (1),
+.BR pdftex (1),
+.BR tex (1),
+.BR texexec (1).
+
+For more about positional graphics, see the MetaFun documentation on
+the
+.URL "http://wiki.contextgarden.net/MetaFun" "ConTeXt wiki" .
+
+.SH BUGS
+If you specify a file for the \fB-b\fP option, you must join the
+option and name with rather than (the more common) space:
+.EX
+dvipos -b=/tmp/debug.pos notes.dvi
+.EE
+works, but
+.EX
+dvipos -b /tmp/debug.pos notes.dvi
+.EE
+does not.
+
+.SH AUTHOR
+.B dvipos
+is written by Jin-Hwan Cho . It is free
+software (GPLv2 or later). This manpage was written by Sanjoy
+Mahajan and is in the public domain.
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-omega.root/usr/share/man/man1/odvicopy.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-omega.root/usr/share/man/man1/odvicopy.1
@@ -0,0 +1,24 @@
+.TH DVICOPY 1 TeX "24 January 1999" "Web2C 7.5.6"
+.SH NAME
+odvicopy \- produce modified copy of DVI file with Omega extensions
+.SH SYNOPSIS
+.B odvicopy
+.RI [ options ]
+.RI [ infile\ [ outfile ]]
+.SH DESCRIPTION
+This manual page is not meant to be exhaustive. The complete
+documentation for this version of \*(TX can be found in the info file
+or manual
+.IR "Web2C: A TeX implementation" .
+.PP
+.B odvicopy
+reads a DVI file,
+possibly with Omega extensions,
+expands any references to (Omega) virtual fonts to base
+fonts, and writes the resulting DVI file. Thus you can use virtual
+fonts even if your DVI processor does not support them, by passing the
+documents through
+.B odvicopy
+first.
+.SH "SEE ALSO"
+dviselect(1), omega(1)
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-omega.root/usr/share/man/man1/omfonts.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-omega.root/usr/share/man/man1/omfonts.1
@@ -0,0 +1,14 @@
+.TH "omfonts" "1" "March 2006" "Omega" "Omega"
+.PP
+.SH "NAME"
+omfonts \ - the driver program behind ofm2opl, opl2ofm, ovf2ovp, and ovp2ovf.
+.PP
+.SH "DESCRIPTION and SEE ALSO"
+.PP
+Please see the respective man pages of \fBofm2opl\fP(1), \fBopl2ofm\fP(1),
+\fBovf2ovp\fP(1), and \fBovp2ovf\fP(1).
+.PP
+.SH "AUTHOR"
+.PP
+This manual page was written by Norbert Preining , for
+the Debian GNU/Linux system. It is too trivial to deserve special attention.
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-omega.root/usr/share/man/man1/aleph.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-omega.root/usr/share/man/man1/aleph.1
@@ -0,0 +1,380 @@
+.TH ALEPH 1 "21 August 2004" "Web2C 7.5.5"
+.\"=====================================================================
+.if n .ds MF Metafont
+.if t .ds MF M\s-2ETAFONT\s0
+.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
+.if n .ds TX TeX
+.if n .ds MF Metafont
+.if t .ds MF M\s-2ETAFONT\s0
+.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP for troff
+.el .ds OX TeX for nroff
+.\" the same but obliqued
+.\" BX definition must follow TX so BX can use TX
+.if t .ds BX \fRB\s-2IB\s0\fP\*(TX
+.if n .ds BX BibTeX
+.\" LX definition must follow TX so LX can use TX
+.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX
+.if n .ds LX LaTeX
+.if t .ds AX \fRA\\h'-0.1667m'\\v'0.20v'M\\v'-0.20v'\\h'-0.125m'S\fP\*(TX
+.if n .ds AX AmSTeX
+.if t .ds AY \fRA\\h'-0.1667m'\\v'0.20v'M\\v'-0.20v'\\h'-0.125m'S\fP\*(LX
+.if n .ds AY AmSLaTeX
+.\"=====================================================================
+.SH NAME
+aleph \- extended unicode TeX
+.PP
+lamed \- latex format based on aleph
+.SH SYNOPSIS
+.B aleph
+.RI [ options ]
+[\fB&\fR \fIformat\fR ]
+[ \fIfile\fR | \fB\e\fR \fIcommands\fR ]
+.\"=====================================================================
+.SH DESCRIPTION
+Aleph, formerly known as e-Omega, is a project whose aim is to
+provide an extension to Knuth's TeX comprising both Omega 1.15
+and e-TeX 2.1 features. Its main goals are stability, speed and
+power.
+.PP
+Run the aleph
+typesetter on
+.IR file ,
+usually creating
+.IR file.dvi .
+If the file argument has no extension, ".tex" will be appended to it.
+Instead of a filename, a set of aleph commands can be given, the first
+of which must start with a backslash.
+With a
+.BI & format
+argument aleph uses a different set of precompiled commands,
+contained in
+.IR format.fmt ;
+it is usually better to use the
+.B -fmt
+.I format
+option instead.
+.PP
+aleph consist of a merge of Omega 1.15 and e-\*(TX and strives for
+bringing a stabil and reliable system with the capabilities of Omega.
+.PP
+lamed is the name of the latex format dumped by aleph.
+.PP
+Please see the man pages of omega(1) and etex(1) for more detailed
+descriptions of the features.
+.\"=====================================================================
+.SH OPTIONS
+This version of e-\*(TX understands the following command line options.
+.TP
+.BI -fmt \ format
+.rb
+Use
+.I format
+as the name of the format to be used, instead of the name by which
+aleph was called or a
+.I %&
+line.
+.TP
+.B -etex
+.rb
+Enable the e-\*(TX extensions. This option is only effective in
+combination with
+.BR -ini .
+.TP
+.B -file-line-error
+.rb
+Print error messages in the form
+.I file:line:error
+which is similar to the way many compilers format them.
+.TP
+.B -no-file-line-error
+.rb
+Disable printing error messages in the
+.I file:line:error
+style.
+.TP
+.B -file-line-error-style
+.rb
+This is the old name of the
+.B -file-line-error
+option.
+.TP
+.B -halt-on-error
+.rb
+Exit with an error code when an error is encountered during processing.
+.TP
+.B -help
+.rb
+Print help message and exit.
+.TP
+.B -ini
+.rb
+Start in
+.I INI
+mode, which is used to dump formats. The
+.I INI
+mode can be used for typesetting, but no format is preloaded, and
+basic initializations like setting catcodes may be required.
+.TP
+.BI -interaction \ mode
+.rb
+Sets the interaction mode. The mode can be either
+.IR batchmode ,
+.IR nonstopmode ,
+.IR scrollmode ,
+and
+.IR errorstopmode .
+The meaning of these modes is the same as that of the corresponding
+\ecommands.
+.TP
+.B -ipc
+.rb
+Send DVI output to a socket as well as the usual output file. Whether
+this option is available is the choice of the installer.
+.TP
+.B -ipc-start
+.rb
+As
+.BR -ipc ,
+and starts the server at the other end as well. Whether this option
+is available is the choice of the installer.
+.TP
+.BI -jobname \ name
+.rb
+Use
+.I name
+for the job name, instead of deriving it from the name of the input file.
+.TP
+.BI -kpathsea-debug \ bitmask
+.rb
+Sets path searching debugging flags according to the bitmask. See the
+.I Kpathsea
+manual for details.
+.TP
+.BI -mktex \ fmt
+.rb
+Enable
+.RI mktex fmt ,
+where
+.I fmt
+must be either
+.I tex
+or
+.IR tfm .
+.TP
+.B -mltex
+.rb
+Enable ML\*(TX extensions. Only effective in combination with
+.BR -ini .
+.TP
+.BI -no-mktex \ fmt
+.rb
+Disable
+.RI mktex fmt ,
+where
+.I fmt
+must be either
+.I tex
+or
+.IR tfm .
+.TP
+.BI -output-comment \ string
+.rb
+Use
+.I string
+for the
+.I DVI
+file comment instead of the date.
+.TP
+.BI -output-directory \ directory
+.rb Write output files in
+.I directory
+instead of the current directory. Look up input files in
+.I directory
+first, the along the normal search path.
+.TP
+.B -parse-first-line
+.rb
+If the first line of the main input file begins with
+.I %&
+parse it to look for a dump name or a
+.B -translate-file
+option.
+.TP
+.B -no-parse-first-line
+.rb
+Disable parsing of the first line of the main input file.
+.TP
+.BI -progname \ name
+.rb
+Pretend to be program
+.IR name .
+This affects both the format used and the search paths.
+.TP
+.B -recorder
+.rb
+Enable the filename recorder. This leaves a trace of the files opened
+for input and output in a file with extension
+.IR .fls .
+.TP
+.B -shell-escape
+.rb
+Enable the
+.BI \ewrite18{ command }
+construct. The
+.I command
+can be any shell command. This construct is normally
+disallowed for security reasons.
+.TP
+.B -no-shell-escape
+.rb
+Disable the
+.BI \ewrite18{ command }
+construct, even if it is enabled in the
+.I texmf.cnf
+file.
+.TP
+.B -src-specials
+.rb
+Insert source specials into the
+.I DVI
+file.
+.TP
+.BI -src-specials \ where
+.rb
+Insert source specials in certain placed of the
+.I DVI
+file.
+.I where
+is a comma-separated value list:
+.IR cr ,
+.IR display ,
+.IR hbox ,
+.IR math ,
+.IR par ,
+.IR parent ,
+or
+.IR vbox .
+.TP
+.BI -translate-file \ tcxname
+.rb
+Use the
+.I tcxname
+translation table to set the mapping of input characters and
+re-mapping of output characters.
+.TP
+.BI -default-translate-file \ tcxname
+.rb
+Like
+.B -translate-file
+except that a
+.I %&
+line can overrule this setting.
+.TP
+.B -version
+.rb
+Print version information and exit.
+.\"=====================================================================
+.SH ENVIRONMENT
+See the Kpathsearch library documentation (the `Path specifications'
+node) for precise details of how the environment variables are used.
+The
+.B kpsewhich
+utility can be used to query the values of the variables.
+.PP
+One caveat: In most aleph formats, you cannot use ~ in a filename you
+give directly to aleph, because ~ is an active character, and hence is
+expanded, not taken as part of the filename. Other programs, such as
+\*(MF, do not have this problem.
+.PP
+.TP
+TEXMFOUTPUT
+Normally, aleph puts its output files in the current directory. If
+any output file cannot be opened there, it tries to open it in the
+directory specified in the environment variable TEXMFOUTPUT.
+There is no default value for that variable. For example, if you say
+.I etex paper
+and the current directory is not writable, if TEXMFOUTPUT has
+the value
+.IR /tmp ,
+aleph attempts to create
+.I /tmp/paper.log
+(and
+.IR /tmp/paper.dvi ,
+if any output is produced.)
+.TP
+TEXINPUTS
+Search path for
+.I \einput
+and
+.I \eopenin
+files.
+This should probably start with ``.'', so
+that user files are found before system files. An empty path
+component will be replaced with the paths defined in the
+.I texmf.cnf
+file. For example, set TEXINPUTS to ".:/home/usr/tex:" to prepend the
+current direcory and ``/home/user/tex'' to the standard search path.
+.TP
+TEXFORMATS
+Search path for format files.
+.TP
+TEXPOOL
+search path for
+.B etex
+internal strings.
+.TP
+TEXEDIT
+Command template for switching to editor. The default, usually
+.BR vi ,
+is set when aleph is compiled.
+.TP
+TFMFONTS
+Search path for font metric
+.RI ( .tfm )
+files.
+.\"=====================================================================
+.SH FILES
+The location of the files mentioned below varies from system to
+system. Use the
+.B kpsewhich
+utility to find their locations.
+.TP
+.I aleph.pool
+Text file containing aleph's internal strings.
+.TP
+.I texfonts.map
+Filename mapping definitions.
+.TP
+.I *.tfm
+Metric files for aleph's fonts.
+.TP
+.I *.fmt
+Predigested aleph format (.\|fmt) files.
+.br
+.\"=====================================================================
+.SH NOTES
+This manual page is not meant to be exhaustive. The complete
+documentation for this version of aleph can be found in the info
+manual
+.IR "Web2C: A TeX implementation" .
+.\"=====================================================================
+.SH "SEE ALSO"
+.BR etex (1),
+.BR omega(1).
+.\"=====================================================================
+.SH AUTHORS
+aleph was written by Giuseppe Bilotta.
+e-\*(TX was developed by Peter Breitenlohner (and the NTS team).
+\*(TX was designed by Donald E. Knuth,
+who implemented it using his \*(WB system for Pascal programs.
+It was ported to Unix at Stanford by Howard Trickey, and
+at Cornell by Pavel Curtis.
+The version now offered with the Unix \*(TX distribution is that
+generated by the \*(WB to C system
+.RB ( web2c ),
+originally written by Tomas Rokicki and Tim Morgan.
+The enc\*(TX extensions were written by Petr Olsak.
+The primary authors of Omega are John Plaice and Yannis Haralambous.
+This manpage has
+been written by Norbert Preining for Debian/GNU Linux by adapting the
+man page for etex and may be used, modified and/or distributed freely by anyone.
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-omega.root/usr/share/man/man1/otangle.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-omega.root/usr/share/man/man1/otangle.1
@@ -0,0 +1,147 @@
+.TH OTANGLE 1 "20 October 2002" "Web2C 7.5.5"
+.\"=====================================================================
+.if n .ds MF Metafont
+.if t .ds MF M\s-2ETAFONT\s0
+.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
+.if n .ds TX TeX
+.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP for troff
+.el .ds OX TeX for nroff
+.\" the same but obliqued
+.\" BX definition must follow TX so BX can use TX
+.if t .ds BX \fRB\s-2IB\s0\fP\*(TX
+.if n .ds BX BibTeX
+.\" LX definition must follow TX so LX can use TX
+.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX
+.if n .ds LX LaTeX
+.if n .ds WB Web
+.if t .ds WB W\s-2EB\s0
+.\"=====================================================================
+.SH NAME
+otangle \- translate WEB to Pascal
+.SH SYNOPSIS
+.B otangle
+[
+.RI options
+]
+.I webfile[.web]
+[
+.I changefile[.ch]
+]
+.\"=====================================================================
+.SH DESCRIPTION
+This manual page is not meant to be exhaustive. The complete
+documentation for this version of \*(TX can be found in the info file
+or manual
+.IR "Web2C: A TeX implementation" .
+.PP
+The
+.B otangle
+program converts a \*(WB
+source document into a Pascal program that may be compiled in the usual
+way with the on-line Pascal compiler (e.g.,
+.BR pc (1)).
+The output file is packed into lines of 72 characters or less, with
+the only concession to readability being the termination of lines at
+semicolons when this can be done conveniently.
+.PP
+The \*(WB language allows you to prepare a single document containing all
+the information that is needed both to produce a compilable Pascal
+program and to produce a well-formatted document describing the program
+in as much detail as the writer may desire. The user of \*(WB must be
+familiar with both \*(TX and Pascal. \*(WB also provides a relatively
+simple, although adequate, macro facility that permits a Pascal program
+to be written in small easily-understood modules.
+.PP
+The command line should have either one or two names on it.
+The first is taken as the \*(WB file (and
+.I .web
+is added if there is no
+extension).
+If there is another name, it is a change file (and
+.I .ch
+is added if there is
+no extension). The change file overrides parts of the \*(WB file,
+as described in the \*(WB system documentation.
+.PP
+The output files are a Pascal file and a string pool file,
+whose names are formed by adding
+.I .p
+and
+.I .pool
+respectively to the root of the \*(WB file name.
+.\"=====================================================================
+.SH "OPTIONS"
+This version of
+.B otangle
+understands the following options. Note that some of these options
+may render the output unsuitable for processing by a Pascal compiler.
+.TP
+.B --help
+.rb
+Print help message and exit.
+.TP
+.B --version
+.rb
+Print version information and exit.
+.\"=====================================================================
+.SH "SEE ALSO"
+.BR pc (1),
+.BR pxp (1)
+(for formatting
+.B otangle
+output when debugging),
+.BR tex (1).
+.PP
+Donald E. Knuth,
+.IR "The \*(WB System of Structured Documentation" .
+.PP
+Donald E. Knuth,
+.IR "Literate Programming" ,
+Computer Journal
+.BR 27 ,
+97\-111, 1984.
+.PP
+Wayne Sewell,
+.IR "Weaving a Program" ,
+Van Nostrand Reinhold, 1989, ISBN 0-442-31946-0.
+.PP
+Donald E. Knuth,
+.I "\*(OX: The Program"
+(Volume B of
+.IR "Computers and Typesetting" ),
+Addison-Wesley, 1986, ISBN 0-201-13437-3.
+.PP
+Donald E. Knuth,
+.I "\*(MF: The Program"
+(Volume D of
+.IR "Computers and Typesetting" ),
+Addison-Wesley, 1986, ISBN 0-201-13438-1.
+.PP
+These last two are by far the largest extant examples of \*(WB
+programs.
+.PP
+There is an active Internet electronic mail discussion list on the
+subject of literate programming; send a subscription request to
+.I litprog-request@shsu.edu
+to join.
+.\"=====================================================================
+.SH AUTHORS
+\*(WB was designed by Donald E. Knuth, based on an earlier system
+called DOC (implemented by Ignacio Zabala).
+The
+.B tangle
+and
+.B weave
+programs are themselves written in \*(WB. The system
+was originally ported to Unix at Stanford by Howard Trickey, and at
+Cornell by Pavel Curtis.
+.PP
+.B otangle
+incorporates extensions for Omega, and is written by
+John Plaice and Yannis Haralambous.
+.PP
+This manpage has
+been written by Norbert Preining for Debian/GNU Linux by adapting the
+man page for tangle and may be used, modified and/or distributed freely
+by anyone.
+
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-omega.root/usr/share/man/man1/odvitype.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-omega.root/usr/share/man/man1/odvitype.1
@@ -0,0 +1,76 @@
+.TH DVITYPE 1 "19 December 1994" "Web2C 7.5.6"
+.\"=====================================================================
+.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
+.if n .ds TX TeX
+.ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP for troff
+.el .ds OX TeX for nroff
+.\" the same but obliqued
+.\" BX definition must follow TX so BX can use TX
+.if t .ds BX \fRB\s-2IB\s0\fP\*(TX
+.if n .ds BX BibTeX
+.\" LX definition must follow TX so LX can use TX
+.if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX
+.if n .ds LX LaTeX
+.\"=====================================================================
+.SH NAME
+odvitype \- translate a dvi file with Omega extensions for humans
+.SH SYNOPSIS
+.B odvitype
+.I dvi_name[.dvi]
+.\"=====================================================================
+.SH DESCRIPTION
+This manual page is not meant to be exhaustive. The complete
+documentation for this version of \*(TX can be found in the info file
+or manual
+.IR "Web2C: A TeX implementation" .
+.PP
+The
+.B odvitype
+program translates a DVI (DeVice Independent) file output by (for example)
+.BR tex (1)
+or
+.BR gftodvi (1),
+possibly containing Omega extensions,
+to a file that humans can read. It also serves as a DVI file-validating
+program (i.e., if
+.B odvitype
+can read it, it's correct) and as an example of a DVI-reading
+program for future device drivers.
+.PP
+The output file can include all commands, just the important
+ones, or none at all (in which case only errors are reported).
+A subinterval of pages may be selected for transliteration; the
+magnification and resolution of the ``output device'' may be
+changed; and so on. All options are specified with an on-line dialog.
+.PP
+The
+.I .dvi
+extension is supplied if omitted from
+.IR dvi_name .
+The output goes to
+.IR stdout .
+.\"=====================================================================
+.SH ENVIRONMENT
+The environment variable TEXFONTS is used to search for the TFM files
+used in the DVI file. See
+.BR tex (1)
+for the details of the searching.
+If TEXFONTS is not set, it uses the system default.
+.\"=====================================================================
+.SH "SEE ALSO"
+.BR gftype (1),
+.BR pktype (1),
+.BR omega (1).
+.br
+Donald E. Knuth,
+.IR \*(OXware .
+.\"=====================================================================
+.SH BUGS
+The interactive dialog should be replaced by command-line options, as
+with
+.BR gftype .
+.SH AUTHORS
+Donald E. Knuth wrote the program. It was published as part of the
+.I \*(OXware
+technical report, available from the \*(TX Users Group.
+Howard Trickey and Pavel Curtis originally ported it to Unix.
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-base-bin.root/usr/bin/pslatex
+++ texlive-bin-2007.dfsg.1/debian/texlive-base-bin.root/usr/bin/pslatex
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# Copyright 1994 David Carlisle
+# This file may be redistributed and/or modified under the terms of the
+# LaTeX Project Public License distributed from CTAN archives in directory
+# macros/latex/base/lppl.txt; either version 1 of the License, or (at
+# your option) any later version.
+
+test -f /bin/sh5 && test -z "$RUNNING_SH5" \
+ && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \
+ && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; }
+unset RUNNING_SH5
+
+test -f /bin/bsh && test -z "$RUNNING_BSH" \
+ && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \
+ && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; }
+unset RUNNING_BSH
+
+# hack around a bug in zsh:
+test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
+
+# we want to be able to use options to latex:
+while :; do
+ case $1 in
+ -*)
+ latexoptions="$latexoptions \"$1\""
+ shift;;
+ *)
+ break;;
+ esac
+done
+
+echo
+echo "*************************************"
+echo "* Using LaTeX, with pslatex package *"
+echo "*************************************"
+echo
+
+# messing around with \PSLATEXTMP is for AUCTeX which calls
+# documents via latex \nonstopmode \input{file}
+
+latex $latexoptions \
+ "\AtBeginDocument{\RequirePackage{pslatex}}"\
+ "\def\PSLATEXTMP{\futurelet\PSLATEXTMP\PSLATEXTMPB}"\
+ "\def\PSLATEXTMPB{\ifx\PSLATEXTMP\nonstopmode\else\input\fi}"\
+ "\PSLATEXTMP" ${1+"$@"}
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-base-bin.root/usr/bin/xdvi
+++ texlive-bin-2007.dfsg.1/debian/texlive-base-bin.root/usr/bin/xdvi
@@ -0,0 +1,98 @@
+#! /usr/bin/perl -w
+
+# This is the xdvi wrapper script for Debian, based on Thomas Esser's
+# teTeX version 0.2.
+# Debian version: Copyright Julian Gilbey, 2002. Lots of modifications
+# by Chung-chieh Shan .
+# Also by TSUCHIYA Masatoshi .
+# Original version: Copyright Thomas Esser, 1998.
+# Permission to distribute this software is given under the terms of
+# the GNU general public license version 2 or later.
+
+# Thomas writes:
+# This script sets some environment variables to make sure that xdvi's
+# resource file in $XDVIINPUTS/xdvi is read by xdvi.bin.
+# Special care was taken to make this work for old R3, too. Therefore,
+# we need to modify XAPPLRESDIR. If you are running R4 or later, you
+# can set XUSERFILESEARCHPATH for user specific application default
+# files. You cannot use XAPPLRESDIR for user specific application default
+# files.
+
+# Julian writes:
+# This has been rewritten in Perl so that we can mangle the arguments
+# to handled gzipped dvi files, which not have errors if there are
+# spaces in some arguments. XAPPLRESDIR is no longer modified.
+
+# Stephen Gildea writes:
+# Debian distributes X11R6, therefore this script should not clobber
+# XAPPLRESDIR, which is for user customizations.
+
+use strict;
+use FileHandle;
+use File::Basename;
+use File::Spec;
+use File::Temp qw/ tempfile /;
+
+my @NAMEOPT;
+if (@ARGV == 1 and ($ARGV[0] eq '-help' or $ARGV[0] eq '-version')) {
+ @NAMEOPT=();
+} else {
+ @NAMEOPT=qw(-name xdvi);
+}
+
+$ENV{'XDVIINPUTS'} .= ":\$TEXMF/{xdvi,web2c}";
+
+my ($xdviappfile, $xdviappdir, $xdviapppath);
+$xdviappfile=`kpsewhich -progname=xdvi --format='other text files' XDvi`;
+if ("$xdviappfile" ne '') {
+ $xdviappdir=dirname($xdviappfile);
+ $xdviapppath="$xdviappdir/%N";
+
+ if (exists $ENV{'XFILESEARCHPATH'}) {
+ $ENV{'XFILESEARCHPATH'} = "$xdviapppath:$ENV{'XFILESEARCHPATH'}";
+ } else {
+ $ENV{'XFILESEARCHPATH'} = "$xdviapppath:%D";
+ }
+}
+
+my $status;
+if (@ARGV) {
+ my $filename = pop @ARGV;
+
+ if ($filename =~ /\.(gz|Z|bz2)$/) {
+ my @command = $1 eq 'bz2' ? qw(bzip2 -d -c) : qw(gzip -d -c);
+
+ require Fcntl;
+ my $fh = tempfile( UNLINK => 1 )
+ or die "xdvi: cannot create temporary file: $!\n";
+ fcntl $fh, Fcntl::F_SETFD(), 0
+ or die "xdvi: disabling close-on-exec for temporary file: $!\n";
+
+ if (my $child = fork) {
+ 1 while wait != $child;
+ if ($? & 255) {
+ die "xdvi: $command[0] terminated abnormally: $?\n";
+ } elsif ($?) {
+ my $code = $? >> 8;
+ die "xdvi: $command[0] terminated with exit code $code\n";
+ }
+ } elsif (defined $child) {
+ STDOUT->fdopen( $fh, "w" );
+ exec @command, $filename;
+ } else {
+ die "xdvi: fork: $!\n";
+ }
+ $status = system('xdvi.bin', @NAMEOPT, @ARGV, '/dev/fd/'.fileno($fh));
+ } else {
+ $status = system('xdvi.bin', @NAMEOPT, @ARGV, $filename);
+ }
+} else {
+ $status = system('xdvi.bin', @NAMEOPT);
+}
+
+if ($status & 255) {
+ die "xdvi: xdvi.bin terminated abnormally: $?\n";
+} else {
+ my $code = $? >> 8;
+ exit $code;
+}
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-base-bin.root/usr/share/texmf-texlive/scripts/debian/debianize-updmap
+++ texlive-bin-2007.dfsg.1/debian/texlive-base-bin.root/usr/share/texmf-texlive/scripts/debian/debianize-updmap
@@ -0,0 +1,414 @@
+# This file, debianize-updmap, is meant to be sourced by updmap and
+# enhance the --enable and --disable options with the functionality
+# needed to deal with Debian's generated updmap.cfg.
+# $Id$
+
+# This is the planned scheme how it works
+#
+# A for disableMap:
+# 1. create a list of files to act on (either in sysconfdir only, or in user dirs too)
+# 2. grep for not-commented lines in these files that contain $map
+# CHANGE 3. for each of these files, run configReplace appropriately
+# 3. if in syswide-mode, for each of these files, run configReplace appropriately;
+# if not in syswide mode, for each of these files,
+# test whether it is in the syswide dir
+# 3.a if not, run configReplace appropriately
+# 3b. if yes, create copy in user dir and run configReplace appropriately
+#
+# B for enableMap:
+# 1. create a list of files to act on (either in sysconfdir only, or in user dirs too)
+# 2. grep for commented lines in these files that contain $map
+# 2.1. if any are found, check whether it is only one
+# 2.1.1 if there is only one, run configReplace on that file appropriately
+# 2.1.2 if there is more than one, the precedence is
+# 20tetex-extra.cfg > XX*local*.cfg > 10tetex-base.cfg > any
+# (extra has maximum priority because
+# 2.1.2.1 if it's clear on which file to act, run configReplace on that file
+# appropriately
+# 2.1.2.2 if unclear (i.e. only "any"), exit with an error
+# 2.2 if none are found, act on 10local.cfg (could be made configurable)
+# - if 10local.cfg does not exist, create it (with an explanatory comment)
+# - run configReplace on it appropriately
+#
+# C for syncwithtrees (and even more?)
+# ?
+#
+# After that, update-updmap must be run (in the appropriate mode!), and then updmap
+# must reexecute itself. Since disableMap is called by enableMap, we need a wrapper
+# for it. An alternative would be to do this just before the creation of the output
+# files, but I think it's easier this way, and currently updmap only enables one Map
+# file per run.
+
+###############################################################################
+# DebianSyswideMode ()
+# determine whether we are running in syswide mode (or user-specific)
+###############################################################################
+DebianSyswideMode(){
+ test "$(id -u)" -eq 0 && return 0 || return 1
+}
+
+###############################################################################
+# FindDebianUserdir ()
+# find the directory containing user-specific updmap snippets
+###############################################################################
+FindDebianUserdir(){
+ defaultuserdir=$HOME/.texmf-config/updmap.d
+
+ # this should read a config item in updmap.cfg, but for now we just
+ # check whether the default exists.
+ if [ -d $defaultuserdir ]; then
+ echo $defaultuserdir
+ fi
+}
+
+
+###############################################################################
+# createDebianConffilelist
+# create a list of configuration files containing updmap snippets;
+# we are going to act on these
+###############################################################################
+createDebianConffilelist(){
+ local DebianConffilelist=""
+ syswideFiles=`find /etc/texmf/updmap.d -maxdepth 1 -type f -name '*.cfg'`
+ if ! DebianSyswideMode; then
+ debianuserdir=`FindDebianUserdir`
+ if [ -n "$debianuserdir" ]; then
+ userFiles=`find "$debianuserdir" -maxdepth 1 -type f -name '*.cfg'`
+ fi
+ fi
+ if [ -n "$userFiles" ]; then
+ userBasenames=`for file in $userFiles; do basename $file; done`
+ for file in $syswideFiles; do
+ local copyInUserdir=false
+
+ done
+ else
+ fi
+}
+
+###############################################################################
+# runUpdate
+# run update-updmap
+###############################################################################
+runUpdate(){
+ updOptions=""
+ if [ -n "$cfgparam" ]; then
+ # --conffile option was given on the command line
+ updOptions="--output-file $orig"
+ fi
+ # here we could check for an alternative user dir, or output file
+ # but as long as FindDebianUserdir only reports the default location,
+ # it doesn't make sense
+
+ verboseMsg "Running update-updmap to merge the changed files"
+ update-updmap --quiet $updOptions
+}
+###############################################################################
+# cleanupNoExit()
+# clean up the temp area, but don't exit
+###############################################################################
+cleanupNoExit()
+{
+ rc=$?
+ $needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
+ && { cd / && rm -rf "$tmpdir"; }
+}
+
+###############################################################################
+# reExecSelf
+# execute ourselves again - the confile has changed after an enable or disable
+# command has been processed
+###############################################################################
+reExecSelf(){
+ # remove the temporary directory
+ cleanupNoExit
+
+ # if we need not remake map files, we are done here
+ if [ "$mkmapEnabled" = "false" ]; then exit 0; fi
+
+ # pass ourselves the right options.
+ repeatOptions=""
+ for option in dvipsoutputdir pdftexoutputdir dvipdfmoutputdir; do
+ # strange that I can't do the same with eval test -n
+ if eval [ ! -z "\$$option" ]; then
+ repeatOptions="$repeatOptions `eval echo --$option \\$$option`"
+ fi
+ done
+ if [ -n "$cfgparam" ]; then
+ # --conffile option was given on the command line
+ repeatOptions="$repeatOptions --cnffile=$orig"
+ fi
+ if [ "texhashEnabled" = "false" ]; then
+ repeatOptions="$repeatOptions --nohash"
+ fi
+ if [ "$verbose" = "false" ]; then
+ repeatOptions="$repeatOptions --quiet"
+ fi
+
+ verboseMsg "Now running $progname again to generate output files"
+ echo $progname $repeatOptions
+ exec $progname $repeatOptions
+}
+
+###############################################################################
+# grepType (map,file)
+# grep in file for entry map, and return the mapType
+###############################################################################
+grepType()
+{
+ map=$1
+ file="$2"
+ egrep "^(MixedMap|Map)[ ]*$map( | |$)" "$file" | awk '{print $1}' | sort | uniq
+}
+
+
+###############################################################################
+# findUserfiles (filelist)
+# pick user-specific files out of a filelist of configuration files
+###############################################################################
+findUserfiles(){
+ userfiles=""
+ while [ $# -gt 0 ]; do
+ file="$1"
+ if [ "$file" = "${file#/etc/texmf/updmap.d}" ]; then
+ # doesn't start with /etc/texmf/updmap.d: must be user-specific
+ userfiles="$userfiles $file"
+ fi
+ shift;
+ done
+ echo $userfiles
+}
+
+###############################################################################
+# findRightMatchfile (mapname,filelist)
+# find the right file from filelist to enable mapname
+###############################################################################
+findRightMatchfile(){
+ mapName=$1; shift
+ matchfiles="$@"
+ if [ $# -eq 1 ]; then
+ # it is only one, enable map in it
+ echo $matchfiles
+ verboseMsg "Enabling map file in $matchfiles"
+ return 0
+ else
+ # there are more than one;
+ if ! DebianSyswideMode; then
+ # can only change files in the user's dir
+ usermatchfiles=`findUserfiles $matchfiles`
+ if [ `(set $usermatchfiles; echo $#)` -eq 1 ]; then
+ # exactly one of them is a user-specific file
+ echo $usermatchfiles
+ verboseMsg "Enabling map file in user-specific file $matchfiles"
+ return 0
+ else
+ # two files in the user directory (as bad as two in the site-wide
+ # dir), or no user-specific files. If there are two user-specific
+ # files, report about them:
+ test -n "$usermatchfiles" && matchfiles="$usermatchfiles" || true
+ fi
+ fi
+ # for now, we exit with an error. Any sensible choice would have to
+ # check whether teTeX or texlive is installed, and I want to save me
+ # that hazzle.
+ cat >&2 <&2 </dev/null ; then
+ matchfiles="$matchfiles $file"
+ fi
+ done
+ if [ -n "$matchfiles" ]; then
+ # there is already (at least) one file that has a commented entry for our map
+ debCnfFile=`findRightMatchfile $mapName $matchfiles`
+ test -w "$debCnfFile" || debCnfFile=""
+ fi
+ if [ -z "$debCnfFile" ]; then
+ # still none, there is no (commented) entry in any writable file yet.
+ debCnfFile=`findRightLocalfile $mapName`
+ test -n "$debCnfFile" || abort "Cannot proceed. Exiting"
+ verboseMsg "Creating new entry for map file $mapName in $debCnfFile"
+ fi
+
+ configReplace "$debCnfFile" "^#![ ]*$mapType[ ]*$mapName" "$mapType $mapName"
+ runUpdate
+ reExecSelf
+}
+
+###############################################################################
+# setOption (option, value)
+# sets option to value in the config file (replacing the existing setting
+# or by adding a new line to the config file).
+###############################################################################
+setOption()
+{
+ opt=$1
+ val=$2
+ case "$opt" in
+ LW35)
+ case "$val" in
+ URWkb|URW|ADOBE|ADOBEkb)
+ ;;
+ *)
+ abort "invalid value $val for option $opt"
+ ;;
+ esac
+ ;;
+ dvipsPreferOutline|dvipsDownloadBase35|pdftexDownloadBase14|dvipdfmDownloadBase14)
+ case "$val" in
+ true|false)
+ ;;
+ *)
+ abort "invalid value $val for option $opt"
+ esac
+ ;;
+ *)
+ abort "unsupported option $opt"
+ ;;
+ esac
+
+ DebNullCnfFile=""
+ DebianSyswideMode || debianuserdir=`FindDebianUserdir`
+ if (! DebianSyswideMode) && [ -f "$debianuserdir/00updmap.cfg" ]; then
+ DebNullCnfFile=$debianuserdir/00updmap.cfg
+ else
+ DebNullCnfFile=/etc/texmf/updmap.d/00updmap.cfg
+ fi
+
+ configReplace "$DebNullCnfFile" "^$opt[ ]" "$opt $val"
+ runUpdate
+ reExecSelf
+}
+
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-base-bin.root/usr/share/texlive-bin/config.ps
+++ texlive-bin-2007.dfsg.1/debian/texlive-base-bin.root/usr/share/texlive-bin/config.ps
@@ -0,0 +1,572 @@
+% config.ps - configuration file for dvips.
+% Tomas Rokicki, Thomas Esser, Karl Berry, et al., 1986ff, public domain.
+
+% Memory available. Download the three-line PostScript file:
+% %! Hey, we're PostScript
+% /Times-Roman findfont 30 scalefont setfont 144 432 moveto
+% vmstatus exch sub 40 string cvs show pop showpage
+% to determine this number. (It will be the only thing printed.)
+m 3500000
+
+% Run securely. z2 disables both shell command execution in
+% `\special' and config files (via the `E' option) and opening of any
+% absolute filenames. z1, the default, forbids shell escapes but
+% allows absolute filenames. z0 allows both. The corresponding
+% command line options are -R0|-R1|-R2
+z1
+
+% How to print, maybe with lp instead lpr, etc. If commented-out, output
+% will go into a file by default.
+%o |lpr
+
+% Default resolution of this device, in dots per inch.
+D 600
+X 600
+Y 600
+
+% Metafont mode. (This is completely different from the -M
+% command-line option, which controls whether mktexpk is invoked.)
+% See ../../metafont/misc/modes.mf for a list of mode names. This mode
+% and the D number above must agree, or mktexpk will get confused.
+M ljfour
+
+% Last resort bitmap sizes.
+R 300 600
+
+% Correct printer offset. You can use testpage.tex from the LaTeX
+% distribution to find these numbers.
+O 0pt,0pt
+
+% Bitmap font compression. Results in more compact output files, but
+% sometimes causes trouble. So the default is disabled. Set Z1 to enable
+% this feature.
+Z0
+
+% Partially download Type 1 fonts by default. Only reason not to do
+% this is if you encounter bugs. (Please report them to
+% @email{tex-k@tug.org} if you do.)
+j
+
+% This shows how to add your own map file.
+% Remove the comment and adjust the name:
+% p +myfonts.map
+
+% If we have setpagedevice, use that.
+% else if we have the a4 resp. letter operator, use that.
+% else do nothing to set the page size.
+%
+% In the past, the a4size and letterSize definitions did not set the
+% page size, but we want to set it if we can so that ps2pdf can work
+% properly. Here, a4 and a4size, and letter and letterSize, are
+% identical, and we prefer the a4/letter names -- texconfig uses them.
+
+% 0 0 595 842 is the right bounding box that applications expect
+% for A4. Since dvips always rounds up, choose something slightly
+% smaller for our paper size.
+
+@ a4 210mm 297mm
+@+ ! %%DocumentPaperSizes: a4
+@+ %%BeginPaperSize: a4
+@+ /setpagedevice where
+@+ { pop << /PageSize [595 842] >> setpagedevice }
+@+ { /a4 where { pop a4 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ letter 8.5in 11in
+@+ ! %%DocumentPaperSizes: Letter
+@+ %%BeginPaperSize: Letter
+@+ /setpagedevice where
+@+ { pop << /PageSize [612 792] >> setpagedevice }
+@+ { /letter where { pop letter } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ a4size 210mm 297mm
+@+ ! %%DocumentPaperSizes: a4
+@+ %%BeginPaperSize: a4
+@+ /setpagedevice where
+@+ { pop << /PageSize [595 842] >> setpagedevice }
+@+ { /a4 where { pop a4 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ letterSize 8.5in 11in
+@+ ! %%DocumentPaperSizes: Letter
+@+ %%BeginPaperSize: Letter
+@+ /setpagedevice where
+@+ { pop << /PageSize [612 792] >> setpagedevice }
+@+ { /letter where { pop letter } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ halfexecutive 133mm 184mm
+@+ ! %%DocumentPaperSizes: halfexecutive
+@+ %%BeginPaperSize: halfexecutive
+@+ /setpagedevice where
+@+ { pop << /PageSize [378 522] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ halfletter 140mm 216mm
+@+ ! %%DocumentPaperSizes: halfletter
+@+ %%BeginPaperSize: halfletter
+@+ /setpagedevice where
+@+ { pop << /PageSize [396 612] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ statement 140mm 216mm
+@+ ! %%DocumentPaperSizes: statement
+@+ %%BeginPaperSize: statement
+@+ /setpagedevice where
+@+ { pop << /PageSize [396 612] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ executive 184mm 267mm
+@+ ! %%DocumentPaperSizes: executive
+@+ %%BeginPaperSize: executive
+@+ /setpagedevice where
+@+ { pop << /PageSize [522 756] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+% for powerdot
+@ screen 8.25in 11in
+@+ ! %%DocumentPaperSizes: Screen
+@+ %%BeginPaperSize: Screen
+@+ /setpagedevice where
+@+ { pop << /PageSize [594 792] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+% a common size for printers (in north america).
+@ sixbynine 6in 9in
+@+ ! %%DocumentPaperSizes: SixByNine
+@+ %%BeginPaperSize: SixByNine
+@+ /setpagedevice where
+@+ { pop << /PageSize [432 648] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ quarto 215mm 275mm
+@+ ! %%DocumentPaperSizes: quarto
+@+ %%BeginPaperSize: quarto
+@+ /setpagedevice where
+@+ { pop << /PageSize [610 780] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ note 216mm 279mm
+@+ ! %%DocumentPaperSizes: note
+@+ %%BeginPaperSize: note
+@+ /setpagedevice where
+@+ { pop << /PageSize [612 792] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ folio 216mm 330mm
+@+ ! %%DocumentPaperSizes: folio
+@+ %%BeginPaperSize: folio
+@+ /setpagedevice where
+@+ { pop << /PageSize [612 936] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ legal 8.5in 14in
+@+ ! %%DocumentPaperSizes: Legal
+@+ %%BeginPaperSize: Legal
+@+ /setpagedevice where
+@+ { pop << /PageSize [612 1008] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ 10x14 10in 14in
+@+ ! %%DocumentPaperSizes: 10x14
+@+ %%BeginPaperSize: 10x14
+@+ /setpagedevice where
+@+ { pop << /PageSize [720 1008] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ ledger 17in 11in
+@+ ! %%DocumentPaperSizes: Ledger
+@+ %%BeginPaperSize: Ledger
+@+ /setpagedevice where
+@+ { pop << /PageSize [1224 792] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ tabloid 11in 17in
+@+ ! %%DocumentPaperSizes: Tabloid
+@+ %%BeginPaperSize: Tabloid
+@+ /setpagedevice where
+@+ { pop << /PageSize [792 1224] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ 11x17 11in 17in
+@+ ! %%DocumentPaperSizes: 11x17
+@+ %%BeginPaperSize: 11x17
+@+ /setpagedevice where
+@+ { pop << /PageSize [792 1224] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ a0 841mm 1189mm
+@+ ! %%DocumentPaperSizes: a0
+@+ %%BeginPaperSize: a0
+@+ /setpagedevice where
+@+ { pop << /PageSize [2384 3370] >> setpagedevice }
+@+ { /a0 where { pop a0 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ a1 594mm 841mm
+@+ ! %%DocumentPaperSizes: a1
+@+ %%BeginPaperSize: a1
+@+ /setpagedevice where
+@+ { pop << /PageSize [1684 2384] >> setpagedevice }
+@+ { /a1 where { pop a1 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ a2 420mm 594mm
+@+ ! %%DocumentPaperSizes: a2
+@+ %%BeginPaperSize: a2
+@+ /setpagedevice where
+@+ { pop << /PageSize [1191 1684] >> setpagedevice }
+@+ { /a2 where { pop a2 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ a3 297mm 420mm
+@+ ! %%DocumentPaperSizes: a3
+@+ %%BeginPaperSize: a3
+@+ /setpagedevice where
+@+ { pop << /PageSize [842 1191] >> setpagedevice }
+@+ { /a3 where { pop a3 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ a5 148mm 210mm
+@+ ! %%DocumentPaperSizes: a5
+@+ %%BeginPaperSize: a5
+@+ /setpagedevice where
+@+ { pop << /PageSize [420 595] >> setpagedevice }
+@+ { /a5 where { pop a5 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ a6 105mm 148mm
+@+ ! %%DocumentPaperSizes: a6
+@+ %%BeginPaperSize: a6
+@+ /setpagedevice where
+@+ { pop << /PageSize [298 420] >> setpagedevice }
+@+ { /a6 where { pop a6 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ a7 74mm 105mm
+@+ ! %%DocumentPaperSizes: a7
+@+ %%BeginPaperSize: a7
+@+ /setpagedevice where
+@+ { pop << /PageSize [210 298] >> setpagedevice }
+@+ { /a7 where { pop a7 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ a8 52mm 74mm
+@+ ! %%DocumentPaperSizes: a8
+@+ %%BeginPaperSize: a8
+@+ /setpagedevice where
+@+ { pop << /PageSize [147 210] >> setpagedevice }
+@+ { /a8 where { pop a8 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ a9 37mm 52mm
+@+ ! %%DocumentPaperSizes: a9
+@+ %%BeginPaperSize: a9
+@+ /setpagedevice where
+@+ { pop << /PageSize [105 147] >> setpagedevice }
+@+ { /a9 where { pop a9 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ a10 26mm 37mm
+@+ ! %%DocumentPaperSizes: a10
+@+ %%BeginPaperSize: a10
+@+ /setpagedevice where
+@+ { pop << /PageSize [74 105] >> setpagedevice }
+@+ { /a10 where { pop a10 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ jisb0 1030mm 1456mm
+@+ ! %%DocumentPaperSizes: jisb0
+@+ %%BeginPaperSize: jisb0
+@+ /setpagedevice where
+@+ { pop << /PageSize [2920 4127] >> setpagedevice }
+@+ { /jisb0 where { pop jisb0 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ jisb1 728mm 1030mm
+@+ ! %%DocumentPaperSizes: jisb1
+@+ %%BeginPaperSize: jisb1
+@+ /setpagedevice where
+@+ { pop << /PageSize [2064 2920] >> setpagedevice }
+@+ { /jisb1 where { pop jisb1 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ jisb2 515mm 728mm
+@+ ! %%DocumentPaperSizes: jisb2
+@+ %%BeginPaperSize: jisb2
+@+ /setpagedevice where
+@+ { pop << /PageSize [1460 2064] >> setpagedevice }
+@+ { /jisb2 where { pop jisb2 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ jisb3 364mm 515mm
+@+ ! %%DocumentPaperSizes: jisb3
+@+ %%BeginPaperSize: jisb3
+@+ /setpagedevice where
+@+ { pop << /PageSize [1032 1460] >> setpagedevice }
+@+ { /jisb3 where { pop jisb3 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ jisb4 257mm 364mm
+@+ ! %%DocumentPaperSizes: jisb4
+@+ %%BeginPaperSize: jisb4
+@+ /setpagedevice where
+@+ { pop << /PageSize [729 1032] >> setpagedevice }
+@+ { /jisb4 where { pop jisb4 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ jisb5 182mm 257mm
+@+ ! %%DocumentPaperSizes: jisb5
+@+ %%BeginPaperSize: jisb5
+@+ /setpagedevice where
+@+ { pop << /PageSize [516 729] >> setpagedevice }
+@+ { /jisb5 where { pop jisb5 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ jisb6 128mm 182mm
+@+ ! %%DocumentPaperSizes: jisb6
+@+ %%BeginPaperSize: jisb6
+@+ /setpagedevice where
+@+ { pop << /PageSize [363 516] >> setpagedevice }
+@+ { /jisb6 where { pop jisb6 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ jisb7 91mm 128mm
+@+ ! %%DocumentPaperSizes: jisb7
+@+ %%BeginPaperSize: jisb7
+@+ /setpagedevice where
+@+ { pop << /PageSize [258 363] >> setpagedevice }
+@+ { /jisb7 where { pop jisb7 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ jisb8 64mm 91mm
+@+ ! %%DocumentPaperSizes: jisb8
+@+ %%BeginPaperSize: jisb8
+@+ /setpagedevice where
+@+ { pop << /PageSize [181 258] >> setpagedevice }
+@+ { /jisb8 where { pop jisb8 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ b0 1000mm 1414mm
+@+ ! %%DocumentPaperSizes: b0
+@+ %%BeginPaperSize: b0
+@+ /setpagedevice where
+@+ { pop << /PageSize [2835 4008] >> setpagedevice }
+@+ { /b0 where { pop b0 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ b1 707mm 1000mm
+@+ ! %%DocumentPaperSizes: b1
+@+ %%BeginPaperSize: b1
+@+ /setpagedevice where
+@+ { pop << /PageSize [2004 2835] >> setpagedevice }
+@+ { /b1 where { pop b1 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ b2 500mm 707mm
+@+ ! %%DocumentPaperSizes: b2
+@+ %%BeginPaperSize: b2
+@+ /setpagedevice where
+@+ { pop << /PageSize [1417 2004] >> setpagedevice }
+@+ { /b2 where { pop b2 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ b3 353mm 500mm
+@+ ! %%DocumentPaperSizes: b3
+@+ %%BeginPaperSize: b3
+@+ /setpagedevice where
+@+ { pop << /PageSize [1001 1417] >> setpagedevice }
+@+ { /b3 where { pop b3 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ b4 250mm 353mm
+@+ ! %%DocumentPaperSizes: b4
+@+ %%BeginPaperSize: b4
+@+ /setpagedevice where
+@+ { pop << /PageSize [709 1001] >> setpagedevice }
+@+ { /b4 where { pop b4 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ b5 176mm 250mm
+@+ ! %%DocumentPaperSizes: b5
+@+ %%BeginPaperSize: b5
+@+ /setpagedevice where
+@+ { pop << /PageSize [499 709] >> setpagedevice }
+@+ { /b5 where { pop b5 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ b6 125mm 176mm
+@+ ! %%DocumentPaperSizes: b6
+@+ %%BeginPaperSize: b6
+@+ /setpagedevice where
+@+ { pop << /PageSize [354 499] >> setpagedevice }
+@+ { /b6 where { pop b6 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ c5 162mm 229mm
+@+ ! %%DocumentPaperSizes: c5
+@+ %%BeginPaperSize: c5
+@+ /setpagedevice where
+@+ { pop << /PageSize [459 649] >> setpagedevice }
+@+ { /c5 where { pop c5 } if }
+@+ ifelse
+@+ %%EndPaperSize
+
+@ DL 110mm 220mm
+@+ ! %%DocumentPaperSizes: DL
+@+ %%BeginPaperSize: DL
+@+ /setpagedevice where
+@+ { pop << /PageSize [312 624] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ Comm10 105mm 241mm
+@+ ! %%DocumentPaperSizes: Comm10
+@+ %%BeginPaperSize: Comm10
+@+ /setpagedevice where
+@+ { pop << /PageSize [297 684] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ Monarch 98.4mm 190.5mm
+@+ ! %%DocumentPaperSizes: Monarch
+@+ %%BeginPaperSize: Monarch
+@+ /setpagedevice where
+@+ { pop << /PageSize [279 540] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ archE 36in 48in
+@+ ! %%DocumentPaperSizes: archE
+@+ %%BeginPaperSize: archE
+@+ /setpagedevice where
+@+ { pop << /PageSize [2592 3456] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ archD 24in 36in
+@+ ! %%DocumentPaperSizes: archD
+@+ %%BeginPaperSize: archD
+@+ /setpagedevice where
+@+ { pop << /PageSize [1728 2592] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ archC 18in 24in
+@+ ! %%DocumentPaperSizes: archC
+@+ %%BeginPaperSize: archC
+@+ /setpagedevice where
+@+ { pop << /PageSize [1296 1728] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ archB 12in 18in
+@+ ! %%DocumentPaperSizes: archB
+@+ %%BeginPaperSize: archB
+@+ /setpagedevice where
+@+ { pop << /PageSize [864 1296] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ archA 9in 12in
+@+ ! %%DocumentPaperSizes: archA
+@+ %%BeginPaperSize: archA
+@+ /setpagedevice where
+@+ { pop << /PageSize [648 864] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ flsa 216mm 330.2mm
+@+ ! %%DocumentPaperSizes: flsa
+@+ %%BeginPaperSize: flsa
+@+ /setpagedevice where
+@+ { pop << /PageSize [612 936] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ flse 216mm 330.2mm
+@+ ! %%DocumentPaperSizes: flse
+@+ %%BeginPaperSize: flse
+@+ /setpagedevice where
+@+ { pop << /PageSize [612 936] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ csheet 431.8mm 558.8mm
+@+ ! %%DocumentPaperSizes: csheet
+@+ %%BeginPaperSize: csheet
+@+ /setpagedevice where
+@+ { pop << /PageSize [1224 1584] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ dsheet 558.8mm 863.6mm
+@+ ! %%DocumentPaperSizes: dsheet
+@+ %%BeginPaperSize: dsheet
+@+ /setpagedevice where
+@+ { pop << /PageSize [1584 2448] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ esheet 863.6mm 1117.6mm
+@+ ! %%DocumentPaperSizes: esheet
+@+ %%BeginPaperSize: esheet
+@+ /setpagedevice where
+@+ { pop << /PageSize [2448 3168] >> setpagedevice }
+@+ if
+@+ %%EndPaperSize
+
+@ unknown 0in 0in
+@+ statusdict /setpageparams known { hsize vsize 0 1 statusdict begin {
+@+ setpageparams } stopped end } { true } ifelse { statusdict /setpage known
+@+ { hsize vsize 1 statusdict begin { setpage } stopped pop end } if } if
+
+@ unknown 0in 0in
+@+ statusdict /setpageparams known { hsize vsize 0 1 statusdict begin {
+@+ setpageparams } stopped end } { true } ifelse { statusdict /setpage known
+@+ { hsize vsize 1 statusdict begin { setpage } stopped pop end } if } if
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-base-bin.root/usr/share/texlive-bin/debianize-fmtutil
+++ texlive-bin-2007.dfsg.1/debian/texlive-base-bin.root/usr/share/texlive-bin/debianize-fmtutil
@@ -0,0 +1,429 @@
+# This file, debianize-fmtutil, is meant to be sourced by fmtutil and
+# enhance the --enable and --disable options with the functionality
+# needed to deal with Debian's generated fmtutil.cnf.
+# $Id$
+
+# This is the planned scheme how it works
+#
+# A for disablefmt:
+# 1. create a list of files to act on (either in sysconfdir only, or in user dirs too)
+# 2. grep for not-commented lines in these files that contain $fmt
+# 3. if in syswide-mode, for each of these files, run configReplace appropriately;
+# if not in syswide mode, for each of these files,
+# test whether it is in the syswide dir
+# 3.a if not, run configReplace appropriately
+# 3b. if yes, create copy in user dir and run configReplace appropriately
+#
+# B for enableMap:
+# 1. create a list of files to act on (either in sysconfdir only, or in user dirs too)
+# 2. grep for commented lines in these files that contain $map
+# 2.1. if any are found, check whether it is only one
+# 2.1.1 if there is only one, run configReplace on that file appropriately
+# 2.1.2 if there is more than one, the precedence is
+# 20tetex-extra.cfg > XX*local*.cfg > 10tetex-base.cfg > any
+# (extra has maximum priority because
+# 2.1.2.1 if it's clear on which file to act, run configReplace on that file
+# appropriately
+# 2.1.2.2 if unclear (i.e. only "any"), exit with an error
+# 2.2 if none are found, act on 10local.cfg (could be made configurable)
+# - if 10local.cfg does not exist, create it (with an explanatory comment)
+# - run configReplace on it appropriately
+#
+# C for syncwithtrees (and even more?)
+# ?
+#
+# After that, update-fmtutil must be run (in the appropriate mode!), and then fmtutil
+# must reexecute itself. Since disableMap is called by enableMap, we need a wrapper
+# for it.
+
+###############################################################################
+# verboseMsg(msg)
+# print `msg' to stderr is $verbose is true
+###############################################################################
+verboseMsg() {
+ $verboseFlag && verbose echo ${1+"$@"} >&2
+}
+
+###############################################################################
+# enablefmt(format)
+# enables format in configuration file
+###############################################################################
+enablefmt()
+{
+ enableFmtInner $1
+ runUpdate
+}
+
+###############################################################################
+# disablefmt(format)
+# disables format in configuration file
+###############################################################################
+disablefmt()
+{
+ disableFmtInner $1
+ runUpdate
+}
+
+###############################################################################
+# debianEditWarnAndShow()
+# warn that this won't work
+###############################################################################
+debianEditWarnAndShow(){
+ echo "Warning!"
+ echo ""
+ echo "In Debian, fmtutil.cnf, the format configuration file, is a generated file."
+ echo "The actual configuration files are in /etc/texmf/fmt.d."
+ echo "Please read the update-fmtutil(1) manpage and edit those files."
+ echo ""
+ echo "Instead of editing, you will now be shown fmtutil.cnf in a pager."
+ echo ""
+ echo "Press enter to continue."
+ read dummy
+
+ sensible-pager $cnf_file
+
+}
+
+###############################################################################
+# DebianSyswideMode ()
+# determine whether we are running in syswide mode (or user-specific)
+###############################################################################
+DebianSyswideMode(){
+ test "$(id -u)" -eq 0 && return 0 || return 1
+}
+
+###############################################################################
+# FindDebianUserdir ()
+# find the directory containing user-specific fmt.d snippets
+###############################################################################
+FindDebianUserdir(){
+# verboseMsg "entering FindDebianUserdir"
+
+ texmfconfig=$(kpsewhich --expand-path '$TEXMFCONFIG')
+ OLDIFS="$IFS"
+ IFS=:
+ count=0
+ for d in "$texmfconfig"; do
+ count=$(($count+1))
+ : ${cnfdir:=$d}
+ if [ -d "$d/fmt.d" ]; then
+ defaultuserdir="$d/fmt.d"
+ break
+ fi
+ done
+ IFS="$OLDIFS"
+ # still empty? Pick one
+ if [ -z "$defaultuserdir" ]; then
+ if [ $count -eq 1 ]; then
+ defaultuserdir="$cnfdir/fmt.d"
+ else
+ echo "TEXMFCONFIG contains more than one directory, and none of them" >&2
+ echo "already contains a fmt.d/ subdirectory." >&2
+ echo "I don't know how to proceed here, stopping." >&2
+ return
+ fi
+ fi
+
+ /usr/share/texmf/web2c/mktexdir $defaultuserdir
+ if [ -d $defaultuserdir ]; then
+ echo $defaultuserdir
+ fi
+}
+
+###############################################################################
+# createDebianConffilelist
+# create a list of configuration files containing fmtutil snippets;
+# we are going to act on these
+###############################################################################
+createDebianConffilelist(){
+# verboseMsg "entering createDebianConffilelist"
+
+ userFiles=""
+ local DebianConffilelist=""
+ syswideFiles=`find /etc/texmf/fmt.d -maxdepth 1 -type f -name '*.cnf'`
+ if ! DebianSyswideMode; then
+ debianuserdir=`FindDebianUserdir`
+ if [ -n "$debianuserdir" ]; then
+ userFiles=`find "$debianuserdir" -maxdepth 1 -type f -name '*.cnf'`
+ fi
+ fi
+ if [ -n "$userFiles" ]; then
+ for sysfile in $syswideFiles; do
+ for userfile in $userFiles; do
+ if [ ! "`basename $userfile`" = "`basename $sysfile`" ]; then
+ DebianConffilelist="$DebianConffilelist $sysfile"
+ fi
+ done
+ done
+ DebianConffilelist="$DebianConffilelist $userFiles"
+ else
+ DebianConffilelist="$syswideFiles"
+ fi
+ echo $DebianConffilelist
+}
+
+###############################################################################
+# snippetFileIsWritable (debCnfFile)
+# checks whether we are (supposed to be) able to write to a file
+###############################################################################
+snippetFileIsWritable(){
+ local file=$1
+
+ if DebianSyswideMode; then
+ return 0
+ else
+ # /etc/texmf/fmt.d shouldn't be hardcoded
+ if [ "${file#/etc/texmf}" = "${file}" ]; then
+ # file is not in systemwide dir
+ return 0
+ else
+ return 1
+ fi
+ fi
+}
+
+###############################################################################
+# makeUserCopy (filename)
+# create a copy in the user dir
+###############################################################################
+makeUserCopy(){
+ local debCnfFile="$1"
+
+ # create a copy of that file in the user dir
+ debianuserdir=`FindDebianUserdir`
+ newdebCnfFile="$debianuserdir/`basename $debCnfFile`"
+ verboseMsg "I'm not allowed to handle $fmt in $debCnfFile." >&2
+ verboseMsg "Creating copy in $debianuserdir instead." >&2
+ cp $debCnfFile $newdebCnfFile
+ echo "$newdebCnfFile"
+}
+
+###############################################################################
+# findUserfiles (filelist)
+# pick user-specific files out of a filelist of configuration files
+###############################################################################
+findUserfiles(){
+ userfiles=""
+ while [ $# -gt 0 ]; do
+ file="$1"
+ if [ "$file" = "${file#/etc/texmf/}" ]; then
+ # doesn't start with /etc/texmf/: must be user-specific
+ userfiles="$userfiles $file"
+ fi
+ shift;
+ done
+ echo $userfiles
+}
+
+###############################################################################
+# findRightMatchfile (format,filelist)
+# find the right file from filelist to enable mapname
+###############################################################################
+findRightMatchfile(){
+ fmt=$1; shift
+ matchfiles="$@"
+ local debCnfFile=""
+
+ if [ $# -eq 1 ]; then
+ # it is only one, enable map in it. May we write it?
+ debCnfFile=$matchfiles
+ if ! snippetFileIsWritable $debCnfFile; then
+ debCnfFile=`makeUserCopy $debCnfFile`
+ fi
+ echo $debCnfFile
+ verboseMsg "Enabling format in $debCnfFile."
+ return 0
+ else
+ # there are more than one;
+ if ! DebianSyswideMode; then
+ # can only change files in the user's dir
+ usermatchfiles=`findUserfiles $matchfiles`
+ if [ `(set $usermatchfiles; echo $#)` -eq 1 ]; then
+ # exactly one of them is a user-specific file
+ echo $usermatchfiles
+ verboseMsg "Enabling format in user-specific file $usermatchfiles."
+ return 0
+ else
+ # two files in the user directory (as bad as two in the site-wide
+ # dir), or no user-specific files. If there are two user-specific
+ # files, report about them:
+ test -n "$usermatchfiles" && matchfiles="$usermatchfiles" || true
+ fi
+ fi
+ # for now, we exit with an error. Any sensible choice would have to
+ # check whether teTeX or texlive is installed, and I want to save me
+ # that hazzle.
+ cat >&2 <&2 <&2
+ echo "Exiting" >&2
+ exit 0
+ )
+ DebCnfFile=`pickLocalFile $fmt $debianuserdir`
+ fi
+# # configReplace will try to grep in the file: touch it to prevent a error message
+# touch $DebCnfFile
+ verboseMsg "Using local configuration file $DebCnfFile"
+ echo $DebCnfFile
+}
+
+###############################################################################
+# runUpdate
+# run update-fmtutil
+###############################################################################
+runUpdate(){
+ updOptions=""
+ if [ -n "$cfgparam" ]; then
+ # --conffile option was given on the command line
+ updOptions="--output-file $orig"
+ fi
+ # here we could check for an alternative user dir, or output file
+ # but as long as FindDebianUserdir only reports the default location,
+ # it doesn't make sense
+
+ verboseMsg "Running update-fmtutil to merge the changed files"
+ update-fmtutil --quiet $updOptions
+}
+
+###############################################################################
+# disableFmtInner (map)
+# disables fmt in config file (any type) (real command)
+###############################################################################
+disableFmtInner()
+{
+ fmt=$1
+ noverbose="$2"
+
+ local debCnfFile
+
+ oldverbose="$verbose"
+ if [ -n "$noverbose" ]; then
+ # don't confuse users with disable messages when they called --enable
+# verboseMsg "disabling verbosity"
+ verbose=false
+ fi
+
+
+ if [ -z "$DebianConffilelist" ]; then
+ DebianConffilelist=`createDebianConffilelist`
+ fi
+
+ # create list of all files that contain an entry
+ for debCnfFile in $DebianConffilelist; do
+ if grep -q "^$fmt" $debCnfFile; then
+ if ! snippetFileIsWritable $debCnfFile; then
+ debCnfFile=`makeUserCopy $debCnfFile`
+ fi
+ verboseMsg "Disabling $fmt in $debCnfFile."
+ ed $debCnfFile >/dev/null 2>&1 <<-eof
+ g/^$fmt[ ]/s/^/#! /
+ w
+ q
+eof
+ fi
+ done
+
+ verbose="$oldverbose"
+ return 0
+}
+
+###############################################################################
+# enableFmtInner (fmt)
+# enables fmt in config file (any type) (real command)
+###############################################################################
+enableFmtInner(){
+ fmt=$1
+ local debCnfFile=""
+
+ if [ -z "$DebianConffilelist" ]; then
+ DebianConffilelist=`createDebianConffilelist`
+ fi
+
+ # a format should only be defined once, so we carefully disable
+ # everything about it here:
+ disableFmtInner "$fmt" noverbose
+
+ # now enable with the right type.
+ # But we have to determine where to enable.
+ # is there already a file that contains a (commented) entry?
+ matchfiles=""
+ for file in $DebianConffilelist; do
+ if grep -q "^#![ ]*$fmt[ ]" "$file"; then
+ matchfiles="$matchfiles $file"
+ fi
+ done
+ if [ -n "$matchfiles" ]; then
+ # there is already (at least) one file that has a commented entry for our map
+ debCnfFile=`findRightMatchfile $fmt $matchfiles`
+ test -w "$debCnfFile" || debCnfFile=""
+ fi
+ if [ -z "$debCnfFile" ]; then
+ # still none, there is no (commented) entry in any writable file yet.
+ debCnfFile=`findRightLocalfile $fmt`
+ test -n "$debCnfFile" || abort "Cannot proceed. Exiting"
+ verboseMsg "Creating new entry for format $fmt in $debCnfFile"
+ fi
+
+ ed $debCnfFile >/dev/null 2>&1 <<-eof
+ g/^#![ ]*$fmt[ ]/s/..[ ]*//
+ w
+ q
+eof
+}
+
+
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-base-bin.root/usr/share/man/man1/simpdftex.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-base-bin.root/usr/share/man/man1/simpdftex.1
@@ -0,0 +1,184 @@
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
+.TH SIMPDFTEX "1" "April 2006" "2.18" "User Commands"
+.SH NAME
+simpdftex \- create pdf files via latex-dvips-gs instead of pdflatex
+.SH SYNOPSIS
+.B simpdftex
+\fIformatname\fR
+[options]
+\fItex-or-dvi-file\fR
+.SH DESCRIPTION
+.PP
+simpdftex is a way to do pdf{e}{la}tex without having pdf{e}{la}tex. It needs a
+working TeX environment and ghostscript. Since pdf{e}{la}tex cannot handle
+insertion of .eps graphics, simpdftex gives an alternative. The output for both
+systems is comparable.
+.PP
+simpdftex compiles the file with {LA}TeX, processes the DVI file with dvips into
+PostScript and uses gs to produce pdf (with ps2pdf). There is finegrained
+control over the resulting filename and the options with which dvips produces
+the PostScript intermediary file.
+.PP
+Dvips will call Metafont to produce bitmaps or include PostScript .pfb files
+depending on the flags. See below.
+.PP
+Default settings is normal name, maximal use of pfb's, just like pdf{la}tex,
+in other words, "pdftex file.tex" and "altpdftex file.tex" both produce an
+output file file.pdf. For pdftex, output options are controlled by pdftex.cfg,
+for altpdftext by config.ps (unless \fB\-\-pdf\fR is given).
+.SH OPTIONS
+.TP
+formatname
+.IP
+Specifies the format to be used
+.TP
+tex\-or\-dvi\-file
+.IP
+If a .dvi file is given, skip the TeX process. Otherwise, TeX
+the input file, dvips the resulting dvi file and ps2pdf the
+resulting ps file
+.TP
+\fB\-\-help\fR
+.IP
+Display this message and exit
+.TP
+\fB\-\-no\-echo\-version\fR
+.IP
+Do not echo location and version of this script. Does not exit
+so can be used tochange info to the output of a real run
+.TP
+\fB\-\-debug\fR
+.IP
+Add some debug output
+.TP
+\fB\-\-extendedname\fR
+.IP
+Depending on the mode, adds intermediary extensions to the
+output filename. If the mode is \fB\-\-pdf\fR, .pdfmode is added. If
+the mode is \fB\-\-maxpk\fR, ,maxpk is added and if the mode is
+\fB\-\-maxpfb\fR, .maxpfb is added. Example:
+.IP
+tex\-or\-dvi\-file\-basename.maxpfb.pdf
+.TP
+\fB\-\-maxpk\fR
+.IP
+Use Metafont bitmaps (pk files) when possible. Only real
+PostScript fonts (like Times Roman) are included as
+PostScript fonts. All other fonts are included as bitmaps
+for the default printer resolution. This options produces
+optimal results for the chosen printer.
+For file contents (not name) equivalent to:
+\fB\-\-dvipsopts\fR "\-Ppk"
+.TP
+\fB\-\-maxpfb\fR
+.IP
+Use PostScript pfb files whenever possible. This produces
+optimal results for the screen.
+For file contents (not name) equivalent to:
+\fB\-\-dvipsopts\fR "\-Poutline"
+If any font is included as TeX pk bitmap, it is rendered
+at the default resolution.
+.TP
+\fB\-\-pdf\fR
+.IP
+Select .pdfmode extension for the output file name if
+\fB\-\-extendedname\fR has been set. Use printer definition
+config.pdf. For file contents (not name) equivalent to
+\fB\-\-dvipsopts\fR "\-Ppdf"
+Note that the default config.pdf assumes resolution 8000
+for bitmaps and bitmap generation fails at this resolution
+because there exists no known mode for that resolution.
+.TP
+\fB\-\-default\fR
+.IP
+Select no extension for the output file name, even if
+\fB\-\-extendedfilename\fR has been set. Use standard printer
+definition config.ps. For file contents (not name) equivalent
+to:
+\fB\-\-dvipsopts\fR "" \fB\-\-noextendedname\fR
+.TP
+\fB\-\-dvipsopts\fR
+.IP
+Give arbitrary arguments to dvips, e.g.
+\fB\-\-dvipsopts\fR "\-M"
+Sets extension for \fB\-\-extendedfilename\fR to .custom. \fB\-\-dvipsopts\fR
+overrides other flags that set dvipsopts.
+.TP
+\fB\-\-extratexopts\fR
+.IP
+Give extra arbitrary arguments to tex, e.g.
+\fB\-\-extratexopts\fR "\-\-interaction=nonstopmode"
+Sets extra options for the tex command that is used.
+.TP
+\fB\-\-extradvipsopts\fR
+.IP
+Give extra arbitrary arguments to dvips, e.g.
+\fB\-\-extradvipsopts\fR "\-M"
+Sets extra options for dvips and does not set extension
+or override other options. Options will be added to the end
+of the options for dvips
+.TP
+\fB\-\-keep\-psfile\fR
+.IP
+After running dvips, copy the ps file over to the directory
+where the tex file is, possibly overwriting a ps file
+that is there. Use with caution, a ps file could be input
+as well.
+.TP
+\fB\-\-tex\-path\fR
+.IP
+Give path of TeX binaries, use directory of this script
+otherwise
+.TP
+\fB\-\-distiller\fR prog
+.IP
+Use a distiller different from ps2pdf which is the default.
+Argument must be an executable or executable script that
+gets called iwth two arguments: input file (PS) and output
+file (PDF). E.g.:
+\fB\-\-distiller=\fR/usr/local/alternate/bin/ps2pdf
+\fB\-\-distiller\fR=\fIpstill\fR
+Using this flag sets the distiller filter mode to off
+.TP
+\fB\-\-distiller\-filter\fR prog
+.IP
+Use a distiller executable or executable script which is
+called with the PS input as standard input and which writes
+the PDF output to standard output. E.g.:
+\fB\-\-distiller\-filter\fR=\fIu\-psbuild\fR
+.TP
+\fB\-\-distiller\-path\fR
+.IP
+Give path needed by the distiller binary. This path is added
+to the begin of you PATH environment before the distiller is
+run. The reason is that for instance ps2pdf uses the path to
+find gs and sets the path to something with /sw/bin at the
+beginning. Thus, installing gs from fink would make
+/usr/local/bin/ps2pdf find another gs than intended. By giving
+an empty path, the path is not changed before the distiller
+program is run. The default is empty.
+.TP
+\fB\-\-outdir\fR dir
+.IP
+Write files here *if* our current directory is unwritable. This
+mimicks the TEXMFOUTPUT environment variable of TeX, but
+differently. The current dir becomes the value of \fB\-\-outdir\fR and
+the directory where the old current dir is added to TEXINPUTS.
+This is more robust for reading and locating files.
+You can also set TEXMFOUTPUT instead, but with a disadvantage:
+you will be running TeXin the current dir. And you will not be
+able to read files in the outdir unless you also adapt
+TEXINPUTS.
+.PP
+The defaults for the distiller are
+.IP
+Path addition: "/usr/local/bin"
+Filter mode: "no"
+Program: "ps2pdf13"
+.PP
+Later flags override settings of earlier flags.
+.SH AUTHORS
+.B simpdftex
+was written by Gerben Wierda and Joachim Kock. This manpage
+was written by Norbert Preining for Debian/GNU Linux and may be used,
+modified and/or distributed freely by anyone.
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-base-bin.root/usr/share/man/man1/ps4pdf.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-base-bin.root/usr/share/man/man1/ps4pdf.1
@@ -0,0 +1,36 @@
+.TH PS4PDF "1" "April 2006" "ps4pdf" "User Commands"
+.SH NAME
+ps4pdf \- a shell script for creating .pdf from .tex
+.SH SYNOPSIS
+.B ps4pdf [--version|-h|--help|-q|-v] file
+.SH DESCRIPTION
+.PP
+ps4pdf creates a .pdf file from a .tex file by calling latex, dvips, and
+ps2pdf.
+.SH OPTIONS
+.TP
+file
+.IP
+The TeX file which should be compiled into a pdf document.
+.TP
+\fB\-\-help\fR \fB\-h\fR
+.IP
+Display a short help message
+.TP
+\fB\-\-version\fR
+.IP
+Display the version of the script.
+.TP
+\fB\-v\fR
+.IP
+Be a bit noisy.
+.TP
+\fB\-q\fR
+.IP
+Be silent.
+.SH AUTHORS
+.B ps4pdf
+was written by Thomas Esser.
+This manpage
+was written by Norbert Preining for Debian/GNU Linux and may be used,
+modified and/or distributed freely by anyone.
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-base-bin.root/usr/share/man/man1/pkfix.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-base-bin.root/usr/share/man/man1/pkfix.1
@@ -0,0 +1,42 @@
+.TH PKFIX "1" "May 2006" "PKFIX 1.3, 2005/02/25" "User Commands"
+.SH NAME
+pkfix \- replace pk fonts in postscript files with type1 versions
+.SH SYNOPSIS
+pkfix [options]
+.SH DESCRIPTION
+This program tries to replace pk fonts in
+by the type 1 versions. The result is written in .
+.PP
+Options: (defaults in parenthesis)
+.TP
+\fB\-\-help\fR
+print usage
+.TP
+\fB\-\-\fR(no)quiet
+suppress messages (false)
+.TP
+\fB\-\-\fR(no)verbose
+verbose printing (false)
+.TP
+\fB\-\-\fR(no)debug
+debug informations (false)
+.TP
+\fB\-\-\fR(no)clean
+clear temp files (true)
+.TP
+\fB\-\-\fR(no)usetex
+use TeX for generating the DVI file (false)
+.TP
+\fB\-\-tex\fR texcmd
+tex command name (plain format) (tex)
+.TP
+\fB\-\-dvips\fR dvipscmd
+dvips command name (dvips)
+.TP
+\fB\-\-options\fR opt
+dvips options (\fB\-Ppdf\fR \fB\-G0\fR)
+.SH AUTHORS
+.B pkfix
+has been written by Heiko Oberdiek. This manual page has been written
+by Norbert Preining for the Debian/GNU Linux distribution and may be
+freely used, modified and/or distributed by anyone.
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-base-bin.root/usr/share/man/man1/texconfig-dialog.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-base-bin.root/usr/share/man/man1/texconfig-dialog.1
@@ -0,0 +1,9 @@
+.TH texconfig-dialog 1 "February 2005" "teTeX" "teTeX"
+.SH NAME
+texconfig-dialog \- helper program for texconfig and texconfig-sys
+.SH DESCRIPTION
+.I texconfig-dialog
+is a helper program for texconfig and texconfig-sys, see the respective
+man pages for details.
+.SH AUTHOR
+Thomas Esser
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-base-bin.root/usr/share/man/man1/pslatex.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-base-bin.root/usr/share/man/man1/pslatex.1
@@ -0,0 +1,44 @@
+.TH "pslatex" "1" "September 2000" "teTeX" "teTeX"
+.PP
+.SH "NAME"
+pslatex \- utility to typeset LaTeX files using PostScript fonts
+.PP
+.SH "SYNOPSIS"
+.PP
+\fBpslatex\fP [\fILATEXARGS\fP] \fILATEXFILE\fP[\&.tex]
+.PP
+.SH "DESCRIPTION"
+.PP
+\fBpslatex\fP allows you to typeset a LaTeX source file using basic
+Adobe Type 1 PostScript fonts (Times, Helvetica, and Courier)
+\fIwithout\fP editing the file to load the necessary packages\&.
+.PP
+It takes any arguments that \fBlatex\fP(1) can take\&.
+.PP
+.SH "OPTIONS"
+.PP
+None\&.
+.PP
+.SH "FILES"
+.PP
+Many\&. See the readme file for \fIpslatex\&.sty\fP\&.
+.PP
+.SH "SEE ALSO"
+.PP
+\fBlatex\fP(1), \fI\fITEXMF\fP/latex/pslatex/00readme\&.txt\fP
+.PP
+.SH "BUGS"
+.PP
+None known\&. Report any found to the author\&.
+.PP
+.SH "AUTHOR"
+.PP
+\fBpslatex\fP was written by David Carlisle
+\&.
+.PP
+This manual page was written by C\&.M\&. Connelly
+, for
+the Debian GNU/Linux system\&. It may be used by other distributions
+without contacting the author\&. Any mistakes or omissions in the
+manual page are my fault; inquiries about or corrections to this
+manual page should be directed to me (and not to the primary author)\&.
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-extra-utils.root/usr/share/man/man1/pdfcrop.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-extra-utils.root/usr/share/man/man1/pdfcrop.1
@@ -0,0 +1,58 @@
+.TH PDFCROP "1" "May 2006" "pdfcrop" "1.5, 2004/06/24 - Copyright (c) 2002, 2004 by Heiko Oberdiek"
+.SH NAME
+PDFCROP \- crop pdf files to their minimal size.
+.SH SYNOPSIS
+.B pdfcrop
+[\fIOPTIONS\fR ...] \fBinput\fR[.pdf] [\FIoutput file\fR]
+.SH DESCRIPTION
+.B pdfcrop
+is a utility to calculate and remove empty margins from each page in
+the input PDF file. The resulting output file occupies the minimal
+paper size needed for the contents and is therefore suitable for
+inclusion as a graphic
+.SH OPTIONS
+.TP
+\fB\-\-help\fR
+print usage
+.TP
+\fB\-\-version\fR
+print version
+.TP
+\fB\-\-\fR(\fBno\fR)\fBverbose\fR
+verbose printing (default: false)
+.TP
+\fB\-\-\fR(\fBno\fR)\fBdebug\fR
+debug informations (default: false)
+.TP
+\fB\-\-gscmd\fR
+call of ghostscript (default: gs)
+.TP
+\fB\-\-pdftexcmd\fR
+call of pdfTeX (default: pdftex)
+.TP
+\fB\-\-margins\fR " "
+(0 0 0 0)
+add extra margins, unit is bp. If only one number is
+given, then it is used for all margins, in the case
+of two numbers they are also used for right and bottom.
+.TP
+\fB\-\-\fR(\fBno\fR)\fBclip
+clipping support, if margins are set (default: false)
+.TP
+\fB\-\-\fR(\fBno\fR)\fBhires
+using `%%HiResBoundingBox' instead of `%%BoundingBox' (default: false)
+.TP
+\fB\-\-papersize\fR
+parameter for gs's \fB\-sPAPERSIZE=\fR,
+use only with older gs versions <7.32
+.SH EXAMPLES
+.IP
+pdfcrop \fB\-\-margins\fR 10 input.pdf output.pdf
+.IP
+pdfcrop \fB\-\-margins\fR '5 10 5 20' \fB\-\-clip\fR input.pdf output.pdf
+.SH "AUTHORS"
+.B pdfcrop
+has been written by Heiko Oberdiek. This manual page has been written
+by Frank K\[:u]ster for the Debian/GNU Linux distribution and may be
+freely used, modified and/or distributed by anyone.
+
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-extra-utils.root/usr/share/man/man1/bibtex8.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-extra-utils.root/usr/share/man/man1/bibtex8.1
@@ -0,0 +1,92 @@
+.TH BIBTEX8 "1" "April 2006" "bibtex8 3.71" "User Commands"
+.SH NAME
+bibtex8 \- 8-bit Big BibTeX version 0.99c
+.SH SYNOPSIS
+.B bibtex8
+[\fIoptions\fR] \fIaux-file\fR
+.SH DESCRIPTION
+.PP
+8-bit BibTeX is an enhanced, portable C version of BibTeX 0.99. It has been
+enhanced in these areas:
+.PP
+- conversion to "big" (32-bit) capacity
+.PP
+- capacity selectable at run time
+.PP
+- flexible support for non-English languages using 8-bit character sets
+.PP
+- well matched to LateX2e and its "inputenc" package
+.PP
+Oren Patashnik, the creator of BibTeX, is working on a new BibTeX 1.0 that
+will be a modern implementation supporting large capacities and non-English
+languages (see TUGboat, pages 269--274, volume 15, number 3, September 1994).
+He is content for this version to be released, but hopes that people will
+eventually migrate to BibTeX 1.0 when it is released. Its release date is
+uncertain at the moment.
+.SH OPTIONS
+.TP
+\-? \fB\-\-help\fR
+display this help text
+.TP
+\fB\-7\fR \fB\-\-traditional\fR
+operate in the original 7\-bit mode
+.TP
+\fB\-8\fR \fB\-\-8bit\fR
+force 8\-bit mode, no CS file used
+.TP
+\fB\-c\fR \fB\-\-csfile\fR FILE
+read FILE as the BibTeX character set
+and sort definition file
+.TP
+\fB\-d\fR \fB\-\-debug\fR TYPE
+report debugging information. TYPE is one
+or more of all, csf, io, mem, misc, search.
+.TP
+\fB\-s\fR \fB\-\-statistics\fR
+report internal statistics
+.TP
+\fB\-t\fR \fB\-\-trace\fR
+report execution tracing
+.TP
+\fB\-v\fR \fB\-\-version\fR
+report BibTeX version
+.TP
+\fB\-B\fR \fB\-\-big\fR
+set large BibTeX capacity
+.TP
+\fB\-H\fR \fB\-\-huge\fR
+set huge BibTeX capacity
+.TP
+\fB\-W\fR \fB\-\-wolfgang\fR
+set really huge BibTeX capacity for Wolfgang
+.TP
+\fB\-M\fR \fB\-\-min_crossrefs\fR ##
+set min_crossrefs to ##
+.TP
+\fB\-\-mcites\fR ##
+allow ## \ecites in the .aux files
+.TP
+\fB\-\-mentints\fR ##
+allow ## integer entries in the .bib databases
+.TP
+\fB\-\-mentstrs\fR ##
+allow ## string entries in the .bib databases
+.TP
+\fB\-\-mfields\fR ##
+allow ## fields in the .bib databases
+.TP
+\fB\-\-mpool\fR ##
+set the string pool to ## bytes
+.TP
+\fB\-\-mstrings\fR ##
+allow ## unique strings
+.TP
+\fB\-\-mwizfuns\fR ##
+allow ## wizard functions
+.SH AUTHORS
+.B bibtex8
+was written by Niel Kempson and
+Alejandro Aguilar-Sierra . This manpage
+was written by Norbert Preining for Debian/GNU Linux and may be used,
+modified and/or distributed freely by anyone.
+
--- texlive-bin-2007.dfsg.1.orig/debian/texlive-extra-utils.root/usr/share/man/man1/pdfopen.1
+++ texlive-bin-2007.dfsg.1/debian/texlive-extra-utils.root/usr/share/man/man1/pdfopen.1
@@ -0,0 +1,49 @@
+.TH PDFOPEN "1" "April 2006" "pdfopen 0.4: Acrobat Reader remote control" "User Commands"
+.SH NAME
+pdfopen, pdfclose \- manual page for pdfopen 0.4: Acrobat Reader remote control
+.SH DESCRIPTION
+.B pdfopen
+and
+.B pdfclose
+can be used to control a running instance of Acrobat Reader.
+.IP
+pdfopen [\-\-file
+.I
+]
+.IP
+pdfclose [\-\-file
+.I
+]
+.PP
+Without argument, the
+.B pdfopen
+program sends a "Ctrl\-<\-" to an existing X window with the name
+.B Acrobat Reader,
+and "Alt-<-" to a window with the name
+.B AdobeReader,
+if such windows exist.
+.B pdfclose
+sends a "Ctrl\-w" instead.
+.SH OPTIONS
+.TP
+\-\-file
+With this argument,
+.B pdfclose
+closes an existing window with the name , and
+.B pdfopen
+opens a window with the name (starting a reader if
+necesary), or it reloads if it was already open.
+.TP
+--all,--page
+These arguments, accepted by Fabrice Popineau's Windows originals of
+.B pdfopen
+and
+.B pdfclose,
+are silently ignored.
+.SH AUTHORS
+.B pdfopen
+and
+.B pdfclose
+are written by Taco Hoekwater . This manpage has
+been written by Frank K\[:u]ster for Debian/GNU Linux and may be used,
+modified and/or distributed freely by anyone.
--- texlive-bin-2007.dfsg.1.orig/debian/patches/00_Build_script
+++ texlive-bin-2007.dfsg.1/debian/patches/00_Build_script
@@ -0,0 +1,38 @@
+---
+ build/source/Build | 22 ++++++++++++++++++----
+ 1 file changed, 18 insertions(+), 4 deletions(-)
+
+Index: texlive-bin-2007/build/source/Build
+===================================================================
+--- texlive-bin-2007.orig/build/source/Build 2006-12-14 03:12:38.000000000 +0100
++++ texlive-bin-2007/build/source/Build 2007-02-14 15:56:00.000000000 +0100
+@@ -47,11 +47,25 @@
+
+ # Force building xdvi-xaw; motif is not always free and/or available.
+ # --enable-gif is for sam2p; the gif patent has expired worldwide.
+-(set -x; \
+- time $TL_CONFIGURE \
++case $1 in
++ configure)
++ shift
++ (set -x; \
++ $TL_CONFIGURE \
+ --prefix=$TL_INSTALL_DEST \
+ --datadir=$TL_INSTALL_DEST \
+ $TL_XDVI_TOOLKIT \
+ $TL_CONFIGURE_ARGS \
+- "$@" \
+- && time $TL_MAKE $TL_TARGET)
++ "$@" )
++ ;;
++ build)
++ # not make world, this would strip
++ shift
++ make all
++ make install
++ ;;
++ *)
++ echo "This script must be invoked with argument configure or build"
++ ;;
++esac
++
--- texlive-bin-2007.dfsg.1.orig/debian/patches/51_fmtutil_keep_failedlog
+++ texlive-bin-2007.dfsg.1/debian/patches/51_fmtutil_keep_failedlog
@@ -0,0 +1,29 @@
+---
+ build/source/texk/tetex/fmtutil | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+Index: texlive-bin-2007/build/source/texk/tetex/fmtutil
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/tetex/fmtutil 2007-04-13 14:04:31.000000000 +0200
++++ texlive-bin-2007/build/source/texk/tetex/fmtutil 2007-04-13 14:09:48.000000000 +0200
+@@ -696,9 +696,7 @@
+ if test -f $fmtfile; then
+ grep '^! ' $format.log >/dev/null 2>&1 &&
+ log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' possibly failed."
+- rm -f "$fulldestdir/$format.log"
+- # We don't want user-interaction for the following "mv" commands:
+- mv "$format.log" "$fulldestdir/$format.log" etc etc
+##
+## DP: Fixes wrong paths in various scripts to make lintian shut up.
+## DP: Fix creation of ls-R in root's homedir
+## DP: Also add a note to the man page of mktexlsr about the above fix
+
+ build/source/texk/kpathsea/mktexlsr | 24 ++++++++++++------------
+ texmf/doc/man/man1/mktexlsr.1 | 9 +++++++++
+ 2 files changed, 21 insertions(+), 12 deletions(-)
+
+Index: texlive-bin-2006.svn3816/build/source/texk/kpathsea/mktexlsr
+===================================================================
+--- texlive-bin-2006.svn3816.orig/build/source/texk/kpathsea/mktexlsr 2006-12-25 19:44:43.000000000 +0100
++++ texlive-bin-2006.svn3816/build/source/texk/kpathsea/mktexlsr 2007-01-26 03:55:05.000000000 +0100
+@@ -82,6 +82,9 @@
+ '
+ set x `kpsewhich --show-path=ls-R | tr : '
+ ' | sort | uniq`; shift
++ if test "`id -u`" -eq 0; then
++ NOROOTHOME=true
++ fi
+ IFS=$OIFS
+ }
+
+@@ -89,6 +92,10 @@
+ # Prepend cwd if the directory was relative.
+ case "$TEXMFLS_R" in
+ "") continue ;; # Strictly speaking, it is an error if this case is taken.
++ $HOME/*) if test -n "$NOROOTHOME"; then
++ tty -s && echo "$progname: Skipping $TEXMFLS_R" >&2
++ continue
++ fi ;;
+ /* | [A-z]:/*) ;;
+ *) TEXMFLS_R="`pwd`/$TEXMFLS_R"
+ esac
+@@ -112,9 +119,9 @@
+ db_dir=`echo "$db_file" | sed 's%/[^/][^/]*$%%'` # can't rely on dirname
+
+ test -d "$db_dir" || continue
+- test -w "$db_dir" || { echo "$progname: $db_dir: directory not writable. Skipping..." >&2; continue; }
+
+ if test ! -f "$db_file"; then
++ test -w "$db_dir" || { echo "$progname: $db_dir: directory not writable. Skipping..." >&2; continue; }
+ cp /dev/null "$db_file"
+ # Use same permissions as parent directory, minus x,s, or t bits.
+ chmod `kpsestat -xst "$db_dir"` "$db_file"
+@@ -128,11 +135,8 @@
+ # Skip if we cannot write the file:
+ kpseaccess -w "$db_file" || { echo "$progname: $db_file: no write permission. Skipping..." >&2; continue; }
+
+- db_dir_tmp="$db_dir/lsR$$.tmp"
+- (umask 077 && mkdir "$db_dir_tmp" ) \
+- || { echo "$progname: could not create directory '$db_dir_tmp'. Skipping..." >&2; continue; }
+- db_file_tmp="$db_dir_tmp/lsR$$.tmp"
+- rm -f "$db_file_tmp"
++ db_file_tmp=`tempfile -p ls-R` \
++ || { echo "$progname: could not create temporary file for '$db_file'. Skipping..." >&2; continue; }
+
+ $verbose && echo "$progname: Updating $db_file... " >&2
+ echo "$ls_R_magic" >"$db_file_tmp"
+@@ -152,12 +156,8 @@
+ | sed -e '/\.svn.*:$/,/^$/d' \
+ >>"$db_file_tmp"
+
+- # To be really safe, a loop.
+- until PERMS=`kpsestat = "$db_file"`; do sleep 1; done
+- chmod $PERMS "$db_file_tmp"
+- rm -f "$db_file"
+- mv "$db_file_tmp" "$db_file"
+- rm -rf "$db_dir_tmp"
++ cat "$db_file_tmp" > "$db_file"
++ rm -f "$db_file_tmp"
+ done
+ $verbose && echo "$progname: Done." >&2
+ exit 0
+Index: texlive-bin-2006.svn3816/texmf/doc/man/man1/mktexlsr.1
+===================================================================
+--- texlive-bin-2006.svn3816.orig/texmf/doc/man/man1/mktexlsr.1 2007-01-14 19:01:06.000000000 +0100
++++ texlive-bin-2006.svn3816/texmf/doc/man/man1/mktexlsr.1 2007-01-26 03:55:05.000000000 +0100
+@@ -44,3 +44,12 @@
+ .B --version
+ .rb
+ Print version information and exit.
++.\"=====================================================================
++.SH NOTES
++When called by root with no arguments, \fBmktexlsr\fP in Debian ignores
++TEXMF trees under \fI$HOME\fP. This is to avoid creating undesirable files
++such as \fI/root/texmf/ls-R\fP when doing usual maintainance (it is generally
++a bad idea to work with TeX as root, therefore having a file such as
++\fI/root/texmf/ls-R\fP in the first place is rather pointless). If you really
++want to update the ls-R databases for such TEXMF trees, simply list them
++explicitely on the command-line.
--- texlive-bin-2007.dfsg.1.orig/debian/patches/series
+++ texlive-bin-2007.dfsg.1/debian/patches/series
@@ -0,0 +1,48 @@
+00_Build_script
+01_tmp_configure_without_installextra
+a2ping-upstream-fixes
+a2ping-man-fixes
+10_mktexlsr_fixes
+11_fix_pkfix_invocation
+12_fix_epstopdf_invocation
+12a_fix_thumbpdf_invocation
+12b_fix_a2ping_invocation
+12c_fix_pdfcrop_invocation
+12d_fix_ebong_invocation
+12e_fix_vpe_invocation
+13_fmtutil_fixes
+#14_etex_takes_buildformat
+16_texdoctk
+17_texdoc
+19_dvipdfm_config
+22_xdvi
+23_use_xdvi.bin
+# for backports with poppler << 0.5 (etch)
+#30_libpoppler_0.4.5
+# for new libpoppler
+#30_libpoppler_0.5.4
+# for double new libpoppler >= 0.5.9 (unstable)
+30_libpoppler_0.5.9
+#31_pdftex_gcc_ICE-on-alpha
+32_dvips_fontbug_fix_upstream
+41_maketexmf
+50_fmtutil_deb
+51_fmtutil_keep_failedlog
+53_builtin-searchpath-fix
+54_checklib_fixes
+55_texconfig_stuff
+56_updmap_deb
+#60_getnonfreefonts_bash
+61_dvipdfm_timezone
+62_dvips_absolutepath_doc
+63_texmf.cnf_for_comparison_temp
+64_fix_makempx_installation
+xetex-0996-patch1
+config.ps-update
+dviljk-security-fixes
+icu-powerpc-buildfix-patch
+disable-character-shifting
+gcc43-compile-fix
+# disabled, should we do this?
+#metapost-1.0
+hps-segfault-fix
--- texlive-bin-2007.dfsg.1.orig/debian/patches/11_fix_pkfix_invocation
+++ texlive-bin-2007.dfsg.1/debian/patches/11_fix_pkfix_invocation
@@ -0,0 +1,23 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 11_fix_pkfix_invocation.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix invocation of pkfix to get rid of magic
+
+@DPATCH@
+ build/source/texk/texlive/pkfix | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+Index: texlive-bin-2006.svn3816/build/source/texk/texlive/pkfix
+===================================================================
+--- texlive-bin-2006.svn3816.orig/build/source/texk/texlive/pkfix 2006-01-17 22:41:51.000000000 +0100
++++ texlive-bin-2006.svn3816/build/source/texk/texlive/pkfix 2007-01-26 03:56:42.000000000 +0100
+@@ -1,7 +1,4 @@
+-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
+- if 0;
+-use strict;
+-$^W=1; # turn warning on
++#!/usr/bin/perl -w
+ #
+ # pkfix.pl
+ #
--- texlive-bin-2007.dfsg.1.orig/debian/patches/31_pdftex_gcc_ICE-on-alpha
+++ texlive-bin-2007.dfsg.1/debian/patches/31_pdftex_gcc_ICE-on-alpha
@@ -0,0 +1,24 @@
+---
+ build/source/texk/web2c/pdftexdir/writezip.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/writezip.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/writezip.c 2007-04-16 15:31:57.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/writezip.c 2007-04-16 15:32:16.000000000 +0200
+@@ -51,7 +51,15 @@
+ for (;;) {
+ if (c_stream.avail_out == 0) {
+ pdfgone += xfwrite(zipbuf, 1, ZIP_BUF_SIZE, pdffile);
++#ifdef __alpha__
++ /* work around http://gcc.gnu.org/PR28623 */
++ {
++ volatile int o = ZIP_BUF_SIZE - 1;
++ pdflastbyte = zipbuf[o];
++ }
++#else
+ pdflastbyte = zipbuf[ZIP_BUF_SIZE - 1]; /* not needed */
++#endif
+ c_stream.next_out = (Bytef *) zipbuf;
+ c_stream.avail_out = ZIP_BUF_SIZE;
+ }
--- texlive-bin-2007.dfsg.1.orig/debian/patches/12a_fix_thumbpdf_invocation
+++ texlive-bin-2007.dfsg.1/debian/patches/12a_fix_thumbpdf_invocation
@@ -0,0 +1,19 @@
+12a_fix_thumbpdf_invocation.dpatch
+Fix invocation of thumbpdf to get rid of magic
+---
+ build/source/texk/tetex/thumbpdf | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+Index: texlive-bin-2007/build/source/texk/tetex/thumbpdf
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/tetex/thumbpdf 2005-07-06 13:03:00.000000000 +0200
++++ texlive-bin-2007/build/source/texk/tetex/thumbpdf 2007-05-19 16:30:21.000000000 +0200
+@@ -1,7 +1,4 @@
+-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
+- if 0;
+-use strict;
+-$^W=1; # turn warning on
++#!/usr/bin/perl -w
+ #
+ # thumbpdf.pl
+ #
--- texlive-bin-2007.dfsg.1.orig/debian/patches/12b_fix_a2ping_invocation
+++ texlive-bin-2007.dfsg.1/debian/patches/12b_fix_a2ping_invocation
@@ -0,0 +1,29 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 12b_fix_a2ping_invocation.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix invocation of a2ping to get rid of magic
+
+@DPATCH@
+---
+ build/source/texk/tetex/a2ping | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+Index: texlive-bin-2006.svn3816/build/source/texk/tetex/a2ping
+===================================================================
+--- texlive-bin-2006.svn3816.orig/build/source/texk/tetex/a2ping 2006-01-17 22:41:51.000000000 +0100
++++ texlive-bin-2006.svn3816/build/source/texk/tetex/a2ping 2007-01-26 03:58:02.000000000 +0100
+@@ -1,11 +1,5 @@
+-#! /bin/sh
+-eval '(exit $?0)' && eval 'PERL_BADLANG=x;export PERL_BADLANG;: \
+-;exec perl -x -S -- "$0" ${1+"$@"};#'if 0;
+-eval 'setenv PERL_BADLANG x;exec perl -x -S -- "$0" $argv:q;#'.q+
+-#!perl -w
+-package Htex::a2ping; $0=~/(.*)/s;unshift@INC,'.';do($1);die$@if$@;__END__+if !1;
+-# This Perl script was generated by JustLib2 at Wed Apr 23 09:14:13 2003.
+-# Don't touch/remove any lines above; http://www.inf.bme.hu/~pts/justlib
++#! /usr/bin/perl -w
++package Htex::a2ping;
+ #
+ # This program is free software, licensed under the GNU GPL, >=2.0.
+ # This software comes with absolutely NO WARRANTY. Use at your own risk!
--- texlive-bin-2007.dfsg.1.orig/debian/patches/01_tmp_configure_without_installextra
+++ texlive-bin-2007.dfsg.1/debian/patches/01_tmp_configure_without_installextra
@@ -0,0 +1,1147 @@
+---
+ build/source/configure | 272 +++++++++++++++++++-----------------
+ build/source/configure.in | 3
+ build/source/texk/web2c/Makefile.in | 2
+ build/source/withenable.ac | 3
+ 4 files changed, 151 insertions(+), 129 deletions(-)
+
+Index: texlive-bin-2007/build/source/configure
+===================================================================
+--- texlive-bin-2007.orig/build/source/configure 2007-02-19 18:03:57.000000000 +0100
++++ texlive-bin-2007/build/source/configure 2007-02-19 18:04:06.000000000 +0100
+@@ -35,6 +35,8 @@
+ ac_help="$ac_help
+ --without-texinfo do not build the texinfo package"
+ ac_help="$ac_help
++ --without-install-extra do not initialize the installed tree"
++ac_help="$ac_help
+ --without-bibtex8 do not build the bibtex8 package"
+ ac_help="$ac_help
+ --without-cjkutils do not build the cjkutils package"
+@@ -55,6 +57,8 @@
+ ac_help="$ac_help
+ --without-dvipng do not build the dvipng package"
+ ac_help="$ac_help
++ --without-dvipos do not build the dvipos package"
++ac_help="$ac_help
+ --without-dvipsk do not build the dvipsk package"
+ ac_help="$ac_help
+ --without-gsftopk do not build the gsftopk package"
+@@ -789,7 +793,7 @@
+ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+-echo "configure:793: checking whether ${MAKE-make} sets \${MAKE}" >&5
++echo "configure:797: checking whether ${MAKE-make} sets \${MAKE}" >&5
+ set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -818,7 +822,7 @@
+ # Extract the first word of "gcc", so it can be a program name with args.
+ set dummy gcc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:822: checking for $ac_word" >&5
++echo "configure:826: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -849,7 +853,7 @@
+ # Extract the first word of "cc", so it can be a program name with args.
+ set dummy cc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:853: checking for $ac_word" >&5
++echo "configure:857: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -901,7 +905,7 @@
+ # Extract the first word of "cl", so it can be a program name with args.
+ set dummy cl; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:905: checking for $ac_word" >&5
++echo "configure:909: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -934,7 +938,7 @@
+ fi
+
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+-echo "configure:938: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
++echo "configure:942: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ ac_ext=c
+ # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+@@ -945,12 +949,12 @@
+
+ cat > conftest.$ac_ext << EOF
+
+-#line 949 "configure"
++#line 953 "configure"
+ #include "confdefs.h"
+
+ main(){return(0);}
+ EOF
+-if { (eval echo configure:954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+@@ -976,12 +980,12 @@
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+-echo "configure:980: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
++echo "configure:984: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+ echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+ cross_compiling=$ac_cv_prog_cc_cross
+
+ echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+-echo "configure:985: checking whether we are using GNU C" >&5
++echo "configure:989: checking whether we are using GNU C" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -990,7 +994,7 @@
+ yes;
+ #endif
+ EOF
+-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+ else
+ ac_cv_prog_gcc=no
+@@ -1009,7 +1013,7 @@
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+-echo "configure:1013: checking whether ${CC-cc} accepts -g" >&5
++echo "configure:1017: checking whether ${CC-cc} accepts -g" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1045,7 +1049,7 @@
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1049: checking for $ac_word" >&5
++echo "configure:1053: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1078,7 +1082,7 @@
+
+
+ echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+-echo "configure:1082: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
++echo "configure:1086: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+
+ ac_ext=C
+ # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+@@ -1089,12 +1093,12 @@
+
+ cat > conftest.$ac_ext << EOF
+
+-#line 1093 "configure"
++#line 1097 "configure"
+ #include "confdefs.h"
+
+ int main(){return(0);}
+ EOF
+-if { (eval echo configure:1098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:1102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cxx_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+@@ -1120,12 +1124,12 @@
+ { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+-echo "configure:1124: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
++echo "configure:1128: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+ echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
+ cross_compiling=$ac_cv_prog_cxx_cross
+
+ echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
+-echo "configure:1129: checking whether we are using GNU C++" >&5
++echo "configure:1133: checking whether we are using GNU C++" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1134,7 +1138,7 @@
+ yes;
+ #endif
+ EOF
+-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1138: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
++if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gxx=yes
+ else
+ ac_cv_prog_gxx=no
+@@ -1153,7 +1157,7 @@
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=
+ echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
+-echo "configure:1157: checking whether ${CXX-g++} accepts -g" >&5
++echo "configure:1161: checking whether ${CXX-g++} accepts -g" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1188,7 +1192,7 @@
+ # Extract the first word of "flex", so it can be a program name with args.
+ set dummy flex; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1192: checking for $ac_word" >&5
++echo "configure:1196: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1223,7 +1227,7 @@
+ *) ac_lib=l ;;
+ esac
+ echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
+-echo "configure:1227: checking for yywrap in -l$ac_lib" >&5
++echo "configure:1231: checking for yywrap in -l$ac_lib" >&5
+ ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -1231,7 +1235,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-l$ac_lib $LIBS"
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:1250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -1286,7 +1290,7 @@
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1290: checking for $ac_word" >&5
++echo "configure:1294: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1362,7 +1366,7 @@
+ fi
+
+ echo $ac_n "checking host system type""... $ac_c" 1>&6
+-echo "configure:1366: checking host system type" >&5
++echo "configure:1370: checking host system type" >&5
+
+ host_alias=$host
+ case "$host_alias" in
+@@ -1383,7 +1387,7 @@
+ echo "$ac_t""$host" 1>&6
+
+ echo $ac_n "checking target system type""... $ac_c" 1>&6
+-echo "configure:1387: checking target system type" >&5
++echo "configure:1391: checking target system type" >&5
+
+ target_alias=$target
+ case "$target_alias" in
+@@ -1401,7 +1405,7 @@
+ echo "$ac_t""$target" 1>&6
+
+ echo $ac_n "checking build system type""... $ac_c" 1>&6
+-echo "configure:1405: checking build system type" >&5
++echo "configure:1409: checking build system type" >&5
+
+ build_alias=$build
+ case "$build_alias" in
+@@ -1425,7 +1429,7 @@
+
+
+ echo $ac_n "checking whether to define additional compiler specific flags""... $ac_c" 1>&6
+-echo "configure:1429: checking whether to define additional compiler specific flags" >&5
++echo "configure:1433: checking whether to define additional compiler specific flags" >&5
+ case "$target" in
+ alpha*-dec*)
+ if test "$CC" = "cc"; then
+@@ -1449,12 +1453,12 @@
+ esac
+
+ echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
+-echo "configure:1453: checking for sys/wait.h that is POSIX.1 compatible" >&5
++echo "configure:1457: checking for sys/wait.h that is POSIX.1 compatible" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <
+ #include
+@@ -1470,7 +1474,7 @@
+ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+ ; return 0; }
+ EOF
+-if { (eval echo configure:1474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:1478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_header_sys_wait_h=yes
+ else
+@@ -1503,7 +1507,7 @@
+ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+ # ./install, which can be erroneously created by make from ./install.sh.
+ echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+-echo "configure:1507: checking for a BSD compatible install" >&5
++echo "configure:1511: checking for a BSD compatible install" >&5
+ if test -z "$INSTALL"; then
+ if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -1558,7 +1562,7 @@
+ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+-echo "configure:1562: checking whether ${MAKE-make} sets \${MAKE}" >&5
++echo "configure:1566: checking whether ${MAKE-make} sets \${MAKE}" >&5
+ set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -1585,7 +1589,7 @@
+ fi
+
+ echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+-echo "configure:1589: checking whether ln -s works" >&5
++echo "configure:1593: checking whether ln -s works" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1608,7 +1612,7 @@
+ fi
+
+ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+-echo "configure:1612: checking how to run the C preprocessor" >&5
++echo "configure:1616: checking how to run the C preprocessor" >&5
+ # On Suns, sometimes $CPP names a directory.
+ if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+@@ -1623,13 +1627,13 @@
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <
+ Syntax Error
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:1633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:1637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ :
+@@ -1640,13 +1644,13 @@
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <
+ Syntax Error
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:1650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:1654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ :
+@@ -1657,13 +1661,13 @@
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <
+ Syntax Error
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:1667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:1671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ :
+@@ -1690,19 +1694,19 @@
+ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+ # for constant arguments. Useless!
+ echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
+-echo "configure:1694: checking for working alloca.h" >&5
++echo "configure:1698: checking for working alloca.h" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <
+ int main() {
+ char *p = alloca(2 * sizeof(int));
+ ; return 0; }
+ EOF
+-if { (eval echo configure:1706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:1710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_header_alloca_h=yes
+ else
+@@ -1723,12 +1727,12 @@
+ fi
+
+ echo $ac_n "checking for alloca""... $ac_c" 1>&6
+-echo "configure:1727: checking for alloca" >&5
++echo "configure:1731: checking for alloca" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_func_alloca_works=yes
+ else
+@@ -1788,12 +1792,12 @@
+
+
+ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
+-echo "configure:1792: checking whether alloca needs Cray hooks" >&5
++echo "configure:1796: checking whether alloca needs Cray hooks" >&5
+ if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <&6
+-echo "configure:1822: checking for $ac_func" >&5
++echo "configure:1826: checking for $ac_func" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:1854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+ else
+@@ -1873,7 +1877,7 @@
+ fi
+
+ echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
+-echo "configure:1877: checking stack direction for C alloca" >&5
++echo "configure:1881: checking stack direction for C alloca" >&5
+ if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1881,7 +1885,7 @@
+ ac_cv_c_stack_direction=0
+ else
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:1908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ ac_cv_c_stack_direction=1
+ else
+@@ -1924,7 +1928,7 @@
+ # Extract the first word of "ranlib", so it can be a program name with args.
+ set dummy ranlib; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1928: checking for $ac_word" >&5
++echo "configure:1932: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1957,7 +1961,7 @@
+ # Uses ac_ vars as temps to allow command line to override cache and checks.
+ # --without-x overrides everything else, but does not touch the cache.
+ echo $ac_n "checking for X""... $ac_c" 1>&6
+-echo "configure:1961: checking for X" >&5
++echo "configure:1965: checking for X" >&5
+
+ # Check whether --with-x or --without-x was given.
+ if test "${with_x+set}" = set; then
+@@ -2019,12 +2023,12 @@
+
+ # First, try using that file with no special directory specified.
+ cat > conftest.$ac_ext <
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:2028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:2032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -2094,14 +2098,14 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-l$x_direct_test_library $LIBS"
+ cat > conftest.$ac_ext <
+ int main() {
+ ${x_direct_test_function}(${x_direct_test_arguments})
+ ; return 0; }
+ EOF
+-if { (eval echo configure:2105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:2109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ LIBS="$ac_save_LIBS"
+ # We can link X programs with no special library path.
+@@ -2337,6 +2341,13 @@
+ fi
+
+
++# Check whether --with-install-extra or --without-install-extra was given.
++if test "${with_install_extra+set}" = set; then
++ withval="$with_install_extra"
++ :
++fi
++
++
+
+
+ # Check whether --with-bibtex8 or --without-bibtex8 was given.
+@@ -2399,6 +2410,12 @@
+ :
+ fi
+
++# Check whether --with-dvipos or --without-dvipos was given.
++if test "${with_dvipos+set}" = set; then
++ withval="$with_dvipos"
++ :
++fi
++
+ # Check whether --with-dvipsk or --without-dvipsk was given.
+ if test "${with_dvipsk+set}" = set; then
+ withval="$with_dvipsk"
+@@ -2505,7 +2522,7 @@
+
+
+ echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+-echo "configure:2509: checking whether to enable maintainer-specific portions of Makefiles" >&5
++echo "configure:2526: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+ if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+@@ -2524,7 +2541,7 @@
+
+
+ echo $ac_n "checking for loader (symbol LD)""... $ac_c" 1>&6
+-echo "configure:2528: checking for loader (symbol LD)" >&5
++echo "configure:2545: checking for loader (symbol LD)" >&5
+ if eval "test \"`echo '$''{'cf_cv_subst_LD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2538,7 +2555,7 @@
+
+
+ echo $ac_n "checking for archiver (symbol AR)""... $ac_c" 1>&6
+-echo "configure:2542: checking for archiver (symbol AR)" >&5
++echo "configure:2559: checking for archiver (symbol AR)" >&5
+ if eval "test \"`echo '$''{'cf_cv_subst_AR'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2552,7 +2569,7 @@
+
+
+ echo $ac_n "checking for archiver options (symbol ARFLAGS)""... $ac_c" 1>&6
+-echo "configure:2556: checking for archiver options (symbol ARFLAGS)" >&5
++echo "configure:2573: checking for archiver options (symbol ARFLAGS)" >&5
+ if eval "test \"`echo '$''{'cf_cv_subst_ARFLAGS'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2622,7 +2639,7 @@
+
+
+ echo $ac_n "checking where the main texmf tree is located""... $ac_c" 1>&6
+-echo "configure:2626: checking where the main texmf tree is located" >&5
++echo "configure:2643: checking where the main texmf tree is located" >&5
+ case $prefix in
+ */) prefix=`echo "$prefix" | sed 's@/*$@@'`;;
+ esac
+@@ -2756,12 +2773,12 @@
+ # -lsocket is needed on Solaris, at least. Maybe -lnsl on SCO, too?
+ # See ac_path_xtra.
+ echo $ac_n "checking for connect""... $ac_c" 1>&6
+-echo "configure:2760: checking for connect" >&5
++echo "configure:2777: checking for connect" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:2805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_connect=yes"
+ else
+@@ -2805,7 +2822,7 @@
+
+ if test x$ac_cv_func_connect = xno; then
+ echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
+-echo "configure:2809: checking for connect in -lsocket" >&5
++echo "configure:2826: checking for connect in -lsocket" >&5
+ ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -2813,7 +2830,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lsocket $LIBS"
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:2845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -3514,7 +3531,7 @@
+
+ if test "$with_system_pnglib" = yes; then
+ echo $ac_n "checking for png_set_read_fn in -lpng""... $ac_c" 1>&6
+-echo "configure:3518: checking for png_set_read_fn in -lpng" >&5
++echo "configure:3535: checking for png_set_read_fn in -lpng" >&5
+ ac_lib_var=`echo png'_'png_set_read_fn | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -3522,7 +3539,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lpng -lz -lm $LIBS"
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:3554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -3604,7 +3621,7 @@
+
+ if test "$with_system_zlib" = yes; then
+ echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
+-echo "configure:3608: checking for inflate in -lz" >&5
++echo "configure:3625: checking for inflate in -lz" >&5
+ ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -3612,7 +3629,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lz $LIBS"
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:3644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -3659,17 +3676,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3663: checking for $ac_hdr" >&5
++echo "configure:3680: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:3690: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3755,7 +3772,7 @@
+ CURSESCPPFLAGS=
+ if test "$try_ncurses" = yes; then
+ echo $ac_n "checking for wresize in -lncurses""... $ac_c" 1>&6
+-echo "configure:3759: checking for wresize in -lncurses" >&5
++echo "configure:3776: checking for wresize in -lncurses" >&5
+ ac_lib_var=`echo ncurses'_'wresize | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -3763,7 +3780,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lncurses $LIBS"
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:3795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -3805,17 +3822,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3809: checking for $ac_hdr" >&5
++echo "configure:3826: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:3836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3856,17 +3873,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3860: checking for $ac_hdr" >&5
++echo "configure:3877: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:3887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3914,17 +3931,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3918: checking for $ac_hdr" >&5
++echo "configure:3935: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:3945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -4033,7 +4050,7 @@
+
+ if test "$with_system_t1lib" = yes; then
+ echo $ac_n "checking for T1_AddFont in -lt1""... $ac_c" 1>&6
+-echo "configure:4037: checking for T1_AddFont in -lt1" >&5
++echo "configure:4054: checking for T1_AddFont in -lt1" >&5
+ ac_lib_var=`echo t1'_'T1_AddFont | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4041,7 +4058,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lt1 -lz -lm $LIBS"
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:4073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4079,13 +4096,13 @@
+ LIBS="-lt1 -lm $LIBS"
+ if test "$with_system_t1lib" = yes; then
+ echo $ac_n "checking whether installed T1 lib is >= v 5.0.0 ""... $ac_c" 1>&6
+-echo "configure:4083: checking whether installed T1 lib is >= v 5.0.0 " >&5
++echo "configure:4100: checking whether installed T1 lib is >= v 5.0.0 " >&5
+ if test "$cross_compiling" = yes; then
+ ac_compile_t1lib=1
+ ]
+ else
+ cat > conftest.$ac_ext <
+@@ -4117,7 +4134,7 @@
+ }
+
+ EOF
+-if { (eval echo configure:4121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:4138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ ac_compile_t1lib=0
+ else
+@@ -4185,7 +4202,7 @@
+
+ if test "$with_system_gd" = yes; then
+ echo $ac_n "checking for gdImageCreateFromPng in -lgd""... $ac_c" 1>&6
+-echo "configure:4189: checking for gdImageCreateFromPng in -lgd" >&5
++echo "configure:4206: checking for gdImageCreateFromPng in -lgd" >&5
+ ac_lib_var=`echo gd'_'gdImageCreateFromPng | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4193,7 +4210,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lgd $LIBS"
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:4225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4237,7 +4254,7 @@
+
+ if test "$with_system_gd" = yes; then
+ echo $ac_n "checking for gdImageGif in -lgd""... $ac_c" 1>&6
+-echo "configure:4241: checking for gdImageGif in -lgd" >&5
++echo "configure:4258: checking for gdImageGif in -lgd" >&5
+ ac_lib_var=`echo gd'_'gdImageGif | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4245,7 +4262,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lgd $LIBS"
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:4277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4292,17 +4309,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:4296: checking for $ac_hdr" >&5
++echo "configure:4313: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:4306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:4323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -4381,7 +4398,7 @@
+
+ if test "$with_system_freetype" = yes; then
+ echo $ac_n "checking for TT_Init_FreeType in -lttf""... $ac_c" 1>&6
+-echo "configure:4385: checking for TT_Init_FreeType in -lttf" >&5
++echo "configure:4402: checking for TT_Init_FreeType in -lttf" >&5
+ ac_lib_var=`echo ttf'_'TT_Init_FreeType | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4389,7 +4406,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lttf $LIBS"
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:4421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4436,17 +4453,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:4440: checking for $ac_hdr" >&5
++echo "configure:4457: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:4450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:4467: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -4525,7 +4542,7 @@
+
+ if test "$with_system_freetype2" = yes; then
+ echo $ac_n "checking for FT_Init_FreeType in -lfreetype""... $ac_c" 1>&6
+-echo "configure:4529: checking for FT_Init_FreeType in -lfreetype" >&5
++echo "configure:4546: checking for FT_Init_FreeType in -lfreetype" >&5
+ ac_lib_var=`echo freetype'_'FT_Init_FreeType | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4533,7 +4550,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lfreetype $LIBS"
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:4565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4580,17 +4597,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:4584: checking for $ac_hdr" >&5
++echo "configure:4601: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:4594: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:4611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -4669,7 +4686,7 @@
+
+ if test "$with_system_icu" = yes; then
+ echo $ac_n "checking for ubidi_open in -licuuc""... $ac_c" 1>&6
+-echo "configure:4673: checking for ubidi_open in -licuuc" >&5
++echo "configure:4690: checking for ubidi_open in -licuuc" >&5
+ ac_lib_var=`echo icuuc'_'ubidi_open | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4677,7 +4694,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-licuuc $LIBS"
+ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:4709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4724,17 +4741,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:4728: checking for $ac_hdr" >&5
++echo "configure:4745: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:4738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:4755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -4875,7 +4892,8 @@
+
+
+ # initialize texmf tree with fmtutil only for teTeX and TeX Live
+-if test ! -d $srcdir/texk/tetex || test -n "$xdvik_standalone" || test "x$cross_compiling" = xyes; then
++if test ! -d $srcdir/texk/tetex || test -n "$xdvik_standalone" || \
++ test "x$cross_compiling" = xyes || test "$with_install_extra" = no; then
+ FMU=
+ else
+ FMU='# '
+Index: texlive-bin-2007/build/source/configure.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/configure.in 2007-02-19 18:03:57.000000000 +0100
++++ texlive-bin-2007/build/source/configure.in 2007-02-19 18:04:06.000000000 +0100
+@@ -273,7 +273,8 @@
+ AC_SUBST(LIBSDIRS)
+
+ # initialize texmf tree with fmtutil only for teTeX and TeX Live
+-if test ! -d $srcdir/texk/tetex || test -n "$xdvik_standalone" || test "x$cross_compiling" = xyes; then
++if test ! -d $srcdir/texk/tetex || test -n "$xdvik_standalone" || \
++ test "x$cross_compiling" = xyes || test "$with_install_extra" = no; then
+ FMU=
+ else
+ FMU='# '
+Index: texlive-bin-2007/build/source/withenable.ac
+===================================================================
+--- texlive-bin-2007.orig/build/source/withenable.ac 2007-02-19 18:03:57.000000000 +0100
++++ texlive-bin-2007/build/source/withenable.ac 2007-02-19 18:04:06.000000000 +0100
+@@ -29,3 +29,6 @@
+
+ AC_ARG_WITH([texinfo],
+ [ --without-texinfo do not build the texinfo package])
++
++AC_ARG_WITH([install-extra],
++ [ --without-install-extra do not initialize the installed tree])
+Index: texlive-bin-2007/build/source/texk/web2c/Makefile.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/Makefile.in 2007-02-19 18:09:08.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/Makefile.in 2007-02-19 18:09:11.000000000 +0100
+@@ -782,7 +782,7 @@
+
+ #
+ install: install-exec install-data
+-install-exec:: install-programs @FMU@ install-links
++install-exec:: install-programs install-links
+ install-data:: install-tex-data install-mf-data install-mpost-data
+ install-dumps: install-tex-dumps install-mf-dumps install-mpost-dumps
+
--- texlive-bin-2007.dfsg.1.orig/debian/patches/unused51_fmtutil_tempdir_in_texinputs
+++ texlive-bin-2007.dfsg.1/debian/patches/unused51_fmtutil_tempdir_in_texinputs
@@ -0,0 +1,33 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 50_fmtutil_tempdir_in_texinputs.dpatch by Frank Kster
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: add the tempdir to the texinputs path
+
+@DPATCH@
+ build/TeX/texk/tetex/fmtutil | 5 +++++
+ 1 files changed, 5 insertions(+)
+
+Index: texlive-bin-2007.dfsg.1/build/TeX/texk/tetex/fmtutil
+===================================================================
+--- texlive-bin-2007.dfsg.1.orig/build/TeX/texk/tetex/fmtutil 2007-01-22 13:08:31.000000000 +0100
++++ texlive-bin-2007.dfsg.1/build/TeX/texk/tetex/fmtutil 2007-01-22 13:09:29.000000000 +0100
+@@ -34,6 +34,7 @@
+ ###############################################################################
+ ###############################################################################
+ # program history:
++# Do Mar 02 10:42:31 CET 2006 add tmpdir to TEXFORMATS
+ # Fr Apr 8 19:15:05 CEST 2005 cleanup now has an argument for the return code
+ # So Mär 27 18:52:06 CEST 2005 honor $TMPDIR, $TEMP and $TMP, not just $TMP
+ # Sa Jan 15 18:13:46 CET 2005 avoid multiple variable assignments in one statement
+@@ -562,6 +563,10 @@
+ # due to KPSE_DOT, we don't search the current directory, so include
+ # it explicitly for formats that \write and later on \read
+ TEXINPUTS="$tmpdir:$TEXINPUTS"; export TEXINPUTS
++ # for formats that load other formats (e.g. jadetex loads latex.fmt),
++ # add the current directory to TEXFORMATS, too. We could do the same for
++ # MFBASES and MPMEMS, but it doesn't seem to be necessary currently.
++ TEXFORMATS="$tmpdir:$TEXFORMATS"; export TEXFORMATS
+
+ setupTmpDir
+ cd "$tmpdir" || cleanup 1
--- texlive-bin-2007.dfsg.1.orig/debian/patches/62_dvips_absolutepath_doc
+++ texlive-bin-2007.dfsg.1/debian/patches/62_dvips_absolutepath_doc
@@ -0,0 +1,59 @@
+---
+ texmf/doc/man/man1/dvips.1 | 25 +++++++++++++++----------
+ texmf/dvips/config/config.ps | 7 +++++--
+ 2 files changed, 20 insertions(+), 12 deletions(-)
+
+Index: texlive-bin-2007/texmf/dvips/config/config.ps
+===================================================================
+--- texlive-bin-2007.orig/texmf/dvips/config/config.ps 2007-04-22 08:21:53.000000000 +0200
++++ texlive-bin-2007/texmf/dvips/config/config.ps 2007-04-22 08:33:28.000000000 +0200
+@@ -7,8 +7,11 @@
+ % to determine this number. (It will be the only thing printed.)
+ m 3500000
+
+-% z1 is "secure", i.e., inhibits execution of `shell commands` in
+-% \specials. Dvips allows this by default.
++% Run securely. z2 disables both shell command execution in
++% `\special' and config files (via the `E' option) and opening of any
++% absolute filenames. z1, the default, forbids shell escapes but
++% allows absolute filenames. z0 allows both. The corresponding
++% commandline options are -R0|-R1|-R2
+ z1
+
+ % How to print, maybe with lp instead lpr, etc. If commented-out, output
+Index: texlive-bin-2007/texmf/doc/man/man1/dvips.1
+===================================================================
+--- texlive-bin-2007.orig/texmf/doc/man/man1/dvips.1 2007-04-22 08:23:32.000000000 +0200
++++ texlive-bin-2007/texmf/doc/man/man1/dvips.1 2007-04-22 08:32:57.000000000 +0200
+@@ -360,16 +360,21 @@
+ .B -r
+ Stack pages in reverse order. Normally, page 1 will be printed first.
+ .TP
+-.B -R
+-Run in secure mode. This means that ``backtick'' commands from a
+-.I \especial{}
+-or
+-.I \epsffile{}
+-macro in the (La)TeX source like
+-.I \especial{psfile="`zcat foo.ps.Z"}
+-or
+-.I \epsffile[72 72 540 720]{"`zcat screendump.ps.gz"}
+-are not executed.
++.B -R[0|1|2]
++Run securely.
++.BR -R2
++disables both shell command execution in
++.I \especial'{}
++(via backticks
++.BR `
++) and config files (via the
++.I E
++option), and opening of any absolute filenames.
++.BR -R1
++, the default, forbids shell escapes but allows absolute filenames.
++.BR -R0
++allows both. The config file option is
++.I z
+ .TP
+ .B -s
+ Causes the entire global output to be enclosed in a save/restore pair.
--- texlive-bin-2007.dfsg.1.orig/debian/patches/63_texmf.cnf_for_comparison_temp
+++ texlive-bin-2007.dfsg.1/debian/patches/63_texmf.cnf_for_comparison_temp
@@ -0,0 +1,168 @@
+---
+ texmf/web2c/texmf.cnf | 121 ++++++++++++++++----------------------------------
+ 1 file changed, 40 insertions(+), 81 deletions(-)
+
+Index: texlive-bin-2007/texmf/web2c/texmf.cnf
+===================================================================
+--- texlive-bin-2007.orig/texmf/web2c/texmf.cnf 2007-04-22 19:05:16.000000000 +0200
++++ texlive-bin-2007/texmf/web2c/texmf.cnf 2007-04-22 19:05:29.000000000 +0200
+@@ -248,10 +248,27 @@
+ % Earlier entries override later ones, so put this last.
+ TEXINPUTS = .;$TEXMF/tex/{$progname,generic,}//
+
++% extra format definitions for TeX Live
++
++TEXINPUTS.elambda = .;$TEXMF/tex/{lambda,latex,generic,}//
++TEXINPUTS.eomega = .;$TEXMF/tex/{plain,generic,}//
++TEXINPUTS.pdfxmex = .;$TEXMF/tex/{mex,plain,generic,}//
++TEXINPUTS.frpdflatex = .;$TEXMF/tex/{french,latex,generic,}//
++TEXINPUTS.frpdftex = .;$TEXMF/tex/{french,plain,generic,}//
++TEXINPUTS.xmltex = .;$TEXMF/tex/{xmltex,latex,generic,}//
++TEXINPUTS.pdfxmltex = .;$TEXMF/tex/{xmltex,latex,generic,}//
++
++TTF2TFMINPUTS = .;$TEXMF/ttf2pk//
++
+ % Metafont, MetaPost inputs.
+ MFINPUTS = .;$TEXMF/metafont//;{$TEXMF/fonts,$VARTEXFONTS}/source//
+ MPINPUTS = .;$TEXMF/metapost//
+
++% allow for compressed files, and various extenions
++TEXDOCSSUFFIX = ;.pdf;.ps;.dvi;.html;.txt;.tex
++TEXDOCSCOMPRESS = ;.gz;.bz2;.zip;.Z
++TEXDOCEXT = {$TEXDOCSSUFFIX}{$TEXDOCSCOMPRESS}
++
+ % Dump files (fmt/base/mem) for vir{tex,mf,mp} to read (see web2c/INSTALL),
+ % and string pools (.pool) for ini{tex,mf,mp}. It is silly that we have six
+ % paths and directories here (they all resolve to a single place by default),
+@@ -298,6 +315,9 @@
+ % BibTeX bibliographies and style files.
+ BIBINPUTS = .;$TEXMF/bibtex/bib//
+ BSTINPUTS = .;$TEXMF/bibtex/{bst,csf}//
++% For bibtex8. Do we really need to repeat the BIBINPUTS setting?
++BIBINPUTS.bibtex8 = .;$TEXMF/bibtex/{bib,}//
++BSTINPUTS.bibtex8 = .;$TEXMF/bibtex/{bst,csf,}//
+
+ % MFT style files.
+ MFTINPUTS = .;$TEXMF/mft//
+@@ -392,9 +412,23 @@
+ % search formats, you'll want to add their variables here as well.
+ T4HTINPUTS = .;$TEXMF/tex4ht//
+
++%% t4ht utility, sharing files with TeX4ht
++TEX4HTFONTSET=alias,iso8859,unicode
++TEX4HTINPUTS = .;$TEXMF/tex4ht/base//;$TEXMF/tex4ht/ht-fonts/{$TEX4HTFONTSET}//
++
++% Part for scripts that are distributed/installed in the texmf tree.
++
+ % Architecture independent executables.
+ TEXMFSCRIPTS = $TEXMF/scripts/{$engine,$progname,}//
+
++% Perl, Python, Ruby, Java scripts
++JAVAINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/java//
++LUAINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/lua//
++PERLINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/perl//
++PYTHONINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/python//
++RUBYINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/ruby//
++
++
+ %% The mktex* scripts rely on KPSE_DOT. Do not set it in the environment.
+ % KPSE_DOT = .
+
+@@ -446,6 +480,12 @@
+ openout_any = p
+ openin_any = a
+
++% Disable search on multiple suffixes filenames. In many case, when `foo.bar'
++% is looked for, you do not want to look for `foo.bar.tex' before. This flag
++% disables searching for standard suffixes if the file name has already an
++% extension of 3 characters. Default value is true (old behaviour).
++allow_multiple_suffixes = f
++
+ % Allow TeX, MF, and MP to parse the first line of an input file for
+ % the %&format construct.
+ parse_first_line = t
+@@ -582,84 +622,3 @@
+ half_error_line = 50
+ max_print_line = 79
+
+-
+-% Part 4: extra format definitions for TeX Live
+-
+-TEXINPUTS.elambda = .;$TEXMF/tex/{lambda,latex,generic,}//
+-TEXINPUTS.eomega = .;$TEXMF/tex/{plain,generic,}//
+-TEXINPUTS.pdfxmex = .;$TEXMF/tex/{mex,plain,generic,}//
+-TEXINPUTS.frpdflatex = .;$TEXMF/tex/{french,latex,generic,}//
+-TEXINPUTS.frpdftex = .;$TEXMF/tex/{french,plain,generic,}//
+-TEXINPUTS.xmltex = .;$TEXMF/tex/{xmltex,latex,generic,}//
+-TEXINPUTS.pdfxmltex = .;$TEXMF/tex/{xmltex,latex,generic,}//
+-
+-TTF2TFMINPUTS = .;$TEXMF/ttf2pk//
+-
+-% For bibtex8. Do we really need to repeat the BIBINPUTS setting?
+-BIBINPUTS.bibtex8 = .;$TEXMF/bibtex/{bib,}//
+-BSTINPUTS.bibtex8 = .;$TEXMF/bibtex/{bst,csf,}//
+-
+-% allow for compressed files, and various extenions
+-TEXDOCSSUFFIX = ;.pdf;.ps;.dvi;.html;.txt;.tex
+-TEXDOCSCOMPRESS = ;.gz;.bz2;.zip;.Z
+-TEXDOCEXT = {$TEXDOCSSUFFIX}{$TEXDOCSCOMPRESS}
+-
+-%% t4ht utility, sharing files with TeX4ht
+-TEX4HTFONTSET=alias,iso8859,unicode
+-TEX4HTINPUTS = .;$TEXMF/tex4ht/base//;$TEXMF/tex4ht/ht-fonts/{$TEX4HTFONTSET}//
+-
+-% Part for scripts that are distributed/installed in the texmf tree.
+-
+-% Perl, Python, Ruby, Java scripts (Win32 only)
+-% This is used by the irun.exe program which simulates a symlink
+-% but also makes use of kpathsea to retrieve the target
+-JAVAINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/java//
+-LUAINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/lua//
+-PERLINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/perl//
+-PYTHONINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/python//
+-RUBYINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/ruby//
+-
+-% Suggestions for editor settings under Windows. Uncomment your
+-% preferred option. The corresponding MFEDIT can also be set for use with
+-% Metafont.
+-%
+-% Winedt:
+-% TEXEDIT=C:\WinEdt\WinEdt.exe "[Open('%s');SelLine(%d,7)]
+-% Textpad:
+-% TEXEDIT = c:\Progra~1\TextPad\System\Ddeopn32 TextPad %s(%d)
+-% UltraEdit (newer Win32 versions):
+-% TEXEDIT = uedit32 %s/%d/1
+-% WinTeXShell32:
+-% TEXEDIT = texshell.exe /l=%d %s
+-% vi, vim, gvim. here we show Windows gvim.exe:
+-% TEXEDIT = gvim.exe %s +%d
+-% PFE:
+-% TEXEDIT=pfe32/g%d %s
+-% MED:
+-% TEXEDIT=med.exe "%s" %d
+-% TSE:
+-% TEXEDIT=e32.exe "%s" -n%d
+-% Epsilon (Lugaru) http://www.lugaru.com/
+-% TEXEDIT="c:\Program Files\eps90\bin\e32.exe" +%d %s
+-% WinShell
+-% TEXEDIT=C:\Progra~1\WinShell\WinShell.exe -c %s -l %d
+-% notepad
+-% TEXEDIT = notepad %s
+-
+-% For unix
+-%
+-% vi, vim, NEdit, (X)Emacs, pico, jed
+-% TEXEDIT = vi +%d %s
+-% TEXEDIT = vim +%d %s
+-% TEXEDIT = nedit +%d %s
+-% TEXEDIT = xemacs +%d %s
+-% TEXEDIT = emacs +%d %s
+-
+-%(x)fte:
+-% TEXEDIT = xfte -l%d %s
+-
+-% Disable search on multiple suffixes filenames. In many case, when `foo.bar'
+-% is looked for, you do not want to look for `foo.bar.tex' before. This flag
+-% disables searching for standard suffixes if the file name has already an
+-% extension of 3 characters. Default value is true (old behaviour).
+-allow_multiple_suffixes = f
--- texlive-bin-2007.dfsg.1.orig/debian/patches/12d_fix_ebong_invocation
+++ texlive-bin-2007.dfsg.1/debian/patches/12d_fix_ebong_invocation
@@ -0,0 +1,13 @@
+---
+ build/source/texk/texlive/ebong | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: texlive-bin-2007/build/source/texk/texlive/ebong
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/texlive/ebong 2007-05-15 14:44:43.000000000 +0200
++++ texlive-bin-2007/build/source/texk/texlive/ebong 2007-05-15 14:44:52.000000000 +0200
+@@ -1,3 +1,4 @@
++#!/usr/bin/python
+ # look in newbong
+ import sre
+ A='A'
--- texlive-bin-2007.dfsg.1.orig/debian/patches/metapost-1.0
+++ texlive-bin-2007.dfsg.1/debian/patches/metapost-1.0
@@ -0,0 +1,445 @@
+---
+ build/source/texk/web2c/lib/texmfmp.c | 4
+ build/source/texk/web2c/mp.web | 138 +++++++++++++++++++++++---
+ build/source/texk/web2c/mpdir/Makefile.in | 4
+ build/source/texk/web2c/mpdir/mp.defines | 1
+ build/source/texk/web2c/mpdir/mplib.h | 4
+ build/source/texk/web2c/mpdir/turningnumber.c | 113 +++++++++++++++++++++
+ build/source/texk/web2c/mpware/dmp.c | 4
+ build/source/texk/web2c/mpware/makempx.c | 2
+ build/source/texk/web2c/mpware/mpto.c | 2
+ build/source/texk/web2c/mpware/newer.c | 2
+ 10 files changed, 253 insertions(+), 21 deletions(-)
+
+Index: texlive-bin-2007/build/source/texk/web2c/lib/texmfmp.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/lib/texmfmp.c 2007-10-04 10:24:09.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/lib/texmfmp.c 2007-10-04 10:24:35.000000000 +0200
+@@ -87,9 +87,9 @@
+ #define edit_var "MFEDIT"
+ #endif /* MF */
+ #ifdef MP
+-#define BANNER "This is MetaPost, Version 0.993"
++#define BANNER "This is MetaPost, Version 1.000"
+ #define COPYRIGHT_HOLDER "AT&T Bell Laboratories"
+-#define AUTHOR "John Hobby"
++#define AUTHOR "John Hobby.\nCurrent maintainer of MetaPost: Taco Hoekwater"
+ #define PROGRAM_HELP MPHELP
+ #define BUG_ADDRESS "tex-k@mail.tug.org"
+ #define DUMP_VAR MPmemdefault
+Index: texlive-bin-2007/build/source/texk/web2c/mp.web
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/mp.web 2007-10-04 10:23:19.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/mp.web 2007-10-04 10:24:35.000000000 +0200
+@@ -97,8 +97,8 @@
+ @^extensions to \MP@>
+ @^system dependencies@>
+
+-@d banner=='This is MetaPost, Version 0.993' {printed when \MP\ starts}
+-@d metapost_version=="0.993"
++@d banner=='This is MetaPost, Version 1.000' {printed when \MP\ starts}
++@d metapost_version=="1.000"
+
+ @ Different \PASCAL s have slightly different conventions, and the present
+ @!@:PASCAL H}{\ph@>
+@@ -17088,10 +17088,7 @@
+ found:pict_length:=n;
+ end;
+
+-@ The turning number is computed only with respect to a triangular pen whose
+-@:turning_number_}{\&{turningnumber} primitive@>
+-vertices are $(0,1)$ and $(\pm{1\over2},0)$. The choice of pen isn't supposed
+-to matter but rounding error could make a difference if the path has a cusp.
++@ Implement |turningnumber|
+
+ @=
+ turning_op:if cur_type=pair_type then flush_cur_exp(0)
+@@ -17099,9 +17096,107 @@
+ else if left_type(cur_exp)=endpoint then
+ flush_cur_exp(0) {not a cyclic path}
+ else begin
+- flush_cur_exp(turn_cycles(cur_exp));
++ flush_cur_exp(turn_cycles_wrapper(cur_exp));
+ end;
+
++@ The function |new_an_angle| returns the value of the |angle| primitive, or $0$ if the
++argument is |origin|.
++
++@=
++function new_an_angle (@!xpar,@!ypar:scaled):angle;
++begin
++ if (not ((xpar=0) and (ypar=0))) then
++ new_an_angle := n_arg(xpar,ypar)
++ else
++ new_an_angle := 0;
++end;
++
++
++@ The actual turning number is (for the moment) computed in a C function
++that receives eight integers corresponding to the four controlling points,
++and returns a single angle. Besides those, we have to account for discrete
++moves at the actual points.
++
++@d p_nextnext==link(link(p))
++@d p_next==link(p)
++
++@d seven_twenty_deg==@'5500000000 {$720\cdot2^{20}$, represents $720^\circ$}
++
++@=
++function new_turn_cycles (@!c:pointer):scaled;
++label exit;
++var @!res,ang:angle; { the angles of intermediate results }
++@!turns:scaled; { the turn counter }
++@!p:pointer; { for running around the path }
++@!xp,yp:integer; { coordinates of next point }
++@!x,y:integer; { helper coordinates }
++@!in_angle,out_angle:angle; { helper angles}
++@!old_setting:0..max_selector; {saved |selector| setting}
++begin
++res:=0;
++turns:= 0;
++p:=c;
++old_setting := selector; selector:=term_only;
++if internal[tracing_commands]>unity then begin
++ begin_diagnostic;
++ print_nl("");
++ end_diagnostic(false);
++end;
++if (p_next=p)or(p_nextnext=p) then
++ if new_an_angle (x_coord(p) - right_x(p), y_coord(p) - right_y(p)) >= 0 then
++ new_turn_cycles := unity
++ else
++ new_turn_cycles := -unity
++else begin
++ repeat
++ xp := x_coord(p_next); yp := y_coord(p_next);
++ ang := bezier_slope(x_coord(p), y_coord(p), right_x(p), right_y(p),
++ left_x(p_next), left_y(p_next), xp, yp, internal[tracing_commands]);
++ if ang>seven_twenty_deg then begin
++ print_err("Strange path");
++ error;
++ new_turn_cycles := 0;
++ return;
++ end;
++ res := res + ang;
++ if res >= one_eighty_deg then begin
++ res := res - three_sixty_deg;
++ turns := turns + unity;
++ end;
++ if res <= -one_eighty_deg then begin
++ res := res + three_sixty_deg;
++ turns := turns - unity;
++ end;
++ { incoming angle at next point }
++ x := left_x(p_next); y := left_y(p_next);
++ if (xp=x)and(yp=y) then begin x := right_x(p); y := right_y(p); end;
++ if (xp=x)and(yp=y) then begin x := x_coord(p); y := y_coord(p); end;
++ in_angle := new_an_angle(xp - x, yp - y);
++ { outgoing angle at next point }
++ x := right_x(p_next); y := right_y(p_next);
++ if (xp=x)and(yp=y) then begin x := left_x(p_nextnext); y := left_y(p_nextnext); end;
++ if (xp=x)and(yp=y) then begin x := x_coord(p_nextnext); y := y_coord(p_nextnext); end;
++ out_angle := new_an_angle(x - xp, y- yp);
++ ang := (out_angle - in_angle);
++ if (ang<>0)and(abs(ang)<=one_eighty_deg) then begin
++ res := res + ang;
++ if res >= one_eighty_deg then begin
++ res := res - three_sixty_deg;
++ turns := turns + unity;
++ end;
++ if res <= -one_eighty_deg then begin
++ res := res + three_sixty_deg;
++ turns := turns - unity;
++ end;
++ end;
++ p := link(p);
++ until p=c;
++ new_turn_cycles := turns;
++end;
++exit:
++selector:=old_setting;
++end;
++
+
+ @ This code is based on Bogus\l{}av Jackowski's
+ |emergency_turningnumber| macro, with some minor changes by Taco
+@@ -17189,6 +17284,27 @@
+ end;
+
+ @ @=
++function turn_cycles_wrapper (@!c:pointer):scaled;
++ var nval,oval:scaled;
++ saved_t_o:scaled; {tracing_online saved }
++begin
++ nval := new_turn_cycles(c);
++ oval := turn_cycles(c);
++ if nval<>oval then begin
++ saved_t_o:=internal[tracing_online];
++ internal[tracing_online]:=unity;
++ begin_diagnostic;
++ print ("Warning: The turningnumber algorithms do not agree. The current computed value is ");
++ print_scaled(nval);
++ print(", but the 'connect-the-dots' algorithm returned ");
++ print_scaled(oval);
++ end_diagnostic(false);
++ internal[tracing_online]:=saved_t_o;
++ end;
++ turn_cycles_wrapper := nval;
++end;
++
++@ @=
+ function count_turns(@!c:pointer):scaled;
+ var @!p:pointer; {a knot in envelope spec |c|}
+ @!t:integer; {total pen offset changes counted}
+@@ -22673,7 +22789,7 @@
+ txy:=right_x(p);
+ tyy:=right_y(p);
+ if (x_coord(p)<>0)or(y_coord(p)<>0) then
+- begin print_ln; print_cmd("gsave ","q ");
++ begin print_nl(""); print_cmd("gsave ","q ");
+ ps_pair_out(x_coord(p),y_coord(p));
+ ps_print("translate ");@/
+ txx:=txx-x_coord(p);
+@@ -23046,9 +23162,7 @@
+ @ @=
+ t:=link(spec_head);
+ while t<>null do
+- begin if length(value(t))<=emergency_line_length then print(value(t))
+- else overflow("output line length",emergency_line_length);
+-@:MetaPost capacity exceeded output line length}{\quad output line length@>
++ begin print(value(t));
+ print_ln;
+ t:=link(t);
+ end;
+@@ -23696,11 +23810,13 @@
+ end;
+ end;
+ if internal[mpprocset]>0 then begin
++ print_nl("%%BeginResource: procset mpost");
+ if (internal[prologues]>0)and(ldf<>null_font) then
+ print("/bd{bind def}bind def/fshow {exch findfont exch scalefont setfont show}bd")
+ else
+ print_nl("/bd{bind def}bind def");
+ @;
++ print_nl("%%EndResource");
+ print_ln;
+ end;
+ end
+Index: texlive-bin-2007/build/source/texk/web2c/mpdir/Makefile.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/mpdir/Makefile.in 2007-10-04 10:23:23.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/mpdir/Makefile.in 2007-10-04 10:24:35.000000000 +0200
+@@ -14,7 +14,7 @@
+
+ XCPPFLAGS=-I.. -I$(srcdir)/.. -I../.. -I$(srcdir)/../..
+
+-OBJS = mapfile.o avl.o avlstuff.o utils.o writeenc.o writet1.o writefont.o
++OBJS = mapfile.o avl.o avlstuff.o utils.o writeenc.o writet1.o writefont.o turningnumber.o
+
+ all: libmpost.a makecpool
+
+@@ -34,7 +34,7 @@
+ depend:
+ rm -f $(OBJS)
+ XXCFLAGS=-MM XCFLAGS=-MM $(MAKE) -k $(OBJS) | \
+- grep -v "^$(CC)\|$(CXX)\|$(AR)\|make\|klibtool" | \
++ grep -v "^$(CC)\|$(CXX)\|$(AR)\|make" | \
+ sed 's: [^ ]*/\.\./libs/[^ ]*::g' > $(srcdir)/depend.mk
+
+ kpse_include mpdir/depend.mk
+Index: texlive-bin-2007/build/source/texk/web2c/mpdir/mp.defines
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/mpdir/mp.defines 2007-10-04 10:23:28.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/mpdir/mp.defines 2007-10-04 10:24:35.000000000 +0200
+@@ -54,4 +54,4 @@
+
+ { function from turningnumber.c }
+
+-@define function bezierslope();
+\ No newline at end of file
++@define function bezierslope();
+Index: texlive-bin-2007/build/source/texk/web2c/mpdir/mplib.h
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/mpdir/mplib.h 2007-10-04 10:23:32.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/mpdir/mplib.h 2007-10-04 10:24:35.000000000 +0200
+@@ -297,4 +297,8 @@
+ extern void avlputobj (integer, integer);
+ extern integer avlfindobj (integer, integer, integer);
+
++/* turningnumber.c */
++
++extern angle bezierslope(integer,integer,integer,integer,integer,integer,integer,integer,int);
++
+ #endif /* MPOSTLIB */
+Index: texlive-bin-2007/build/source/texk/web2c/mpdir/turningnumber.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ texlive-bin-2007/build/source/texk/web2c/mpdir/turningnumber.c 2007-10-04 10:24:35.000000000 +0200
+@@ -0,0 +1,113 @@
++/* $Id$ */
++
++#include "mplib.h"
++
++#define bezier_error (720<<20)+1
++
++#define sign(v) ((v)>0 ? 1 : ((v)<0 ? -1 : 0 ))
++
++#define print_roots(a) { if (debuglevel>(65536*2)) \
++ fprintf(stdout,"bezierslope(): %s, i=%f, o=%f, angle=%f\n", \
++ (a),in,out,res); }
++
++#define out ((double)(xo>>20))
++#define mid ((double)(xm>>20))
++#define in ((double)(xi>>20))
++
++#define divisor (256*256)
++
++#define double2angle(a) (int)floor(a*256.0*256.0*16.0)
++
++angle
++bezierslope(integer AX,integer AY,integer BX,integer BY,
++ integer CX,integer CY,integer DX,integer DY, int debuglevel) {
++ double a, b, c;
++ integer deltax,deltay;
++ double ax,ay,bx,by,cx,cy,dx,dy;
++
++ angle xi = 0, xo = 0, xm = 0;
++ double res = 0;
++
++ ax=AX/divisor; ay=AY/divisor;
++ bx=BX/divisor; by=BY/divisor;
++ cx=CX/divisor; cy=CY/divisor;
++ dx=DX/divisor; dy=DY/divisor;
++
++ deltax = (BX-AX); deltay = (BY-AY);
++ if (deltax==0 && deltay == 0) { deltax=(CX-AX); deltay=(CY-AY); }
++ if (deltax==0 && deltay == 0) { deltax=(DX-AX); deltay=(DY-AY); }
++ xi = anangle(deltax,deltay);
++
++ deltax = (CX-BX); deltay = (CY-BY);
++ xm = anangle(deltax,deltay);
++
++ deltax = (DX-CX); deltay = (DY-CY);
++ if (deltax==0 && deltay == 0) { deltax=(DX-BX); deltay=(DY-BY); }
++ if (deltax==0 && deltay == 0) { deltax=(DX-AX); deltay=(DY-AY); }
++ xo = anangle(deltax,deltay);
++
++ a = (bx-ax)*(cy-by) - (cx-bx)*(by-ay); /* a = (bp-ap)x(cp-bp); */
++ b = (bx-ax)*(dy-cy) - (by-ay)*(dx-cx);; /* b = (bp-ap)x(dp-cp);*/
++ c = (cx-bx)*(dy-cy) - (dx-cx)*(cy-by); /* c = (cp-bp)x(dp-cp);*/
++
++ if (debuglevel>(65536*2)) {
++ fprintf(stdout,
++ "bezierslope(): (%.2f,%.2f),(%.2f,%.2f),(%.2f,%.2f),(%.2f,%.2f)\n",
++ ax,ay,bx,by,cx,cy,dx,dy);
++ fprintf(stdout,"bezierslope(): a,b,c,b^2,4ac: (%.2f,%.2f,%.2f,%.2f,%.2f)\n",a,b,c,b*b,4*a*c);
++ }
++
++ if ((a==0)&&(c==0)) {
++ res = out-in; /* ? */
++ print_roots("no roots (a)");
++ } else if ((a==0)||(c==0)) {
++ if ((sign(b) == sign(a)) || (sign(b) == sign(c))) {
++ res = out-in; /* ? */
++ if (res<-180.0)
++ res += 360.0;
++ else if (res>180.0)
++ res -= 360.0;
++ print_roots("no roots (b)");
++ } else {
++ res = out-in; /* ? */
++ print_roots("one root (a)");
++ }
++ } else if ((sign(a)*sign(c))<0) {
++ res = out-in; /* ? */
++ if (res<-180.0)
++ res += 360.0;
++ else if (res>180.0)
++ res -= 360.0;
++ print_roots("one root (b)");
++ } else {
++ if (sign(a) == sign(b)) {
++ res = out-in; /* ? */
++ if (res<-180.0)
++ res += 360.0;
++ else if (res>180.0)
++ res -= 360.0;
++ print_roots("no roots (d)");
++ } else {
++ if ((b*b) == (4*a*c)) {
++ res = bezier_error;
++ /* print_roots("double root"); *//* cusp */
++ } else if ((b*b) < (4*a*c)) {
++ res = out-in; /* ? */
++ if (res<=0.0 &&res>-180.0)
++ res += 360.0;
++ else if (res>=0.0 && res<180.0)
++ res -= 360.0;
++ print_roots("no roots (e)");
++ } else {
++ res = out-in;
++ if (res<-180.0)
++ res += 360.0;
++ else if (res>180.0)
++ res -= 360.0;
++ print_roots("two roots"); /* two inflections */
++ }
++ }
++ }
++ return double2angle(res);
++}
++
+Index: texlive-bin-2007/build/source/texk/web2c/mpware/dmp.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/mpware/dmp.c 2007-10-04 10:23:50.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/mpware/dmp.c 2007-10-04 10:24:35.000000000 +0200
+@@ -23,8 +23,8 @@
+ * gets modified.
+ */
+
+-char *banner = "% Written by DMP, Version 0.992"; /* first line of output */
+-char *term_banner = "This is DMP, Version 0.992";
++char *banner = "% Written by DMP, Version 1.000"; /* first line of output */
++char *term_banner = "This is DMP, Version 1.000";
+
+ #include
+ #include
+Index: texlive-bin-2007/build/source/texk/web2c/mpware/makempx.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/mpware/makempx.c 2007-10-04 10:23:55.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/mpware/makempx.c 2007-10-04 10:24:35.000000000 +0200
+@@ -95,7 +95,7 @@
+ #define GETCWD getcwd
+ #endif
+
+-#define version "0.993"
++#define version "1.000"
+
+ #define ERRLOG "mpxerr.log"
+ #define TEXERR "mpxerr.tex"
+Index: texlive-bin-2007/build/source/texk/web2c/mpware/mpto.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/mpware/mpto.c 2007-10-04 10:24:00.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/mpware/mpto.c 2007-10-04 10:24:35.000000000 +0200
+@@ -386,7 +386,7 @@
+ exit(0);
+ } else if (argc > 1 && (strcmp(argv[1], "--version") == 0
+ || strcmp(argv[1], "-version") == 0)) {
+- printf("mpto 0.992\n\
++ printf("mpto 1.000\n\
+ This program is in the public domain.\n\
+ Primary author of mpto: John Hobby.\n\
+ Current maintainer: Taco Hoekwater.\n");
+Index: texlive-bin-2007/build/source/texk/web2c/mpware/newer.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/mpware/newer.c 2007-10-04 10:24:03.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/mpware/newer.c 2007-10-04 10:24:35.000000000 +0200
+@@ -87,7 +87,7 @@
+ } else if (strcmp(argv[1], "-version") == 0 ||
+ strcmp(argv[1], "--version") == 0) {
+
+- fputs("newer 0.992\n\
++ fputs("newer 1.000\n\
+ This program is in the public domain.\n\
+ Primary author of newer: John Hobby.\n\
+ Current maintainer: Taco Hoekwater.\n", stdout);
--- texlive-bin-2007.dfsg.1.orig/debian/patches/50_fmtutil_deb
+++ texlive-bin-2007.dfsg.1/debian/patches/50_fmtutil_deb
@@ -0,0 +1,144 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 50_fmtutil_deb.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: debianize fmtutil, updmap etc, taken from tetex
+
+@DPATCH@
+ build/source/texk/tetex/fmtutil | 23 ++++++-----------------
+ texmf/doc/man/man1/fmtutil.1 | 38 ++++++++++++++++++++++++++++----------
+ 2 files changed, 34 insertions(+), 27 deletions(-)
+
+Index: texlive-bin-2007/texmf/doc/man/man1/fmtutil.1
+===================================================================
+--- texlive-bin-2007.orig/texmf/doc/man/man1/fmtutil.1 2007-06-20 15:21:14.000000000 +0200
++++ texlive-bin-2007/texmf/doc/man/man1/fmtutil.1 2007-06-20 15:21:16.000000000 +0200
+@@ -1,4 +1,4 @@
+-.TH "fmtutil" "8" "February 2005" "teTeX" "teTeX"
++.TH "fmtutil" "1" "February 2005" "teTeX" "teTeX"
+ .PP
+ .SH "NAME"
+ fmtutil \- utility for maintaining TeX format files
+@@ -20,21 +20,36 @@
+ .PP
+ .IP "\fB--all\fP"
+ recreate all format files
+-.IP "\fB--byfmt\fP \fIformatname\fP"
++.IP "\fB--missing\fP"
++create any missing format files
++.IP "\fB--refresh\fP"
++recreate only existing format files
++.IP "\fB--byfmt\fP \fIformatname\fP"
+ (re)create the format for
+ format \fIformatname\fP
+-.IP "\fB--byhyphen\fP \fIhyphenfile\fP"
++.IP "\fB--byhyphen\fP \fIhyphenfile\fP"
+ (re)create formats that
+ depend on the hyphenation file
+ \fIhyphenfile\fP
+-.IP "\fB--help\fP"
+-print a summary of commands and options
+-.IP "\fB--missing\fP"
+-create any missing format files
+-.IP "\fB--showhyphen\fP \fIformatname\fP"
++.IP "\fB--enablefmt\fP \fIformatname\fP"
++enable formatname in config file
++.IP "\fB--disablefmt\fP \fIformatname\fP"
++disable formatname in config file
++.IP "\fB--listcfg\fP"
++list (enabled and disabled) configurations, filtered to available
++formats
++.IP "\fB--catcfg\fP"
++output the content of the config file
++.IP "\fB--showhyphen\fP \fIformatname\fP"
+ print the name of the
+ hyphenation file for the format
+ \fIformatname\fP
++.IP "\fB--edit\fP"
++edit fmtutil.cnf file (disabled in Debian)
++.IP "\fB--version\fP"
++show version info
++.IP "\fB--help\fP"
++print a summary of commands and options
+ .PP
+ .SH "OPTIONS"
+ .PP
+@@ -56,12 +71,15 @@
+ .PP
+ .SH "FILES"
+ .PP
+-.IP "\fIfmtutil\&.cnf\fP"
++.IP "\fIfmtutil\&.cnf\fP"
+ default configuration file
++.IP "\fI/etc/texmf/fmt.d/\fP"
++Debian-specific directory for configuration file snippets
+ .PP
+ .SH "SEE ALSO"
+ .PP
+-\fBkpsewhich\fP(1)
++\fBkpsewhich\fP(1),
++\fBupdate-fmtutil\fP(1)
+ .PP
+ Web page:
+ .PP
+Index: texlive-bin-2007/build/source/texk/tetex/fmtutil
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/tetex/fmtutil 2007-06-20 15:21:14.000000000 +0200
++++ texlive-bin-2007/build/source/texk/tetex/fmtutil 2007-06-20 15:33:51.000000000 +0200
+@@ -478,7 +478,8 @@
+ cleanup $?
+ ;;
+ edit)
+- ${VISUAL-${EDITOR-vi}} $cnf_file
++ # defined by debianize-fmtutil
++ debianEditWarnAndShow
+ ;;
+ enablefmt|disablefmt)
+ $cmd $arg
+@@ -493,22 +494,6 @@
+ ;;
+ esac
+
+- if test -n "$cfgmaint"; then
+- if test -z "$cfgparam"; then
+- ci=`tcfmgr --tmp $tmpdir --cmd ci --id $id`
+- if test $? = 0; then
+- if test -n "$ci"; then
+- verboseMsg "$progname: configuration file updated: \`$ci'"
+- else
+- verboseMsg "$progname: configuration file unchanged."
+- fi
+- else
+- abort "failed to update configuration file."
+- fi
+- fi
+- cleanup $?
+- fi
+-
+ # set up destdir:
+ if test -z "$destdir"; then
+ : ${MT_TEXMFVAR=`kpsewhich -var-value=TEXMFVAR`}
+@@ -859,6 +844,7 @@
+ ###############################################################################
+ # disablefmt(format)
+ # disables format in configuration file
++# [ redefined by debianize-fmtutil ]
+ ###############################################################################
+ disablefmt()
+ {
+@@ -875,6 +861,7 @@
+ ###############################################################################
+ # enablefmt(format)
+ # enables format in configuration file
++# [ redefined by debianize-fmtutil ]
+ ###############################################################################
+ enablefmt()
+ {
+@@ -887,5 +874,7 @@
+ (exit 0); return 0
+ }
+
++. /usr/share/texlive-bin/debianize-fmtutil
++
+ main ${1+"$@"}
+ cleanup 0
--- texlive-bin-2007.dfsg.1.orig/debian/patches/30_libpoppler_0.4.5
+++ texlive-bin-2007.dfsg.1/debian/patches/30_libpoppler_0.4.5
@@ -0,0 +1,440 @@
+# 30_libpoppler.dpatch
+#
+# use libpoppler instead of libxpdf in pdfetex and xetex
+# don't build pdftosrc as it needs libpoppler from experimental
+
+@DPATCH@
+ build/source/configure | 6 +-
+ build/source/configure.in | 8 +--
+ build/source/texk/web2c/pdftexdir/Makefile.in | 2
+ build/source/texk/web2c/pdftexdir/depend.mk | 58 +------------------------
+ build/source/texk/web2c/pdftexdir/pdftex.mk | 9 ++-
+ build/source/texk/web2c/pdftexdir/pdftoepdf.cc | 43 +++++++++---------
+ build/source/texk/web2c/pdftexdir/pdftosrc.cc | 37 ++++++++-------
+ build/source/texk/web2c/pdftexdir/utils.c | 4 -
+ build/source/texk/web2c/xetexdir/XeTeX_ext.c | 4 -
+ build/source/texk/web2c/xetexdir/pdfimage.cpp | 24 ++++++++--
+ build/source/texk/web2c/xetexdir/xetex.mk | 8 ++-
+ 11 files changed, 87 insertions(+), 116 deletions(-)
+
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/depend.mk
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/depend.mk 2006-12-27 00:37:34.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/depend.mk 2007-04-16 15:30:03.000000000 +0200
+@@ -1,55 +1,5 @@
+-epdf.o: epdf.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-mapfile.o: mapfile.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-papersiz.o: papersiz.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h
+-utils.o: utils.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h \
+- ../../../libs/zlib/zlib.h ../../../libs/zlib/zconf.h \
+- ../../../libs/md5/md5.h pdftexextra.h \
+- ../../../libs/obsdcompat/openbsd-compat.h
+-vfpacket.o: vfpacket.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h
+-pkin.o: pkin.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writefont.o: writefont.c ../../../libs/xpdf/goo/gmem.h ptexlib.h \
+- ../pdftexd.h ../texmfmp.h ../cpascal.h ../config.h ../help.h \
+- ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writet1.o: writet1.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writet3.o: writet3.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writezip.o: writezip.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h ../../../libs/zlib/zlib.h ../../../libs/zlib/zconf.h
+-writeenc.o: writeenc.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h
+-writettf.o: writettf.c ptexlib.h writettf.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h macnames.c
+-writejpg.o: writejpg.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h image.h
+-writepng.o: writepng.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h image.h
+-writeimg.o: writeimg.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h image.h
+-pdftoepdf.o: pdftoepdf.cc ../../../libs/xpdf/xpdf/Object.h \
+- ../../../libs/xpdf/goo/gmem.h ../../../libs/xpdf/xpdf/Array.h \
+- ../../../libs/xpdf/xpdf/Dict.h ../../../libs/xpdf/xpdf/Stream.h \
+- ../../../libs/xpdf/xpdf/XRef.h ../../../libs/xpdf/xpdf/Catalog.h \
+- ../../../libs/xpdf/xpdf/Page.h ../../../libs/xpdf/xpdf/GfxFont.h \
+- ../../../libs/xpdf/xpdf/Error.h epdf.h
++pdftoepdf.o: pdftoepdf.cc epdf.h ../../kpathsea/c-auto.h \
++ ../../kpathsea/c-proto.h ../../web2c/c-auto.h ../../web2c/config.h \
++ ../../kpathsea/c-fopen.h ../../web2c/pdftexdir/ptexmac.h
+ ttf2afm.o: ttf2afm.c writettf.h macnames.c
+-pdftosrc.o: pdftosrc.cc ../../../libs/xpdf/xpdf/Object.h \
+- ../../../libs/xpdf/xpdf/Array.h ../../../libs/xpdf/xpdf/Dict.h \
+- ../../../libs/xpdf/xpdf/Stream.h ../../../libs/xpdf/xpdf/XRef.h \
+- ../../../libs/xpdf/xpdf/Catalog.h ../../../libs/xpdf/xpdf/Page.h \
+- ../../../libs/xpdf/xpdf/PDFDoc.h ../../../libs/xpdf/xpdf/Link.h \
+- ../../../libs/xpdf/xpdf/Error.h ../../../libs/xpdf/xpdf/config.h
++pdftosrc.o: pdftosrc.cc
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftoepdf.cc
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/pdftoepdf.cc 2006-12-27 00:37:34.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftoepdf.cc 2007-04-16 15:30:03.000000000 +0200
+@@ -26,25 +26,24 @@
+ #include
+ #include
+ #include
+-#include
+-#include
+-#include
+-#include
+-#include
+ #include
+-#include "Object.h"
+-#include "Stream.h"
+-#include "Array.h"
+-#include "Dict.h"
+-#include "XRef.h"
+-#include "Catalog.h"
+-#include "Link.h"
+-#include "Page.h"
+-#include "GfxFont.h"
+-#include "PDFDoc.h"
+-#include "GlobalParams.h"
+-#include "Error.h"
+-
++#include
++#include
++#include
++#include
++#include
++#include "poppler/Object.h"
++#include "poppler/Stream.h"
++#include "poppler/Array.h"
++#include "poppler/Dict.h"
++#include "poppler/XRef.h"
++#include "poppler/Link.h"
++#include "poppler/Catalog.h"
++#include "poppler/Page.h"
++#include "poppler/GfxFont.h"
++#include "poppler/PDFDoc.h"
++#include "poppler/GlobalParams.h"
++#include "poppler/Error.h"
+ #include "epdf.h"
+
+ // This file is mostly C and not very much C++; it's just used to interface
+@@ -169,7 +168,7 @@
+ fprintf(stderr, "\npdfTeX Debug: Creating %s (%d)\n", p->file_name,
+ p->occurences);
+ #endif
+- GString *docName = new GString(p->file_name);
++ GooString *docName = new GooString(p->file_name);
+ p->doc = new PDFDoc(docName); // takes ownership of docName
+ if (!p->doc->isOk() || !p->doc->okToPrint()) {
+ pdftex_fail("xpdf: reading PDF image failed");
+@@ -511,7 +510,7 @@
+ int i, l, c;
+ Ref ref;
+ char *p;
+- GString *s;
++ GooString *s;
+ if (obj->isBool()) {
+ pdf_printf("%s", obj->getBool()? "true" : "false");
+ } else if (obj->isInt()) {
+@@ -677,7 +676,7 @@
+ float pdf_version_found, pdf_version_wanted;
+ // initialize
+ if (!isInit) {
+- globalParams = new GlobalParams();
++ globalParams = new GlobalParams(NULL);
+ globalParams->setErrQuiet(gFalse);
+ isInit = gTrue;
+ }
+@@ -703,7 +702,7 @@
+ epdf_num_pages = pdf_doc->doc->getCatalog()->getNumPages();
+ if (page_name) {
+ // get page by name
+- GString name(page_name);
++ GooString name(page_name);
+ LinkDest *link = pdf_doc->doc->findDest(&name);
+ if (link == 0 || !link->isOk())
+ pdftex_fail("PDF inclusion: invalid destination <%s>", page_name);
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftosrc.cc
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/pdftosrc.cc 2006-12-27 00:37:34.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftosrc.cc 2007-04-16 15:30:03.000000000 +0200
+@@ -25,22 +25,23 @@
+ #include
+ #include
+ #include
+-#include
+ #include
+-#include
+-#include
+-#include
+-#include "Object.h"
+-#include "Stream.h"
+-#include "Array.h"
+-#include "Dict.h"
+-#include "XRef.h"
+-#include "Catalog.h"
+-#include "Page.h"
+-#include "GfxFont.h"
+-#include "PDFDoc.h"
+-#include "GlobalParams.h"
+-#include "Error.h"
++
++#include
++#include
++#include
++#include
++#include "poppler/Object.h"
++#include "poppler/Stream.h"
++#include "poppler/Array.h"
++#include "poppler/Dict.h"
++#include "poppler/XRef.h"
++#include "poppler/Catalog.h"
++#include "poppler/Page.h"
++#include "poppler/GfxFont.h"
++#include "poppler/PDFDoc.h"
++#include "poppler/GlobalParams.h"
++#include "poppler/Error.h"
+
+ static XRef *xref = 0;
+
+@@ -48,7 +49,7 @@
+ {
+ char *p, buf[1024];
+ PDFDoc *doc;
+- GString *fileName;
++ GooString *fileName;
+ Stream *s;
+ Object srcStream, srcName, catalogDict;
+ FILE *outfile;
+@@ -62,8 +63,8 @@
+ "Usage: pdftosrc []\n");
+ exit(1);
+ }
+- fileName = new GString(argv[1]);
+- globalParams = new GlobalParams();
++ fileName = new GooString(argv[1]);
++ globalParams = new GlobalParams(NULL);
+ doc = new PDFDoc(fileName);
+ if (!doc->isOk()) {
+ fprintf(stderr, "Invalid PDF file\n");
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/Makefile.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/Makefile.in 2006-12-27 00:37:34.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/Makefile.in 2007-04-16 15:30:03.000000000 +0200
+@@ -8,7 +8,7 @@
+ kpathsea_srcdir_parent = $(srcdir)/../..
+ kpathsea_dir_parent = ../..
+
+-ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir) -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent) @LIBXPDFCPPFLAGS@ -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATFSRCDIR) -I$(LIBOBSDCOMPATFSRCDIR)/..
++ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir) -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent) -I/usr/include/poppler -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATFSRCDIR) -I$(LIBOBSDCOMPATFSRCDIR)/..
+ CXX = @CXX@
+
+ .SUFFIXES: .cc .o
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftex.mk
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/pdftex.mk 2006-12-27 00:37:34.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftex.mk 2007-04-16 15:30:03.000000000 +0200
+@@ -2,6 +2,9 @@
+ # This fragment contains the parts of the makefile that are most likely to
+ # differ between releases of pdfeTeX.
+
++# use libpoppler instead of included xpdf code
++ADDLDFLAGS = -lpoppler
++
+ # We build pdftex
+ pdftex = @PETEX@ pdftex
+ pdftexdir = pdftexdir
+@@ -29,7 +32,7 @@
+
+ # Making pdftex
+ pdftex: pdftexd.h $(pdftex_o) $(pdftexextra_o) $(pdftexlibsdep)
+- @CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@
++ @CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@ $(ADDLDFLAGS)
+
+ # C file dependencies.
+ $(pdftex_c) pdftexcoerce.h pdftexd.h: pdftex.p $(web2c_texmf) $(srcdir)/$(pdftexdir)/pdftex.defines $(srcdir)/$(pdftexdir)/pdftex.h
+@@ -153,10 +156,10 @@
+ rm -f ttf2afm.c macnames.c
+ #
+ # pdftosrc
+-pdftosrc = pdftosrc
++pdftosrc =
+
+ pdftosrc: $(pdftexdir)/pdftosrc.o $(LIBXPDFDEP)
+- @CXXHACKLINK@ $(pdftexdir)/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@
++ @CXXHACKLINK@ $(pdftexdir)/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@ $(ADDLDFLAGS)
+ $(pdftexdir)/pdftosrc.o:$(srcdir)/$(pdftexdir)/pdftosrc.cc
+ cd $(pdftexdir) && $(MAKE) pdftosrc.o
+ check: pdftosrc-check
+Index: texlive-bin-2007/build/source/configure
+===================================================================
+--- texlive-bin-2007.orig/build/source/configure 2007-04-16 15:29:55.000000000 +0200
++++ texlive-bin-2007/build/source/configure 2007-04-16 15:30:03.000000000 +0200
+@@ -3459,9 +3459,9 @@
+
+ # we need libxpdf for pdf[ex]tex, xetex
+ test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no}
+-test "$with_pdftex" != no && : ${needs_libxpdf=yes}
+-test "$with_pdfetex" != no && : ${needs_libxpdf=yes}
+-test "$with_xetex" != no && : ${needs_libxpdf=yes}
++test "$with_pdftex" != no && : ${needs_libxpdf=no}
++test "$with_pdfetex" != no && : ${needs_libxpdf=no}
++test "$with_xetex" != no && : ${needs_libxpdf=no}
+ : ${needs_libxpdf=no}
+ export needs_libxpdf
+
+Index: texlive-bin-2007/build/source/configure.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/configure.in 2007-04-16 15:29:55.000000000 +0200
++++ texlive-bin-2007/build/source/configure.in 2007-04-16 15:30:03.000000000 +0200
+@@ -157,9 +157,9 @@
+
+ # we need libxpdf for pdf[ex]tex, xetex
+ test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no}
+-test "$with_pdftex" != no && : ${needs_libxpdf=yes}
+-test "$with_pdfetex" != no && : ${needs_libxpdf=yes}
+-test "$with_xetex" != no && : ${needs_libxpdf=yes}
++test "$with_pdftex" != no && : ${needs_libxpdf=no}
++test "$with_pdfetex" != no && : ${needs_libxpdf=no}
++test "$with_xetex" != no && : ${needs_libxpdf=no}
+ : ${needs_libxpdf=no}
+ export needs_libxpdf
+
+@@ -207,7 +207,7 @@
+ sinclude(libs/libpng/libpng.ac)
+ sinclude(libs/zlib/zlib.ac)
+ sinclude(libs/ncurses/ncurses.ac)
+-sinclude(libs/xpdf/libxpdf.ac)
++#sinclude(libs/xpdf/libxpdf.ac)
+ sinclude(libs/t1lib/t1lib.ac)
+ sinclude(libs/gd/gd.ac)
+ sinclude(libs/freetype/freetype.ac)
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_ext.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/XeTeX_ext.c 2007-01-15 14:04:36.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_ext.c 2007-04-16 15:30:03.000000000 +0200
+@@ -33,7 +33,7 @@
+ */
+
+ #ifdef XETEX_OTHER
+-#include "xpdf/config.h"
++#include "poppler/poppler-config.h"
+ #include "png.h"
+ #endif
+
+@@ -194,7 +194,7 @@
+ #else
+ "Compiled with fontconfig version %d.%d.%d; using %d.%d.%d\n"
+ "Compiled with libpng version %s; using %s\n"
+- "Compiled with xpdf version %s\n"
++ "Compiled with libpoppler version %s\n"
+ #endif
+ ;
+
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/pdfimage.cpp
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/pdfimage.cpp 2006-12-09 11:29:12.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/pdfimage.cpp 2007-04-16 15:30:03.000000000 +0200
+@@ -11,10 +11,24 @@
+
+ #include "pdfimage.h"
+
+-#include "PDFDoc.h"
+-#include "Catalog.h"
+-#include "Page.h"
+-#include "GString.h"
++#include
++#include
++#include
++#include
++#include
++#include "poppler/Object.h"
++#include "poppler/Stream.h"
++#include "poppler/Array.h"
++#include "poppler/Dict.h"
++#include "poppler/XRef.h"
++#include "poppler/Link.h"
++#include "poppler/Catalog.h"
++#include "poppler/Page.h"
++#include "poppler/GfxFont.h"
++#include "poppler/PDFDoc.h"
++#include "poppler/GlobalParams.h"
++#include "poppler/Error.h"
++
+
+ #include "XeTeX_ext.h"
+
+@@ -28,7 +42,7 @@
+ int
+ pdf_get_rect(char* filename, int page_num, int pdf_box, realrect* box)
+ {
+- GString* name = new GString(filename);
++ GooString* name = new GooString(filename);
+ PDFDoc* doc = new PDFDoc(name);
+
+ if (!doc) {
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex.mk
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/xetex.mk 2007-01-20 13:44:35.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex.mk 2007-04-16 15:30:03.000000000 +0200
+@@ -4,6 +4,10 @@
+
+ Makefile: $(srcdir)/xetexdir/xetex.mk
+
++# use libpoppler instead of included xpdf code
++ADDLDFLAGS = -lpoppler
++
++
+ # We build xetex unless configure decides to skip it
+ xetex = @XETEX@ xetex
+
+@@ -29,7 +33,7 @@
+
+ @XETEX_GENERIC@ XETEX_DEFINES = -DXETEX_OTHER
+
+-@XETEX_GENERIC@ EXTRALIBS = @LDLIBXPDF@ @LDLIBPNG@ @LDFONTCONFIG@
++@XETEX_GENERIC@ EXTRALIBS = @LDLIBXPDF@ @LDLIBPNG@ @LDFONTCONFIG@ $(ADDLDFLAGS)
+
+ @XETEX_GENERIC@ EXTRADEPS = @LIBXPDFDEP@ @LIBPNGDEP@
+
+@@ -144,7 +148,7 @@
+ $(compile) $(ALL_CFLAGS) $(LIBPNGCPPFLAGS) $(ZLIBCPPFLAGS) -c $< -o $@
+
+ pdfimage.o: $(srcdir)/xetexdir/pdfimage.cpp $(srcdir)/xetexdir/pdfimage.h
+- $(CXX) $(ALL_CFLAGS) $(LIBXPDFCPPFLAGS) -c $< -o $@
++ $(CXX) $(ALL_CFLAGS) $(LIBXPDFCPPFLAGS) -I/usr/include/poppler -c $< -o $@
+
+ XeTeX_pic.o: $(srcdir)/xetexdir/XeTeX_pic.c $(srcdir)/xetexdir/XeTeX_ext.h $(XeTeXImageHdrs)
+ $(compile) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/utils.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/utils.c 2007-01-01 18:20:03.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/utils.c 2007-04-16 15:30:03.000000000 +0200
+@@ -37,7 +37,7 @@
+ #include "zlib.h"
+ #include "ptexlib.h"
+ #include "png.h"
+-#include "xpdf/config.h" /* just to get the xpdf version */
++#include "poppler/poppler-config.h" /* just to get the xpdf version */
+
+ #define check_nprintf(size_get, size_want) \
+ if ((unsigned)(size_get) >= (unsigned)(size_want)) \
+@@ -1261,7 +1261,7 @@
+ (void) asprintf(versions,
+ "Compiled with libpng %s; using libpng %s\n"
+ "Compiled with zlib %s; using zlib %s\n"
+- "Compiled with xpdf version %s\n",
++ "Compiled with libpoppler version %s\n",
+ PNG_LIBPNG_VER_STRING, png_libpng_ver,
+ ZLIB_VERSION, zlib_version, xpdfVersion);
+ }
--- texlive-bin-2007.dfsg.1.orig/debian/patches/56_updmap_deb
+++ texlive-bin-2007.dfsg.1/debian/patches/56_updmap_deb
@@ -0,0 +1,138 @@
+Index: texlive-bin-2007/texmf/doc/man/man1/updmap.1
+===================================================================
+--- texlive-bin-2007.orig/texmf/doc/man/man1/updmap.1 2006-05-15 20:16:32.000000000 +0200
++++ texlive-bin-2007/texmf/doc/man/man1/updmap.1 2007-06-11 14:18:40.000000000 +0200
+@@ -32,11 +32,20 @@
+ line, \fBupdmap\fP will write generated map files to a directory of
+ your choosing (via one of the \fB--*outputdir\fP options), or automatically
+ determine where to place the files\&. In the latter case, it tries to
+-use the tree where the variable TEXMFVAR points to.
++use the tree where the variable TEXMFVAR -- or TEXMFSYSVAR if called
++as \fBupdmap-sys\fP -- points to.
++.PP
+ When used with the options \fB--edit\fP, \fB--setoption\fP,
+-\fB--enable\fP, \fB--disable\fP, or \fB--syncwithtrees\fP, \fBupdmap\fP will first write
+-\fBupdmap\&.cfg\fP(5) and regenerate the map files only if this file
+-has been changed\&.
++\fB--enable\fP, \fB--disable\fP, or \fB--syncwithtrees\fP,
++\fBupdmap\fP will first write \fBupdmap\&.cfg\fP(5) and regenerate the
++map files only if this file has been changed\&. In Debian, updmap has
++been adapted so that \fB--enable\fP and \fB--disable\fP do the "right
++thing": change the configuration snippets in \fIupdmap.d\fP instead,
++call \fBupdate-updmap\fP(1) to regenerate \fBupdmap\&.cfg\fP(5) and
++regenerate the map files afterwards. There are some limitations,
++though: \fBupdmap\fP will regenerate the map files even if
++\fBupdmap\&.cfg\fP(5) has not been changed, and \fB--edit\fP and
++\fB--syncwithtrees\fP cannot be used.
+ .PP
+ .SH "OPTIONS"
+ .PP
+@@ -98,10 +107,10 @@
+ \fBdvipdfmDownloadBase14\fP
+ .IP
+ .IP "\fB--enable\fP \fImaptype\fP \fImapfile\fP"
+-Add or enable a \fBMap\fP or \fBMixedMap\fP for \fImapfile\fP\&.
++Permanently add or enable a \fBMap\fP or \fBMixedMap\fP for \fImapfile\fP\&.
+ .IP
+ .IP "\fB--enable Map=\fImapfile\fP"
+-Add or enable a Map for \fImapfile\fP\&.
++Permanently add or enable a Map for \fImapfile\fP\&.
+ .IP
+ .IP "\fB--enable MixedMap=\fP\fImapfile\fP"
+ Add or enable a MixedMap for \fImapfile\fP\&.
+@@ -126,7 +135,9 @@
+ .IP "\fIupdmap\&.cfg\fP"
+ Main configuration file\&. In
+ \fItexmf/web2c\fP by default, but may be located elsewhere
+-depending on your distribution\&.
++depending on your distribution\&. \fBNote for Debian\fP: On Debian
+++ that file is generated out of files in \fI/etc/texmf/updmap.d\fP.
+++ See \fBupdate-updmap\fP(8) or the \fITeX-on-Debian\fP document.
+ .IP
+ .IP "\fIdvips35\&.map\fP"
+ Map file for standard 35 PostScript fonts for
+@@ -240,7 +251,7 @@
+ .PP
+ .SH "SEE ALSO"
+ .PP
+-\fBupdmap\&.cfg\fP(5), \fBdvipdfm\fP(1), \fBdvips\fP(1),
++\fBupdmap\&.cfg\fP(5), \fBupdate-updmap\fP(8), \fBdvipdfm\fP(1), \fBdvips\fP(1),
+ \fBgsftopk\fP(1), \fBpdftex\fP(1), \fBps2pk\fP(1),
+ \fBtexhash\fP(1), \fBxdvi\fP(1)\&.
+ .PP
+Index: texlive-bin-2007/build/source/texk/tetex/updmap
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/tetex/updmap 2006-12-25 19:43:31.000000000 +0100
++++ texlive-bin-2007/build/source/texk/tetex/updmap 2007-06-11 15:05:43.000000000 +0200
+@@ -325,6 +325,8 @@
+ # sets option to value in the config file (replacing the existing setting
+ # or by adding a new line to the config file).
+ ###############################################################################
++# for Debian, this is superseded by a function defined in debianize-updmap
++# (see below)
+ setOption()
+ {
+ opt=$1
+@@ -359,6 +361,8 @@
+ # enableMap (type, map)
+ # enables an entry in the config file for map with a given type.
+ ###############################################################################
++# for Debian, this is superseded by a function defined in debianize-updmap
++# (see below)
+ enableMap()
+ {
+ case $1 in
+@@ -381,6 +385,8 @@
+ # disableMap (map)
+ # disables map in config file (any type)
+ ###############################################################################
++# for Debian, this is superseded by a function defined in debianize-updmap
++# (see below)
+ disableMap()
+ {
+ #mapType=`awk '($1 == "MixedMap" || $1 == "Map") && $2 == map { print $1 }' \
+@@ -734,12 +740,8 @@
+ !!! ERROR! The map file \`$2' has not been found at all.
+
+ Either put this file into the right place or remove the
+- reference from the configuration file. An automatic way
+- to disable unavailable map files is to call
+- $progname --syncwithtrees
+-
+- For manual editing, call
+- $progname --edit
++ reference from the configuration files - see
++ update-updmap(1).
+ "
+
+ false; return 1
+@@ -1037,6 +1039,8 @@
+ # update the config file: uncomment all lines which refer to map files that
+ # are unavailabe in the texmf trees
+ ###############################################################################
++# for Debian, this is superseded by a function defined in debianize-updmap
++# (see below)
+ syncWithTrees()
+ {
+ for i in `egrep '^(Mixed)?Map' "$cnfFile" | sed 's@.* @@'`; do
+@@ -1050,6 +1054,11 @@
+ }
+
+ ###############################################################################
++# source Debian-specific changes, superseding the last three functions
++###############################################################################
++. /usr/share/tex-common/debianize-updmap
++
++###############################################################################
+ # normalizeLines()
+ # remove comments, whitespace is exactly one space, no empty lines,
+ # no whitespace at end of line, one space before and after ",
+@@ -1341,7 +1350,7 @@
+
+ case "$cmd" in
+ edit)
+- ${VISUAL-${EDITOR-vi}} "$cnfFile";;
++ debianEditWarnAndShow;;
+ setoption)
+ setOption "$setoptionOpt" "$setoptionVal";;
+ enable)
--- texlive-bin-2007.dfsg.1.orig/debian/patches/32_dvips_fontbug_fix_upstream
+++ texlive-bin-2007.dfsg.1/debian/patches/32_dvips_fontbug_fix_upstream
@@ -0,0 +1,896 @@
+---
+ build/source/texk/dvipsk/ChangeLog | 36 +++++++++++++++++++
+ build/source/texk/dvipsk/Makefile.in | 2 -
+ build/source/texk/dvipsk/afm2tfm.c | 6 +--
+ build/source/texk/dvipsk/afm2tfm.rc | 34 ------------------
+ build/source/texk/dvipsk/bbox.c | 2 -
+ build/source/texk/dvipsk/config.h | 2 -
+ build/source/texk/dvipsk/crop.lpro | 2 -
+ build/source/texk/dvipsk/debug.h | 2 -
+ build/source/texk/dvipsk/download.c | 25 +++++++++----
+ build/source/texk/dvipsk/dpicheck.c | 6 +--
+ build/source/texk/dvipsk/dvips.1 | 25 ++++++++-----
+ build/source/texk/dvipsk/dvips.c | 61 +++++++++++++++++++++++++++------
+ build/source/texk/dvipsk/dvips.h | 14 ++-----
+ build/source/texk/dvipsk/emspecial.c | 15 ++++++--
+ build/source/texk/dvipsk/finclude.c | 11 +++++
+ build/source/texk/dvipsk/finclude.lpro | 1
+ build/source/texk/dvipsk/flib.c | 2 -
+ build/source/texk/dvipsk/header.c | 4 +-
+ build/source/texk/dvipsk/hps.c | 4 +-
+ build/source/texk/dvipsk/hps.lpro | 5 +-
+ build/source/texk/dvipsk/loadfont.c | 11 +++++
+ build/source/texk/dvipsk/makefont.c | 6 +--
+ build/source/texk/dvipsk/output.c | 11 +++++
+ build/source/texk/dvipsk/papersiz.c | 2 -
+ build/source/texk/dvipsk/paths.h | 2 -
+ build/source/texk/dvipsk/psfonts.map | 1
+ build/source/texk/dvipsk/resident.c | 24 +++++++++++-
+ build/source/texk/dvipsk/special.lpro | 5 +-
+ build/source/texk/dvipsk/squeeze.c | 5 --
+ build/source/texk/dvipsk/tex.lpro | 2 +
+ build/source/texk/dvipsk/texc.script | 2 -
+ build/source/texk/dvipsk/texps.lpro | 2 -
+ 32 files changed, 220 insertions(+), 112 deletions(-)
+
+Index: texlive-bin-2007/build/source/texk/dvipsk/ChangeLog
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/ChangeLog 2007-05-07 01:17:36.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/ChangeLog 2007-05-07 01:38:37.000000000 +0200
+@@ -1,3 +1,39 @@
++2007-05-06 Karl Berry
++
++ * finclude.c, dvips.c: keep track of last-unused psname (Akira).
++ * dvips.c (DEFRES): move down.
++ * dvips.c (--help): just mention Tom R.
++
++2007-05-05 Karl Berry
++
++ * dvips.h (DOWNLOADEDPSSIZE): new constant.
++ * dvips.c (downloadedpsname): new global array.
++ * finclude.c: set it up as we download.
++ * download.c: use it to avoid downloading fonts as both header
++ and font. (From Akira.)
++
++2007-05-04 Karl Berry
++
++ * dvips.h (BANNER): change to 5.96dev to distinguish from the release.
++
++ * header.c (add_name, add_header): cast result of
++ add_header_general to int and return it. From Akira.
++
++2007-03-23 Karl Berry
++
++ * dvips.texi: document it.
++ * dvips.c, loadfont.c, resident.c: also report map files
++ and config files, if the envvar DVIPSDEBUG is set. From Akira.
++
++2007-03-20 Karl Berry
++
++ * download.c, output.c, emspecial.c: report full pathnames,
++ to help debugging and for consistency with TeX. From Akira.
++
++2007-03-19 Karl Berry
++
++ * config.ps (screen): add this, 8.25x11, for powerdot. (From Akira.)
++
+ 2006-12-09 Karl Berry
+
+ * dvips.texi (Config file paper sizes): best match now. (From Akira.)
+Index: texlive-bin-2007/build/source/texk/dvipsk/Makefile.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/Makefile.in 2007-05-07 01:38:11.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/Makefile.in 2007-05-07 01:38:37.000000000 +0200
+@@ -1,5 +1,5 @@
+ # Makefile for dvipsk -- kb@mail.tug.org. Public domain.
+-version = 5.96
++version = 5.96.1
+
+ # Add -DDEFRES=dpi to DEFS to change the default resolution from 600.
+ # Add -DSECURE if you will install dvips with special privileges.
+Index: texlive-bin-2007/build/source/texk/dvipsk/afm2tfm.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/afm2tfm.c 2007-05-07 01:17:54.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/afm2tfm.c 2007-05-07 01:38:37.000000000 +0200
+@@ -1489,15 +1489,15 @@
+ void version P1C(FILE *, f)
+ {
+ extern KPSEDLL char *kpathsea_version_string;
+- fputs ("afm2tfm(k) (dvips(k) 5.96) 8.1\n", f);
++ fputs ("afm2tfm(k) (dvips(k) 5.96.1) 8.1\n", f);
+ fprintf (f, "%s\n", kpathsea_version_string);
+- fputs ("Copyright (C) 2005 Radical Eye Software.\n\
++ fputs ("Copyright (C) 2007 Radical Eye Software.\n\
+ There is NO warranty. You may redistribute this software\n\
+ under the terms of the GNU General Public License\n\
+ and the Dvips copyright.\n\
+ For more information about these matters, see the files\n\
+ named COPYING and afm2tfm.c.\n\
+-Primary author of afm2tfm: T. Rokicki; -k maintainer: K. Berry.\n", f);
++Original author of afm2tfm: T. Rokicki.\n", f);
+ }
+
+ #define USAGE "\
+Index: texlive-bin-2007/build/source/texk/dvipsk/afm2tfm.rc
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/afm2tfm.rc 2007-05-07 01:38:11.000000000 +0200
++++ /dev/null 1970-01-01 00:00:00.000000000 +0000
+@@ -1,34 +0,0 @@
+-/* afm2tfm.rc: afm2tfm resources -*- C++ -*-
+-
+- Copyright (C) 1996-2003 Fabrice Popineau
+-
+- This file is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published
+- by the Free Software Foundation; either version 2, or (at your
+- option) any later version.
+-
+- This file is distributed in the hope that it will be useful, but
+- WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- General Public License for more details.
+-
+- You should have received a copy of the GNU General Public License
+- along with this file; if not, write to the Free Software
+- Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+- USA. */
+-
+-#include
+-
+-#define VER_FILEVERSION TEXLIVE_MAJOR_VERSION,TEXLIVE_MINOR_VERSION,TEXLIVE_BETA_NUMBER,TEXLIVE_ALPHA_NUMBER
+-#define VER_FILEVERSION_STR TEXLIVE_PRODUCTVERSION_STR " afm2tfm(k) (dvips(k) 5.94b) 8.1"
+-
+-#define VER_INTERNALNAME_STR "afm2tfm"
+-#define VER_ORIGINALFILENAME_STR "afm2tfm.exe"
+-
+-#define VER_LEGALCOPYRIGHT_STR "Copyright (C) 1990-2004 Radical Eye Software"
+-
+-#define VER_FILEDESCRIPTION_STR "Adobe Font Metric to TeX Font Metric file converter"
+-
+-#include
+-
+-/* afm2tfm.rc ends here */
+Index: texlive-bin-2007/build/source/texk/dvipsk/bbox.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/bbox.c 2007-05-07 01:38:11.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/bbox.c 2007-05-07 01:38:37.000000000 +0200
+@@ -6,7 +6,7 @@
+ * If you request an EPSF file and specify -a, you may end up
+ * processing a single page four times!
+ */
+-#include "dvips.h"
++#include "dvips.h" /* The copyright notice in that file is included too! */
+ #include
+ #include "protos.h"
+
+Index: texlive-bin-2007/build/source/texk/dvipsk/config.h
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/config.h 2007-05-07 01:38:11.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/config.h 2007-05-07 01:38:37.000000000 +0200
+@@ -1,5 +1,5 @@
+ /* config.h: master configuration file, included first by all compilable
+- source files (not headers). */
++ source files (not headers). This file is public domain. */
+
+ #ifndef CONFIG_H
+ #define CONFIG_H
+Index: texlive-bin-2007/build/source/texk/dvipsk/crop.lpro
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/crop.lpro 2007-05-07 01:38:11.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/crop.lpro 2007-05-07 01:38:37.000000000 +0200
+@@ -1,5 +1,5 @@
+ %!
+-% This file is for crop marks.
++% This file is for crop marks. This file is public domain.
+ %
+ % First, we translate and draw the marks. You can change the way the
+ % marks are drawn, but the quarter inch border around the page is fixed.
+Index: texlive-bin-2007/build/source/texk/dvipsk/debug.h
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/debug.h 2007-05-07 01:38:11.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/debug.h 2007-05-07 01:38:37.000000000 +0200
+@@ -1,5 +1,5 @@
+ /*
+- * Here's some stuff for debugging dvips.
++ * Here's some stuff for debugging dvips. See dvips.h for copyright.
+ */
+
+ #ifdef DEBUG
+Index: texlive-bin-2007/build/source/texk/dvipsk/download.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/download.c 2007-05-07 01:17:43.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/download.c 2007-05-07 01:38:37.000000000 +0200
+@@ -433,6 +433,9 @@
+ * Download a PostScript font, using partial font downloading if
+ * necessary.
+ */
++extern char *downloadedpsnames[];
++extern int unused_top_of_psnames;
++
+ void downpsfont P2C(charusetype *, p, charusetype *, all)
+ {
+ #ifdef DOWNLOAD_USING_PDFTEX
+@@ -444,6 +447,8 @@
+ register chardesctype *c ;
+ struct resfont *rf ;
+ int cc;
++ extern char *realnameoffile ;
++ int j;
+
+ curfnt = p->fd ;
+ rf = curfnt->resfont ;
+@@ -457,6 +462,10 @@
+ return ;
+ if (rf->sent == 2) /* sent as header, from a PS file */
+ return ;
++ for (j=0; downloadedpsnames[j] && j < unused_top_of_psnames; j++) {
++ if (strcmp (downloadedpsnames[j], rf->PSname) == 0)
++ return;
++ }
+ if (all->fd == 0)
+ error("! internal error in downpsfont") ;
+ if (!partialdownload) {
+@@ -514,14 +523,6 @@
+ }
+ }
+ if(GridCount!=0 || extraGlyphs) {
+- if (!quiet) {
+- if (strlen(rf->Fontfile) + prettycolumn > STDOUTSIZE) {
+- fprintf(stderr, "\n") ;
+- prettycolumn = 0 ;
+- }
+- (void)fprintf(stderr, "<%s>", rf->Fontfile);
+- prettycolumn += strlen(rf->Fontfile) + 2 ;
+- }
+ newline() ;
+ if (! disablecomments)
+ (void)fprintf(bitfile, "%%%%BeginFont: %s\n", rf->PSname);
+@@ -531,6 +532,14 @@
+ if(FontPart(bitfile, rf->Fontfile, rf->Vectfile) < 0)
+ #endif
+ exit(1);
++ if (!quiet) {
++ if (strlen(realnameoffile) + prettycolumn > STDOUTSIZE) {
++ fprintf(stderr, "\n") ;
++ prettycolumn = 0 ;
++ }
++ (void)fprintf(stderr, "<%s>", realnameoffile);
++ prettycolumn += strlen(realnameoffile) + 2 ;
++ }
+ if (! disablecomments)
+ (void)fprintf(bitfile, "%%%%EndFont \n");
+ }
+Index: texlive-bin-2007/build/source/texk/dvipsk/dpicheck.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/dpicheck.c 2007-05-07 01:38:11.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/dpicheck.c 2007-05-07 01:38:37.000000000 +0200
+@@ -1,12 +1,10 @@
+ /*
+- * This software is Copyright 1988 by Radical Eye Software.
+- */
+-/*
+ * dpicheck of dvips.c. Checks the dots per inch to make sure
+ * it exists. The fonts which exist are DPI at the appropriate
+ * magnifications.
+ */
+-#include "dvips.h"
++#include "dvips.h" /* The copyright notice in that file is included too! */
++
+ extern int actualdpi ;
+ static integer existsizes[30] = { 0 , 99999999 } ;
+ static int checkdpi ;
+Index: texlive-bin-2007/build/source/texk/dvipsk/dvips.1
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/dvips.1 2007-05-07 01:18:03.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/dvips.1 2007-05-07 01:38:37.000000000 +0200
+@@ -360,16 +360,21 @@
+ .B -r
+ Stack pages in reverse order. Normally, page 1 will be printed first.
+ .TP
+-.B -R
+-Run in secure mode. This means that ``backtick'' commands from a
+-.I \especial{}
+-or
+-.I \epsffile{}
+-macro in the (La)TeX source like
+-.I \especial{psfile="`zcat foo.ps.Z"}
+-or
+-.I \epsffile[72 72 540 720]{"`zcat screendump.ps.gz"}
+-are not executed.
++.B -R[0|1|2]
++Run securely.
++.BR -R2
++disables both shell command execution in
++.I \especial'{}
++(via backticks
++.BR `
++) and config files (via the
++.I E
++option), and opening of any absolute filenames.
++.BR -R1
++, the default, forbids shell escapes but allows absolute filenames.
++.BR -R0
++allows both. The config file option is
++.I z
+ .TP
+ .B -s
+ Causes the entire global output to be enclosed in a save/restore pair.
+Index: texlive-bin-2007/build/source/texk/dvipsk/dvips.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/dvips.c 2007-05-07 01:18:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/dvips.c 2007-05-07 01:38:37.000000000 +0200
+@@ -1,10 +1,6 @@
+ /*
+ * This is the main routine.
+ */
+-#ifndef DEFRES
+-#define DEFRES (600)
+-#endif
+-
+ #include "dvips.h" /* The copyright notice there is included too! */
+ #ifdef KPATHSEA
+ #include
+@@ -44,12 +40,22 @@
+ #include descrip
+ #endif
+ #endif
++
++#ifndef DEFRES
++#define DEFRES (600)
++#endif
++
+ /*
+ * First we define some globals.
+ */
+ #ifdef VMS
+ static char ofnme[252],infnme[252],pap[40],thh[20];
+ #endif
++
++/* PS fonts fully downloaded as headers */
++char *downloadedpsnames[DOWNLOADEDPSSIZE];
++
++int unused_top_of_psnames ; /* unused top number of downloadedpsnames[#] */
+ fontdesctype *fonthead ; /* list of all fonts mentioned so far */
+ fontdesctype *curfnt ; /* the currently selected font */
+ sectiontype *sections ; /* sections to process document in */
+@@ -159,6 +165,7 @@
+ int quiet ; /* should we only print errors to stderr? */
+ int filter ; /* act as filter default output to stdout,
+ default input to stdin? */
++int dvips_debug_flag ; /* output config and map files to stderr if 1 */
+ int prettycolumn ; /* the column we are at when running pretty */
+ int gargc ; /* global argument count */
+ char **gargv ; /* global argument vector */
+@@ -306,6 +313,16 @@
+ fputs (kpse_bug_address, f);
+ #endif
+ }
++
++void
++freememforpsnames(void)
++{
++ int i;
++
++ for (i = 0; i < unused_top_of_psnames && downloadedpsnames[i]; i++)
++ free (downloadedpsnames[i]);
++}
++
+ /*
+ * This error routine prints an error message; if the first
+ * character is !, it aborts the job.
+@@ -328,6 +345,7 @@
+ }
+
+ if (*s=='!') {
++ freememforpsnames() ;
+ if (bitfile != NULL) {
+ cleanprinter() ;
+ }
+@@ -440,6 +458,8 @@
+ i = 10;
+ for (s="abcdef"; *s!=0; s++)
+ xdig[(int)*s] = i++;
++ for(i=0 ; i < DOWNLOADEDPSSIZE; i++)
++ downloadedpsnames[i] = NULL;
+ morestrings() ;
+ maxpages = 100000 ;
+ numcopies = 1 ;
+@@ -552,7 +572,7 @@
+ #ifdef MVSXA
+ int firstext = -1 ;
+ #endif
+- register sectiontype *sects ;
++ sectiontype *sects ;
+
+ #ifdef KPATHSEA
+ kpse_set_program_name (argv[0], "dvips");
+@@ -607,15 +627,15 @@
+ exit (0);
+ } else if (strcmp (argv[1], "--version") == 0) {
+ extern KPSEDLL char *kpathsea_version_string;
+- puts ("dvips(k) 5.96");
++ puts ("dvips(k) 5.96.1");
+ puts (kpathsea_version_string);
+- puts ("Copyright (C) 2005 Radical Eye Software.\n\
++ puts ("Copyright (C) 2007 Radical Eye Software.\n\
+ There is NO warranty. You may redistribute this software\n\
+ under the terms of the GNU General Public License\n\
+ and the Dvips copyright.\n\
+ For more information about these matters, see the files\n\
+ named COPYING and dvips.h.\n\
+-Primary author of Dvips: T. Rokicki; -k maintainer: T. Kacvinsky/ S. Rahtz.");
++Primary author of Dvips: T. Rokicki.");
+ exit (0);
+ }
+ if (argc == 2 && strncmp(argv[1], "-?", 2) == 0) {
+@@ -630,6 +650,20 @@
+ }
+ #endif
+ #endif
++ dvips_debug_flag = 0 ;
++ { /* for compilers incompatible with c99 */
++ char *s = (char *)getenv ("DVIPSDEBUG") ;
++ if (s) {
++ dvips_debug_flag = 1 ;
++ free (s) ;
++ } else {
++ s = (char *) getenv ("KPATHSEA_DEBUG") ;
++ if (s) {
++ dvips_debug_flag = 1 ;
++ free (s) ;
++ }
++ }
++ }
+ initialize() ;
+ checkenv(0) ;
+ getdefaults(CONFIGFILE) ;
+@@ -1116,8 +1150,14 @@
+ revpslists() ;
+ getpsinfo((char *)NULL) ;
+ revpslists() ;
+- if (!quiet)
+- (void)fprintf(stderr, "%s %s\n", banner, banner2) ;
++ if (dvips_debug_flag) {
++ if (!quiet)
++ (void)fprintf(stderr, "\n%s %s\n", banner, banner2) ;
++ prettycolumn = 0 ;
++ } else {
++ if (!quiet)
++ (void)fprintf(stderr, "%s %s\n", banner, banner2) ;
++ }
+ if (*iname) {
+ dvifile = fopen(iname, READBIN) ;
+ /*
+@@ -1367,6 +1407,7 @@
+ }
+ }
+ }
++ freememforpsnames() ;
+ if (! sepfiles) {
+ #ifdef HPS
+ if (HPS_FLAG)
+Index: texlive-bin-2007/build/source/texk/dvipsk/dvips.h
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/dvips.h 2007-05-07 01:18:25.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/dvips.h 2007-05-07 01:38:37.000000000 +0200
+@@ -1,19 +1,14 @@
+ /*
+ * This is dvips, a freely redistributable PostScript driver
+- * for dvi files. It is (C) Copyright 1986-2004 by Tomas Rokicki.
+- * You may modify and use this program to your heart's content,
+- * so long as you send modifications to Tomas Rokicki. It can
+- * be included in any distribution, commercial or otherwise, so
+- * long as the banner string defined below is not modified (except
+- * for the version number) and this banner is printed on program
+- * invocation, or can be printed on program invocation with the -? option.
++ * for dvi files. It is (C) Copyright 1986-2007 by Tomas Rokicki.
++ * You may modify and use this program to your heart's content.
+ */
+
+ /* This file is the header for dvips's global data structures. */
+
+ #define CREATIONDATE
+ #define BANNER \
+-"This is dvips(k) 5.96 Copyright 2005 Radical Eye Software"
++"This is dvips(k) 5.96.1 Copyright 2007 Radical Eye Software"
+ #define BANNER2 "(www.radicaleye.com)"
+ #ifdef KPATHSEA
+ #include "config.h"
+@@ -58,13 +53,14 @@
+ * of a string that can be handled in specials, so it should not be
+ * set too small.
+ */
+-#define STRINGSIZE (200000) /* maximum total chars in strings in program */
++#define STRINGSIZE (200000) /* maximum total chars in strings in program */
+ #define RASTERCHUNK (8192) /* size of chunk of raster */
+ #define MINCHUNK (240) /* minimum size char to get own raster */
+ #define STACKSIZE (350) /* maximum stack size for dvi files */
+ #define MAXFRAME (10) /* maximum depth of virtual font recursion */
+ #define MAXFONTHD (100) /* number of unique names of included fonts */
+ #define STDOUTSIZE (75) /* width of a standard output line */
++#define DOWNLOADEDPSSIZE (1000) /* max number of downloaded fonts to check */
+ /*
+ * Other constants, which define printer-dependent stuff.
+ */
+Index: texlive-bin-2007/build/source/texk/dvipsk/emspecial.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/emspecial.c 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/emspecial.c 2007-05-07 01:38:37.000000000 +0200
+@@ -659,14 +659,23 @@
+ void imagehead P5C(char *, filename, int, wide, int, high,
+ float, emwidth, float, emheight)
+ {
++ char *fullname = NULL, *name ;
+ if (!quiet) {
+- if (strlen(filename) + prettycolumn > STDOUTSIZE) {
++#ifdef KPATHSEA
++ fullname = (char *)kpse_find_file (filename, pictpath, 0) ;
++#endif
++ if (!fullname)
++ name = filename ;
++ else
++ name = fullname ;
++ if (strlen(name) + prettycolumn > STDOUTSIZE) {
+ fprintf(stderr,"\n");
+ prettycolumn = 0;
+ }
+- (void)fprintf(stderr,"<%s",filename);
++ (void)fprintf(stderr,"<%s",name);
+ (void)fflush(stderr);
+- prettycolumn += 2+strlen(filename);
++ prettycolumn += 2+strlen(name);
++ if (fullname) free (fullname);
+ }
+ hvpos();
+ nlcmdout("@beginspecial @setspecial") ;
+Index: texlive-bin-2007/build/source/texk/dvipsk/finclude.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/finclude.c 2007-05-07 01:17:29.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/finclude.c 2007-05-07 01:38:37.000000000 +0200
+@@ -57,6 +57,9 @@
+ extern integer debug_flag;
+ #endif /* DEBUG */
+
++extern char *downloadedpsnames[];
++extern int unused_top_of_psnames;
++
+ /*
+ * Create a font descriptor for a font included in a psfile. There will be
+ * no fontmaptype node for the resulting font descriptor until this font is
+@@ -252,6 +255,10 @@
+ char *p,*pe;
+ struct resfont *re;
+ int i;
++ int j = 0;
++
++ while (downloadedpsnames[j] != NULL && j < DOWNLOADEDPSSIZE)
++ j++;
+
+ /* Turn all newlines, CRs, and tabs into spaces. */
+ p = str;
+@@ -312,6 +319,10 @@
+ infont = 0 ;
+ }
+ re->sent = 2 ;
++ if (unused_top_of_psnames < DOWNLOADEDPSSIZE) {
++ downloadedpsnames[unused_top_of_psnames] = xstrdup (re->PSname);
++ unused_top_of_psnames++;
++ }
+ } else {
+ char eb[1000];
+ sprintf(eb,"Font %s used in file %s is not in the mapping file.",
+Index: texlive-bin-2007/build/source/texk/dvipsk/finclude.lpro
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/finclude.lpro 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/finclude.lpro 2007-05-07 01:38:37.000000000 +0200
+@@ -1,4 +1,5 @@
+ %!
++% finclude.lpro - public domain.
+ % Define tfm-name to be a dictionary of included fonts indexed by size:
+ % /tfm-name scaled-size1 /font-select1 ... scsize_k /fselect_k k fstore -
+ /fstore
+Index: texlive-bin-2007/build/source/texk/dvipsk/flib.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/flib.c 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/flib.c 2007-05-07 01:38:37.000000000 +0200
+@@ -4,7 +4,7 @@
+ * Tomas Rokicki or Radical Eye Software; use at your own risk.
+ */
+ #ifdef FONTLIB
+-#include "dvips.h"
++#include "dvips.h" /* The copyright notice in that file is included too! */
+ #include "paths.h"
+ #include "protos.h"
+ extern int debug_flag ;
+Index: texlive-bin-2007/build/source/texk/dvipsk/header.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/header.c 2007-05-07 01:18:19.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/header.c 2007-05-07 01:38:37.000000000 +0200
+@@ -35,7 +35,7 @@
+ int
+ add_name P2C(char *, s, struct header_list **, what)
+ {
+- add_name_general (s, what, NULL, NULL);
++ return (int) add_name_general (s, what, NULL, NULL);
+ }
+
+ /*
+@@ -122,7 +122,7 @@
+ int
+ add_header P1C(char *, s)
+ {
+- add_header_general (s, NULL, NULL);
++ return (int) add_header_general (s, NULL, NULL);
+ }
+
+ int
+Index: texlive-bin-2007/build/source/texk/dvipsk/hps.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/hps.c 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/hps.c 2007-05-07 01:38:37.000000000 +0200
+@@ -1,8 +1,8 @@
+ /* This is the main file for hacking dvips to do HyperPostScript
+ * Written by Mark D. Doyle 11/94. It is (C) Copyright 1994 by Mark D. Doyle
+ * and the University of California. You may modify and use this program to
+- * your heart's content, so long as you send modifications to Mark Doyle and
+- * abide by the rest of the dvips copyrights.
++ * your heart's content. Mark Doyle requests that you send him
++ * any modifications.
+ */
+ #include "dvips.h"
+ #ifdef HPS
+Index: texlive-bin-2007/build/source/texk/dvipsk/hps.lpro
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/hps.lpro 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/hps.lpro 2007-05-07 01:38:37.000000000 +0200
+@@ -5,8 +5,9 @@
+ % Written by Tanmoy Bhattacharya and Mark D. Doyle 11/94.
+ % It is (C) Copyright 1994 by Tanmoy Bhattacharya, Mark D. Doyle
+ % and the University of California. You may modify and use this program to
+-% your heart's content, so long as you send modifications to Tanmoy
+-% Bhattacharya and/or Mark Doyle.
++% your heart's content. Tanmoy Bhattacharya and Mark Doyle request that
++% you send either or both them any modifications.
++%
+ % Version number info
+ % 1 0 Probably first release
+ % 1 1 Added external handler to let ghostview work
+Index: texlive-bin-2007/build/source/texk/dvipsk/loadfont.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/loadfont.c 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/loadfont.c 2007-05-07 01:38:37.000000000 +0200
+@@ -333,6 +333,9 @@
+ register chardesctype *cd = 0 ;
+ int maxcc = 0 ;
+ int munged = 0 ;
++ extern int prettycolumn ;
++ extern int quiet ;
++ extern char *realnameoffile ;
+ /*
+ * We clear out some pointers:
+ */
+@@ -358,6 +361,14 @@
+ tfmload(curfnt) ;
+ return ;
+ }
++ if (!quiet) {
++ if (strlen(realnameoffile) + prettycolumn > STDOUTSIZE) {
++ fprintf(stderr, "\n") ;
++ prettycolumn = 0 ;
++ }
++ (void)fprintf(stderr, "<%s>", realnameoffile);
++ prettycolumn += strlen(realnameoffile) + 2 ;
++ }
+ #ifdef DEBUG
+ if (dd(D_FONTS))
+ (void)fprintf(stderr,"Loading pk font %s at %.1fpt\n",
+Index: texlive-bin-2007/build/source/texk/dvipsk/makefont.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/makefont.c 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/makefont.c 2007-05-07 01:38:37.000000000 +0200
+@@ -1,7 +1,5 @@
+-/*
+- * This software is Copyright 1988 by Radical Eye Software.
+- */
+-#include "dvips.h"
++/* makefont.c */
++#include "dvips.h" /* The copyright notice in that file is included too! */
+ #include
+ #include "protos.h"
+ extern int quiet ;
+Index: texlive-bin-2007/build/source/texk/dvipsk/output.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/output.c 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/output.c 2007-05-07 01:38:37.000000000 +0200
+@@ -113,6 +113,7 @@
+ void
+ copyfile_general P2C(char *, s, struct header_list *, cur_header)
+ {
++ extern char *realnameoffile ;
+ FILE *f = NULL ;
+ int c, prevc = '\n' ;
+ long len ;
+@@ -205,7 +206,11 @@
+ error(errbuf) ;
+ else {
+ if (! quiet) {
++#if defined(VMCMS) || defined (MVSXA)
+ if (strlen(s) + prettycolumn > STDOUTSIZE) {
++#else
++ if (strlen(realnameoffile) + prettycolumn > STDOUTSIZE) {
++#endif
+ fprintf(stderr, "\n") ;
+ prettycolumn = 0 ;
+ }
+@@ -215,11 +220,15 @@
+ #ifdef MVSXA
+ (void)fprintf(stderr, "<%s>", trunc_s) ;
+ #else
+- (void)fprintf(stderr, "<%s>", s) ;
++ (void)fprintf(stderr, "<%s>", realnameoffile) ;
+ #endif
+ #endif
+ (void)fflush(stderr) ;
++#if defined(VMCMS) || defined (MVSXA)
+ prettycolumn += 2 + strlen(s) ;
++#else
++ prettycolumn += 2 + strlen(realnameoffile) ;
++#endif
+ }
+ if (linepos != 0)
+ (void)putc('\n', bitfile) ;
+Index: texlive-bin-2007/build/source/texk/dvipsk/papersiz.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/papersiz.c 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/papersiz.c 2007-05-07 01:38:37.000000000 +0200
+@@ -11,7 +11,7 @@
+ * 0 <= num < den <= 20000
+ * 0 <= whole
+ */
+-#include "dvips.h"
++#include "dvips.h" /* The copyright notice in that file is included too! */
+ #include "protos.h"
+ static long scale P4C(long, whole, long, num, long, den, long, sf)
+ {
+Index: texlive-bin-2007/build/source/texk/dvipsk/paths.h
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/paths.h 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/paths.h 2007-05-07 01:38:37.000000000 +0200
+@@ -1,4 +1,4 @@
+-/*
++/* paths.h - public domain.
+ * OUTPATH is where to send the output. If you want a .ps file to
+ * be created by default, set this to "". If you want to automatically
+ * invoke a pipe (as in lpr), make the first character an exclamation
+Index: texlive-bin-2007/build/source/texk/dvipsk/psfonts.map
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/psfonts.map 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/psfonts.map 2007-05-07 01:38:37.000000000 +0200
+@@ -1,4 +1,5 @@
+ % original psfonts.map -- match TFM filenames to PostScript FontNames.
++% This file is public domain.
+ % (If you change or delete `original' on the previous line, dvips won't
+ % install its psfonts.map over this file.)
+ %
+Index: texlive-bin-2007/build/source/texk/dvipsk/resident.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/resident.c 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/resident.c 2007-05-07 01:38:37.000000000 +0200
+@@ -32,6 +32,8 @@
+ * These are the external variables we use.
+ */
+ extern char *realnameoffile ;
++extern int prettycolumn ;
++extern int dvips_debug_flag ;
+ #ifdef DEBUG
+ extern integer debug_flag;
+ #endif /* DEBUG */
+@@ -441,6 +443,14 @@
+ #else
+ if ((deffile=search(d,PSname,READ))!=NULL) {
+ #endif
++ if (dvips_debug_flag && !quiet) {
++ if (strlen(realnameoffile) + prettycolumn > STDOUTSIZE) {
++ fprintf(stderr, "\n") ;
++ prettycolumn = 0 ;
++ }
++ (void)fprintf(stderr, "{%s}", realnameoffile);
++ prettycolumn += strlen(realnameoffile) + 2 ;
++ }
+ #ifdef DEBUG
+ if (dd (D_CONFIG)) {
+ fprintf (stderr, "Reading dvips config file `%s':\n", realnameoffile);
+@@ -845,9 +855,9 @@
+ */
+ void getpsinfo P1C(char *, name)
+ {
+- FILE *deffile ;
+- register char *p ;
+- char *specinfo, *downloadinfo ;
++ FILE *deffile ;
++ register char *p ;
++ char *specinfo, *downloadinfo ;
+ char downbuf[500] ;
+ char specbuf[500] ;
+ int slen ;
+@@ -855,6 +865,14 @@
+ if (name == 0)
+ name = psmapfile ;
+ if ((deffile=search(mappath, name, READ))!=NULL) {
++ if (dvips_debug_flag && !quiet) {
++ if (strlen(realnameoffile) + prettycolumn > STDOUTSIZE) {
++ fprintf(stderr, "\n") ;
++ prettycolumn = 0 ;
++ }
++ (void)fprintf(stderr, "{%s}", realnameoffile);
++ prettycolumn += strlen(realnameoffile) + 2 ;
++ }
+ while (fgets(was_inline, INLINE_SIZE, deffile)!=NULL) {
+ p = was_inline ;
+ if (*p > ' ' && *p != '*' && *p != '#' && *p != ';' && *p != '%') {
+Index: texlive-bin-2007/build/source/texk/dvipsk/special.lpro
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/special.lpro 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/special.lpro 2007-05-07 01:38:37.000000000 +0200
+@@ -1,6 +1,5 @@
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-%% header for the \special command
+-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++% special.lpro - public domain.
++% header for the \special command
+ % The structure of the PostScript produced by dvips for \special is:
+ % @beginspecial
+ % - any number of @hsize, @hoffset, @hscale, etc., commands
+Index: texlive-bin-2007/build/source/texk/dvipsk/squeeze.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/squeeze.c 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/squeeze.c 2007-05-07 01:38:37.000000000 +0200
+@@ -1,7 +1,4 @@
+ /*
+- * This software is Copyright 1988 by Radical Eye Software.
+- */
+-/*
+ * This routine squeezes a PostScript file down to its
+ * minimum. We parse and then output it.
+ */
+@@ -14,7 +11,7 @@
+ #include
+ #include
+ #include
+-#include "dvips.h"
++#include "dvips.h" /* The copyright notice in that file is included too! */
+ #endif
+ #ifdef fopen
+ #undef fopen
+Index: texlive-bin-2007/build/source/texk/dvipsk/tex.lpro
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/tex.lpro 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/tex.lpro 2007-05-07 01:38:37.000000000 +0200
+@@ -1,3 +1,5 @@
++% tex.lpro - public domain.
++%
+ % The following defines procedures assumed and used by program "dvips"
+ % and must be downloaded or sent as a header file for all TeX jobs.
+ % Originated by Neal Holtz, Carleton University, Ottawa, Canada
+Index: texlive-bin-2007/build/source/texk/dvipsk/texc.script
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/texc.script 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/texc.script 2007-05-07 01:38:37.000000000 +0200
+@@ -1,5 +1,5 @@
+ #! /bin/sh
+-# A shell script to convert tex.lpro to texc.lpro
++# A shell script to convert tex.lpro to texc.lpro. Public domain.
+ #
+ # To use it, say
+ # texc.script tex.lpro texc.lpro
+Index: texlive-bin-2007/build/source/texk/dvipsk/texps.lpro
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/dvipsk/texps.lpro 2007-05-07 01:38:12.000000000 +0200
++++ texlive-bin-2007/build/source/texk/dvipsk/texps.lpro 2007-05-07 01:38:37.000000000 +0200
+@@ -1,5 +1,5 @@
+ % Thanks for some changes to:
+-%+ This is TEXPS.LPRO as modified by Rob Hutchings 1992Apr02
++%+ This is TEXPS.LPRO as modified by Rob Hutchings 1992Apr02. Public domain.
+ %+ My comments are marked as %+
+ % PostScript prolog for using resident fonts.
+ %+ Provision is made to change the encoding scheme in special instructions.
--- texlive-bin-2007.dfsg.1.orig/debian/patches/12e_fix_vpe_invocation
+++ texlive-bin-2007.dfsg.1/debian/patches/12e_fix_vpe_invocation
@@ -0,0 +1,15 @@
+---
+ build/source/texk/texlive/vpe | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+Index: texlive-bin-2007/build/source/texk/texlive/vpe
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/texlive/vpe 2007-05-19 16:37:45.000000000 +0200
++++ texlive-bin-2007/build/source/texk/texlive/vpe 2007-05-19 16:37:54.000000000 +0200
+@@ -1,5 +1,4 @@
+-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
+- if 0;
++#!/usr/bin/perl -w
+ use strict;
+ #
+ # vpe.pl
--- texlive-bin-2007.dfsg.1.orig/debian/patches/64_fix_makempx_installation
+++ texlive-bin-2007.dfsg.1/debian/patches/64_fix_makempx_installation
@@ -0,0 +1,21 @@
+64_fix_makempx_installation by Sanjoy Mahajan
+
+building with --enable-shared installs the makempx script instead of the
+binary build
+---
+ build/source/texk/web2c/mpware/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: texlive-bin-2007/build/source/texk/web2c/mpware/Makefile.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/mpware/Makefile.in 2007-05-19 20:04:58.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/mpware/Makefile.in 2007-05-19 20:05:19.000000000 +0200
+@@ -49,7 +49,7 @@
+ $(INSTALL_PROGRAM) newer $(bindir)/newer
+ $(INSTALL_LIBTOOL_PROG) dmp $(bindir)
+ $(INSTALL_LIBTOOL_PROG) mpto $(bindir)
+- $(INSTALL_SCRIPT) makempx $(scriptdir)/makempx
++ $(INSTALL_LIBTOOL_PROG) makempx $(bindir)
+ install-data:
+
+ kpse_include ../make/tkpathsea.mk
--- texlive-bin-2007.dfsg.1.orig/debian/patches/xetex-0996-patch1
+++ texlive-bin-2007.dfsg.1/debian/patches/xetex-0996-patch1
@@ -0,0 +1,1037 @@
+Patches from texlive release 2007.0 (DVD) to 2007.1 which consists of
+fixes for the xetex version in TL2007 made by Jonathan Kew, from his mail
+to the texlive ML:
+: Regarding the actual fixes committed to the 2007 branch: these
+: primarily provide xetex compatibility on big-endian 64-bit systems.
+: In addition, they correct two minor bugs where xetex generated
+: incorrect output, and protect xetex and xdvipdfmx from certain kinds
+: of defective TrueType fonts that could cause crashes.
+---
+ build/source/libs/icu-xetex/layout/KernTable.cpp | 29 +++++-
+ build/source/texk/web2c/texmfmem.h | 39 --------
+ build/source/texk/web2c/xetexdir/XeTeX_ext.c | 100 +++++++++++------------
+ build/source/texk/web2c/xetexdir/XeTeX_ext.h | 63 ++++++++------
+ build/source/texk/web2c/xetexdir/XeTeX_mac.c | 2
+ build/source/texk/web2c/xetexdir/jpegimage.c | 2
+ build/source/texk/web2c/xetexdir/xetex-new.ch | 98 +++++++++++++---------
+ build/source/texk/web2c/xetexdir/xetex.defines | 2
+ build/source/texk/web2c/xetexdir/xetex.h | 3
+ build/source/texk/web2c/xetexdir/xetex.mk | 10 +-
+ build/source/texk/xdvipdfmx/src/tt_cmap.c | 9 ++
+ 11 files changed, 190 insertions(+), 167 deletions(-)
+
+Index: texlive-bin-2007/build/source/libs/icu-xetex/layout/KernTable.cpp
+===================================================================
+--- texlive-bin-2007.orig/build/source/libs/icu-xetex/layout/KernTable.cpp 2006-07-25 14:37:43.000000000 +0200
++++ texlive-bin-2007/build/source/libs/icu-xetex/layout/KernTable.cpp 2007-08-13 16:22:35.000000000 +0200
+@@ -16,8 +16,10 @@
+ U_NAMESPACE_BEGIN
+
+ struct PairInfo {
+- le_uint32 key; // sigh, MSVC compiler gags on union here
++ le_uint16 left;
++ le_uint16 right;
+ le_int16 value; // fword, kern value in funits
++ le_uint32 key() const { return ((le_uint32)SWAPW(left) << 16) | SWAPW(right); }
+ };
+ #define KERN_PAIRINFO_SIZE 6
+
+@@ -81,9 +83,24 @@
+ if (coverage & COVERAGE_HORIZONTAL) { // only handle horizontal kerning
+ const Subtable_0* table = (const Subtable_0*)((char*)subhead + KERN_SUBTABLE_HEADER_SIZE);
+ nPairs = SWAPW(table->nPairs);
++#if 0 // don't trust these fields as some old TTF fonts have bad data here
+ searchRange = SWAPW(table->searchRange);
+ entrySelector = SWAPW(table->entrySelector);
+ rangeShift = SWAPW(table->rangeShift);
++#else // recompute the binary search header fields
++ if (nPairs == 0) { // this probably shouldn't happen
++ searchRange = entrySelector = 0;
++ } else {
++ searchRange = 1;
++ entrySelector = 0;
++ while (searchRange * 2 <= nPairs) {
++ searchRange *= 2;
++ entrySelector += 1;
++ }
++ }
++ rangeShift = (nPairs - searchRange) * KERN_PAIRINFO_SIZE;
++ searchRange *= KERN_PAIRINFO_SIZE;
++#endif
+ pairs = (const PairInfo*)((char*)table + KERN_SUBTABLE_0_HEADER_SIZE);
+
+ #if DEBUG
+@@ -103,9 +120,8 @@
+
+ const PairInfo* p = pairs;
+ for (i = 0; i < nPairs; ++i, p = (const PairInfo*)((char*)p+KERN_PAIRINFO_SIZE)) {
+- le_uint32 k = SWAPL(p->key);
+- le_uint16 left = (k >> 16) & 0xffff;
+- le_uint16 right = k & 0xffff;
++ le_uint16 left = SWAPW(p->left);
++ le_uint16 right = SWAPW(p->right);
+ if (left < 256 && right < 256) {
+ char c = ids[left];
+ if (c > 0x20 && c < 0x7f) {
+@@ -149,10 +165,11 @@
+ // but it is not in sorted order on win32 platforms because of the endianness difference
+ // so either I have to swap the element each time I examine it, or I have to swap
+ // all the elements ahead of time and store them in the font
++ // The key() accessor on PairInfo handles the swapping if needed
+
+ const PairInfo* p = pairs;
+ const PairInfo* tp = (const PairInfo*)((char*)p + rangeShift);
+- if (key > SWAPL(tp->key)) {
++ if (key > tp->key()) {
+ p = tp;
+ }
+
+@@ -165,7 +182,7 @@
+ while (probe > KERN_PAIRINFO_SIZE) {
+ probe >>= 1;
+ tp = (const PairInfo*)((char*)p + probe);
+- le_uint32 tkey = SWAPL(tp->key);
++ le_uint32 tkey = tp->key();
+ #if DEBUG
+ fprintf(stdout, " %.3d (%0.8x)\n", ((char*)tp - (char*)pairs)/KERN_PAIRINFO_SIZE, tkey);
+ fflush(stdout);
+Index: texlive-bin-2007/build/source/texk/web2c/texmfmem.h
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/texmfmem.h 2006-06-20 14:03:18.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/texmfmem.h 2007-08-13 16:22:35.000000000 +0200
+@@ -112,25 +112,13 @@
+ #else
+ twohalves hhfield;
+ #endif
+-#ifdef WORDS_BIGENDIAN
+ #ifdef XeTeX
+- struct
+- {
+- integer CINT;
+- integer CINT1;
+- } x;
+-#else
+- integer cint;
++ voidpointer ptr;
+ #endif
++#ifdef WORDS_BIGENDIAN
++ integer cint;
+ fourquarters qqqq;
+ #else /* not WORDS_BIGENDIAN */
+-#ifdef XeTeX
+- struct
+- {
+- integer CINT1;
+- integer CINT;
+- } x;
+-#else
+ struct
+ {
+ #if defined (TeX) && !defined (SMALLTeX) || defined (MF) && !defined (SMALLMF) || defined (MP) && !defined (SMALLMP)
+@@ -138,7 +126,6 @@
+ #endif /* big {TeX,MF,MP} */
+ integer CINT;
+ } u;
+-#endif
+
+ struct
+ {
+@@ -159,28 +146,13 @@
+ typedef union
+ {
+ #ifdef WORDS_BIGENDIAN
+-#ifdef XeTeX
+- struct
+- {
+- integer CINT;
+- } x;
+-#else
+ integer cint;
+-#endif
+ fourquarters qqqq;
+ #else /* not WORDS_BIGENDIAN */
+-#ifdef XeTeX
+- struct
+- {
+- halfword junk;
+- integer CINT;
+- } x;
+-#else
+ struct
+ {
+ integer CINT;
+ } u;
+-#endif
+
+ struct
+ {
+@@ -199,14 +171,9 @@
+ #define rh v.RH
+ #define lhfield v.LH
+
+-#ifdef XeTeX
+-#define cint x.CINT
+-#define cint1 x.CINT1
+-#else
+ #ifndef WORDS_BIGENDIAN
+ #define cint u.CINT
+ #endif
+-#endif /* XeTeX */
+
+ #ifndef WORDS_BIGENDIAN
+ #define qqqq v.QQQQ
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_ext.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/XeTeX_ext.c 2007-08-13 16:22:35.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_ext.c 2007-08-13 16:22:35.000000000 +0200
+@@ -236,9 +236,9 @@
+ }
+
+
+-extern char* gettexstring(int strNumber);
++extern char* gettexstring(integer strNumber);
+ void
+-setinputfileencoding(UFILE* f, int mode, int encodingData)
++setinputfileencoding(UFILE* f, integer mode, integer encodingData)
+ {
+ if ((f->encodingMode == ICUMAPPING) && (f->conversionData != NULL))
+ ucnv_close((UConverter*)(f->conversionData));
+@@ -288,9 +288,9 @@
+ static char* byteBuffer = NULL;
+
+ UInt32 bytesRead = 0;
+- int i;
++ int i;
+ UConverter* cnv;
+- long outLen;
++ int outLen;
+ UErrorCode errorCode = 0;
+
+ if (byteBuffer == NULL)
+@@ -355,10 +355,9 @@
+ static int brkLocaleStrNum = 0;
+
+ void
+-linebreakstart(int localeStrNum, const UniChar* text, int textLength)
++linebreakstart(integer localeStrNum, const UniChar* text, integer textLength)
+ {
+ UErrorCode status = 0;
+- int i;
+
+ if ((localeStrNum != brkLocaleStrNum) && (brkIter != NULL)) {
+ ubrk_close(brkIter);
+@@ -392,8 +391,8 @@
+ return ubrk_next((UBreakIterator*)brkIter);
+ }
+
+-long
+-getencodingmodeandinfo(long* info)
++int
++getencodingmodeandinfo(integer* info)
+ {
+ /* \XeTeXinputencoding "enc-name"
+ * -> name is packed in |nameoffile| as a C string, starting at [1]
+@@ -811,7 +810,7 @@
+ }
+
+ void*
+-findnativefont(unsigned char* uname, long scaled_size)
++findnativefont(unsigned char* uname, integer scaled_size)
+ /* scaled_size here is in TeX points */
+ {
+ void* rval = 0;
+@@ -950,7 +949,6 @@
+ otgetfontmetrics(void* pEngine, scaled* ascent, scaled* descent, scaled* xheight, scaled* capheight, scaled* slant)
+ {
+ XeTeXLayoutEngine engine = (XeTeXLayoutEngine)pEngine;
+- long rval = 0;
+ float a, d;
+ int glyphID;
+
+@@ -977,8 +975,8 @@
+ *capheight = *ascent; /* arbitrary figure if there's no 'X' in the font */
+ }
+
+-long
+-otfontget(int what, void* pEngine)
++integer
++otfontget(integer what, void* pEngine)
+ {
+ XeTeXLayoutEngine engine = (XeTeXLayoutEngine)pEngine;
+ XeTeXFont fontInst = getFont(engine);
+@@ -995,8 +993,8 @@
+ }
+
+
+-long
+-otfontget1(int what, void* pEngine, long param)
++integer
++otfontget1(integer what, void* pEngine, integer param)
+ {
+ XeTeXLayoutEngine engine = (XeTeXLayoutEngine)pEngine;
+ XeTeXFont fontInst = getFont(engine);
+@@ -1013,8 +1011,8 @@
+ }
+
+
+-long
+-otfontget2(int what, void* pEngine, long param1, long param2)
++integer
++otfontget2(integer what, void* pEngine, integer param1, integer param2)
+ {
+ XeTeXLayoutEngine engine = (XeTeXLayoutEngine)pEngine;
+ XeTeXFont fontInst = getFont(engine);
+@@ -1032,8 +1030,8 @@
+ }
+
+
+-long
+-otfontget3(int what, void* pEngine, long param1, long param2, long param3)
++integer
++otfontget3(integer what, void* pEngine, integer param1, integer param2, integer param3)
+ {
+ XeTeXLayoutEngine engine = (XeTeXLayoutEngine)pEngine;
+ XeTeXFont fontInst = getFont(engine);
+@@ -1091,7 +1089,7 @@
+ xdvbuffer = (char*)xmalloc(xdvBufSize);
+ }
+
+- glyph_info = (void*)native_glyph_info_ptr(p);
++ glyph_info = native_glyph_info_ptr(p);
+ locations = (FixedPoint*)glyph_info;
+ glyphIDs = (UInt16*)(locations + glyphCount);
+
+@@ -1138,8 +1136,8 @@
+ return ((char*)cp - xdvbuffer);
+ }
+
+-long
+-makefontdef(long f)
++int
++makefontdef(integer f)
+ {
+ UInt16 flags = 0;
+ UInt32 variationCount = 0;
+@@ -1349,7 +1347,7 @@
+ }
+
+ void
+-getnativecharheightdepth(int font, int ch, scaled* height, scaled* depth)
++getnativecharheightdepth(integer font, integer ch, scaled* height, scaled* depth)
+ {
+ #define QUAD(f) fontinfo[6+parambase[f]].cint
+ #define X_HEIGHT(f) fontinfo[5+parambase[f]].cint
+@@ -1389,7 +1387,7 @@
+ }
+
+ scaled
+-getnativecharht(int f, int c)
++getnativecharht(integer f, integer c)
+ {
+ scaled h, d;
+ getnativecharheightdepth(f, c, &h, &d);
+@@ -1397,7 +1395,7 @@
+ }
+
+ scaled
+-getnativechardp(int f, int c)
++getnativechardp(integer f, integer c)
+ {
+ scaled h, d;
+ getnativecharheightdepth(f, c, &h, &d);
+@@ -1405,7 +1403,7 @@
+ }
+
+ void
+-getnativecharsidebearings(int font, int ch, scaled* lsb, scaled* rsb)
++getnativecharsidebearings(integer font, integer ch, scaled* lsb, scaled* rsb)
+ {
+ float l, r;
+
+@@ -1432,7 +1430,7 @@
+ }
+
+ scaled
+-getnativecharic(int f, int c)
++getnativecharic(integer f, integer c)
+ {
+ scaled lsb, rsb;
+ getnativecharsidebearings(f, c, &lsb, &rsb);
+@@ -1443,7 +1441,7 @@
+ }
+
+ scaled
+-getnativecharwd(int f, int c)
++getnativecharwd(integer f, integer c)
+ {
+ scaled wd = 0;
+ #ifdef XETEX_MAC
+@@ -1515,7 +1513,7 @@
+ void* glyph_info = 0;
+ static float* positions = 0;
+ static UInt32* glyphs = 0;
+- static long maxGlyphs = 0;
++ static int maxGlyphs = 0;
+
+ FixedPoint* locations;
+ UInt16* glyphIDs;
+@@ -1591,7 +1589,7 @@
+
+ node_width(node) = X2Fix(wid);
+ native_glyph_count(node) = realGlyphCount;
+- native_glyph_info_ptr(node) = (long)glyph_info;
++ native_glyph_info_ptr(node) = glyph_info;
+ }
+ else {
+ int i;
+@@ -1632,7 +1630,7 @@
+ }
+
+ native_glyph_count(node) = realGlyphCount;
+- native_glyph_info_ptr(node) = (long)glyph_info;
++ native_glyph_info_ptr(node) = glyph_info;
+ }
+
+ ubidi_close(pBiDi);
+@@ -1787,8 +1785,8 @@
+ }
+ }
+
+-int
+-mapchartoglyph(int font, unsigned int ch)
++integer
++mapchartoglyph(integer font, integer ch)
+ {
+ if (ch > 0x10ffff || ((ch >= 0xd800) && (ch <= 0xdfff)))
+ return 0;
+@@ -1805,8 +1803,8 @@
+ }
+ }
+
+-int
+-mapglyphtoindex(int font)
++integer
++mapglyphtoindex(integer font)
+ /* glyph name is at nameoffile+1 */
+ {
+ #ifdef XETEX_MAC
+@@ -1822,8 +1820,8 @@
+ }
+ }
+
+-int
+-getfontcharrange(int font, int first)
++integer
++getfontcharrange(integer font, int first)
+ {
+ #ifdef XETEX_MAC
+ if (fontarea[font] == AAT_FONT_FLAG)
+@@ -1928,10 +1926,10 @@
+ #endif
+ }
+
+-long
++int
+ atsufontget(int what, ATSUStyle style)
+ {
+- long rval = -1;
++ int rval = -1;
+
+ #ifdef XETEX_MAC
+ ATSUFontID fontID;
+@@ -1966,10 +1964,10 @@
+ return rval;
+ }
+
+-long
++int
+ atsufontget1(int what, ATSUStyle style, int param)
+ {
+- long rval = -1;
++ int rval = -1;
+
+ #ifdef XETEX_MAC
+ ATSUFontID fontID;
+@@ -2026,10 +2024,10 @@
+ return rval;
+ }
+
+-long
++int
+ atsufontget2(int what, ATSUStyle style, int param1, int param2)
+ {
+- long rval = -1;
++ int rval = -1;
+
+ #ifdef XETEX_MAC
+ ATSUFontID fontID;
+@@ -2063,10 +2061,10 @@
+ return rval;
+ }
+
+-long
++int
+ atsufontgetnamed(int what, ATSUStyle style)
+ {
+- long rval = -1;
++ int rval = -1;
+
+ #ifdef XETEX_MAC
+ ATSUFontID fontID;
+@@ -2090,10 +2088,10 @@
+ return rval;
+ }
+
+-long
++int
+ atsufontgetnamed1(int what, ATSUStyle style, int param)
+ {
+- long rval = -1;
++ int rval = -1;
+
+ #ifdef XETEX_MAC
+ ATSUFontID fontID;
+@@ -2220,7 +2218,7 @@
+ }
+
+ void
+-printglyphname(int font, int gid)
++printglyphname(integer font, integer gid)
+ {
+ char* s;
+ int len = 0;
+@@ -2243,8 +2241,8 @@
+ printchar(*s++);
+ }
+
+-boolean
+-u_open_in(unicodefile* f, int filefmt, const_string fopen_mode, int mode, int encodingData)
++int
++u_open_in(unicodefile* f, integer filefmt, const_string fopen_mode, integer mode, integer encodingData)
+ {
+ boolean rval;
+ *f = malloc(sizeof(UFILE));
+@@ -2287,7 +2285,7 @@
+ return rval;
+ }
+
+-boolean
++int
+ open_dvi_output(FILE** fptr)
+ {
+ if (nopdfoutput) {
+@@ -2391,7 +2389,7 @@
+ return rval;
+ }
+
+-boolean
++int
+ input_line(UFILE* f)
+ {
+ int i;
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_ext.h
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/XeTeX_ext.h 2006-12-29 18:54:26.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_ext.h 2007-08-13 16:23:36.000000000 +0200
+@@ -141,10 +141,10 @@
+ #define node_width(node) node[width_offset].cint
+ #define node_depth(node) node[depth_offset].cint
+ #define node_height(node) node[height_offset].cint
+-#define native_length(node) node[native_info_offset].hh.v.RH
+-#define native_font(node) node[native_info_offset].hh.b1
+-#define native_glyph_count(node) node[native_glyph_info_offset].hh.v.LH
+-#define native_glyph_info_ptr(node) node[native_glyph_info_offset].hh.v.RH
++#define native_length(node) node[native_info_offset].qqqq.b2
++#define native_font(node) node[native_info_offset].qqqq.b1
++#define native_glyph_count(node) node[native_info_offset].qqqq.b3
++#define native_glyph_info_ptr(node) node[native_glyph_info_offset].ptr
+ #define native_glyph_info_size 10 /* info for each glyph is location (FixedPoint) + glyph ID (UInt16) */
+
+ #define native_glyph(p) native_length(p) /* glyph ID field in a glyph_node */
+@@ -206,6 +206,8 @@
+ extern const UInt32 byteMask;
+ extern const UInt32 byteMark;
+
++#include /* for FILE */
++
+ #include "trans.h"
+
+ #ifdef __cplusplus
+@@ -213,51 +215,62 @@
+ #endif
+ void initversionstring(char **versions);
+
+- void setinputfileencoding(unicodefile f, int mode, int encodingData);
++ void setinputfileencoding(unicodefile f, integer mode, integer encodingData);
+ void uclose(unicodefile f);
+ int input_line_icu(unicodefile f);
+- void linebreakstart(int localeStrNum, const UniChar* text, int textLength);
++ void linebreakstart(integer localeStrNum, const UniChar* text, integer textLength);
+ int linebreaknext();
+- long getencodingmodeandinfo(long* info);
++ int getencodingmodeandinfo(integer* info);
+ void printutf8str(const unsigned char* str, int len);
+ void printchars(const unsigned short* str, int len);
+ void* load_mapping_file(const char* s, const char* e);
+- void* findnativefont(unsigned char* name, long scaled_size);
++ void* findnativefont(unsigned char* name, integer scaled_size);
+ void releasefontengine(void* engine, int type_flag);
+
+- /* 'integer' params here are really TeX 'scaled' values, but that typedef isn't available every place this is included */
++ /* the metrics params here are really TeX 'scaled' values, but that typedef isn't available every place this is included */
+ void otgetfontmetrics(void* engine, integer* ascent, integer* descent, integer* xheight, integer* capheight, integer* slant);
+- void getnativecharheightdepth(int font, int ch, integer* height, integer* depth);
+- void getnativecharsidebearings(int font, int ch, integer* lsb, integer* rsb);
++ void getnativecharheightdepth(integer font, integer ch, integer* height, integer* depth);
++ void getnativecharsidebearings(integer font, integer ch, integer* lsb, integer* rsb);
+
+ /* single-purpose metrics accessors */
+- integer getnativecharwd(int font, int ch);
+- integer getnativecharht(int font, int ch);
+- integer getnativechardp(int font, int ch);
+- integer getnativecharic(int font, int ch);
+-
+- long otfontget(int what, void* engine);
+- long otfontget1(int what, void* engine, long param);
+- long otfontget2(int what, void* engine, long param1, long param2);
+- long otfontget3(int what, void* engine, long param1, long param2, long param3);
++ integer getnativecharwd(integer font, integer ch);
++ integer getnativecharht(integer font, integer ch);
++ integer getnativechardp(integer font, integer ch);
++ integer getnativecharic(integer font, integer ch);
++
++ integer otfontget(integer what, void* engine);
++ integer otfontget1(integer what, void* engine, integer param);
++ integer otfontget2(integer what, void* engine, integer param1, integer param2);
++ integer otfontget3(integer what, void* engine, integer param1, integer param2, integer param3);
+ int makeXDVGlyphArrayData(void* p);
+- long makefontdef(long f);
++ int makefontdef(integer f);
+ int applymapping(void* cnv, const UniChar* txtPtr, int txtLen);
+ void store_justified_native_glyphs(void* node);
+ void measure_native_node(void* node, int use_glyph_metrics);
+ Fixed get_native_ital_corr(void* node);
+ Fixed get_native_glyph_ital_corr(void* node);
+ void measure_native_glyph(void* node, int use_glyph_metrics);
+- int mapchartoglyph(int font, unsigned int ch);
+- int mapglyphtoindex(int font);
+-
++ integer mapchartoglyph(integer font, integer ch);
++ integer mapglyphtoindex(integer font);
++ integer getfontcharrange(integer font, int first);
++ void printglyphname(integer font, integer gid);
++
++ double read_double(const char** s);
++ unsigned int read_rgb_a(const char** cp);
++
+ const char* getGlyphNamePtr(const char* buffer, int tableSize, UInt16 gid, int* len);
+
+ int find_pic_file(char** path, realrect* bounds, int pdfBoxType, int page);
++ int u_open_in(unicodefile* f, integer filefmt, const char* fopen_mode, integer mode, integer encodingData);
++ int open_dvi_output(FILE** fptr);
++ void dviclose(FILE* fptr);
++ int get_uni_c(UFILE* f);
++ int input_line(UFILE* f);
++ void makeutf16name();
+
+ #ifdef XETEX_MAC
+ /* functions in XeTeX_mac.c */
+- void* loadAATfont(ATSFontRef fontRef, long scaled_size, const char* cp1);
++ void* loadAATfont(ATSFontRef fontRef, integer scaled_size, const char* cp1);
+ void DoAtsuiLayout(void* node, int justify);
+ void GetGlyphBBox_AAT(ATSUStyle style, UInt16 gid, GlyphBBox* bbox);
+ float GetGlyphWidth_AAT(ATSUStyle style, UInt16 gid);
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_mac.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/XeTeX_mac.c 2006-12-06 18:29:15.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_mac.c 2007-08-13 16:22:35.000000000 +0200
+@@ -162,7 +162,7 @@
+ lsDelta -= lsUnit;
+
+ native_glyph_count(node) = realGlyphCount;
+- native_glyph_info_ptr(node) = (long)glyph_info;
++ native_glyph_info_ptr(node) = glyph_info;
+
+ if (!justify)
+ node_width(node) = FixedPStoTeXPoints(layoutRec[count-1].realPos) + lsDelta;
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/jpegimage.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/jpegimage.c 2006-07-26 18:19:45.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/jpegimage.c 2007-08-13 16:22:35.000000000 +0200
+@@ -81,6 +81,8 @@
+
+ #include
+
++#include "kpathsea/lib.h" /* for xmalloc/xrealloc prototypes */
++
+ #define JPEG_DEBUG_STR "JPEG"
+ #define JPEG_DEBUG 3
+
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex-new.ch
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/xetex-new.ch 2007-01-03 17:25:04.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex-new.ch 2007-08-13 16:22:35.000000000 +0200
+@@ -56,7 +56,7 @@
+
+ @d XeTeX_version=0
+ @d XeTeX_revision==".996"
+-@d XeTeX_version_string=='-0.996' {current \XeTeX\ version}
++@d XeTeX_version_string=='-0.996-patch1' {current \XeTeX\ version}
+ @z
+
+ @x
+@@ -706,29 +706,28 @@
+
+ To support ``native'' fonts, we build |native_word_nodes|, which are variable size whatsits.
+ These have the same |width|, |depth|, and |height| fields as a |box_node|, at offsets 1-3,
+-and then a word containing a size field for the node, a font number, and a length.
+-Then there is a field containing two halfwords, a glyph count and a C pointer to a glyph info array;
+-these are set by |set_native_metrics|. Copying and freeing of these nodes needs to take account of this!
++and then a word containing a size field for the node, a font number, a length, and a glyph count.
++Then there is a field containing a C pointer to a glyph info array;
++this and the glyph count are set by |set_native_metrics|.
++Copying and freeing of these nodes needs to take account of this!
+ This is followed by |length| bytes, for the actual characters of the string.
+ (Yes, we count in bytes, even though what we store there is UTF-16.)
+
+ So |native_node_size|, which does not include any space for the actual text, is 6.}
+
+-@d deleted_native_node=41 {native words that have been superseded by their successors}
+-
+ @d native_node_size=6 {size of a native_word node (plus the actual chars) -- see also xetex.h}
+-@d native_size(#)==mem[#+4].hh.b0
+-@d native_font(#)==mem[#+4].hh.b1
+-@d native_length(#)==mem[#+4].hh.rh
+-@d native_glyph_count(#)==mem[#+5].hh.lh
+-@d native_glyph_info_ptr(#)==mem[#+5].hh.rh
++@d native_size(#)==mem[#+4].qqqq.b0
++@d native_font(#)==mem[#+4].qqqq.b1
++@d native_length(#)==mem[#+4].qqqq.b2
++@d native_glyph_count(#)==mem[#+4].qqqq.b3
++@d native_glyph_info_ptr(#)==mem[#+5].ptr
+ @d native_glyph_info_size=10 { number of bytes of info per glyph: 16-bit glyph ID, 32-bit x and y coords }
+
+ @d free_native_glyph_info(#) ==
+ begin
+- if native_glyph_info_ptr(#) <> 0 then begin
+- libc_free(cast_to_ptr(native_glyph_info_ptr(#)));
+- native_glyph_info_ptr(#) := 0;
++ if native_glyph_info_ptr(#) <> null_ptr then begin
++ libc_free(native_glyph_info_ptr(#));
++ native_glyph_info_ptr(#) := null_ptr;
+ native_glyph_count(#) := 0;
+ end
+ end
+@@ -736,10 +735,10 @@
+ @p procedure copy_native_glyph_info(src:pointer; dest:pointer);
+ var glyph_count:integer;
+ begin
+- if native_glyph_info_ptr(src) <> 0 then begin
++ if native_glyph_info_ptr(src) <> null_ptr then begin
+ glyph_count := native_glyph_count(src);
+- native_glyph_info_ptr(dest) := cast_to_integer(xmalloc_array(char, glyph_count * native_glyph_info_size));
+- memcpy(cast_to_ptr(native_glyph_info_ptr(dest)), cast_to_ptr(native_glyph_info_ptr(src)), glyph_count * native_glyph_info_size);
++ native_glyph_info_ptr(dest) := xmalloc_array(char, glyph_count * native_glyph_info_size);
++ memcpy(native_glyph_info_ptr(dest), native_glyph_info_ptr(src), glyph_count * native_glyph_info_size);
+ native_glyph_count(dest) := glyph_count;
+ end
+ end;
+@@ -2936,8 +2935,7 @@
+ end
+
+ @ @=
+-while (q <> null) and (not is_char_node(q))
+- and ( (type(q) = disc_node) or ((type(q) = whatsit_node) and (subtype(q) = deleted_native_node)) ) do
++while (q <> null) and (not is_char_node(q)) and (type(q) = disc_node) do
+ q := link(q)
+
+ @ We ought to give special care to the efficiency of one part of |hlist_out|,
+@@ -3293,7 +3291,6 @@
+ or (subtype(v)=pic_node)
+ or (subtype(v)=pdf_node)
+ then break_width[1]:=break_width[1]-width(v)
+- else if subtype(v)=deleted_native_node then do_nothing
+ else confusion("disc1a");
+ othercases confusion("disc1")
+ @z
+@@ -3307,7 +3304,6 @@
+ or (subtype(s)=pic_node)
+ or (subtype(s)=pdf_node)
+ then break_width[1]:=break_width[1]+width(s)
+- else if subtype(s)=deleted_native_node then do_nothing
+ else confusion("disc2a");
+ othercases confusion("disc2")
+ @z
+@@ -3327,7 +3323,6 @@
+ or (subtype(s)=pic_node)
+ or (subtype(s)=pdf_node)
+ then disc_width:=disc_width+width(s)
+- else if subtype(s)=deleted_native_node then do_nothing
+ else confusion("disc3a");
+ othercases confusion("disc3")
+ @z
+@@ -3341,7 +3336,6 @@
+ or (subtype(s)=pic_node)
+ or (subtype(s)=pdf_node)
+ then act_width:=act_width+width(s)
+- else if subtype(s)=deleted_native_node then do_nothing
+ else confusion("disc4a");
+ othercases confusion("disc4")
+ @z
+@@ -3784,7 +3778,7 @@
+ @!main_p:pointer; {temporary register for list manipulation}
+ @y
+ @!main_p:pointer; {temporary register for list manipulation}
+-@!main_pp:pointer; {another temporary register for list manipulation}
++@!main_pp,@!main_ppp:pointer; {more temporary registers for list manipulation}
+ @!main_h:pointer; {temp for hyphen offset in native-font text}
+ @!is_hyph:boolean; {whether the last char seen is the font's hyphenchar}
+ @z
+@@ -3859,11 +3853,22 @@
+
+ if mode=hmode then begin
+
++ main_ppp := head;
++ if main_ppp<>main_pp then
++ while (link(main_ppp)<>main_pp) do
++ main_ppp:=link(main_ppp); { find node preceding tail }
++
+ temp_ptr := str_start_macro(str_ptr);
+ repeat
+ if main_h = 0 then main_h := main_k;
+
+- if (not is_char_node(main_pp)) and (type(main_pp)=whatsit_node) and (subtype(main_pp)=native_word_node) and (native_font(main_pp)=main_f) then begin
++ if (not is_char_node(main_pp))
++ and (type(main_pp)=whatsit_node)
++ and (subtype(main_pp)=native_word_node)
++ and (native_font(main_pp)=main_f)
++ and (main_ppp<>main_pp)
++ and type(main_ppp)<>disc_node
++ then begin
+
+ { make a new temp string that contains the concatenated text of |tail| + the current word/fragment }
+ main_k := main_h + native_length(main_pp);
+@@ -3888,9 +3893,13 @@
+ do incr(main_h); { look for next hyphen or end of text }
+ if (main_h < main_k) then incr(main_h);
+
+- { flag the previous node as no longer valid }
+- free_native_glyph_info(main_pp);
+- subtype(main_pp) := deleted_native_node;
++ { remove the preceding node from the list }
++ link(main_ppp) := link(main_pp);
++ link(main_pp) := null;
++ flush_node_list(main_pp);
++ main_pp := tail;
++ while (link(main_ppp)<>main_pp) do
++ main_ppp:=link(main_ppp);
+
+ end else begin
+
+@@ -3929,9 +3938,14 @@
+ set_native_char(tail, main_p + native_length(main_pp), str_pool[str_start_macro(str_ptr) + main_p]);
+ set_native_metrics(tail, XeTeX_use_glyph_metrics);
+
+- { flag the previous node as no longer valid }
+- free_native_glyph_info(main_pp);
+- subtype(main_pp) := deleted_native_node;
++ { remove the preceding node from the list }
++ main_p := head;
++ if main_p<>main_pp then
++ while link(main_p)<>main_pp do
++ main_p := link(main_p);
++ link(main_p) := link(main_pp);
++ link(main_pp) := null;
++ flush_node_list(main_pp);
+ end else begin
+ { package the current string into a |native_word| whatsit }
+ link(main_pp) := new_native_word_node(main_f, main_k);
+@@ -3997,7 +4011,6 @@
+ @y
+ if type(p)<>kern_node then if type(p)<>ligature_node then
+ if (type(p)<>whatsit_node) or ((subtype(p)<>native_word_node)
+- and (subtype(p)<>deleted_native_node)
+ and (subtype(p)<>glyph_node)) then
+ begin print_err("Improper discretionary list");
+ @z
+@@ -4802,8 +4815,10 @@
+ print_char(" ");
+ print_native_word(p);
+ end;
++@{
+ deleted_native_node:
+ print("[DELETED]");
++@}
+ glyph_node:begin
+ print_esc(font_id_text(native_font(p)));
+ print(" glyph#");
+@@ -4837,12 +4852,9 @@
+ r:=get_node(words);
+ while words > 0 do
+ begin decr(words); mem[r+words]:=mem[p+words]; end;
+- native_glyph_info_ptr(r):=0; native_glyph_count(r):=0;
++ native_glyph_info_ptr(r):=null_ptr; native_glyph_count(r):=0;
+ copy_native_glyph_info(p, r);
+ end;
+-deleted_native_node: begin words:=native_size(p);
+- r:=get_node(words);
+- end;
+ glyph_node: begin r:=get_node(glyph_node_size);
+ words:=glyph_node_size;
+ end;
+@@ -4858,7 +4870,6 @@
+ othercases confusion("ext3")
+ @y
+ native_word_node: begin free_native_glyph_info(p); free_node(p,native_size(p)); end;
+-deleted_native_node: free_node(p,native_size(p));
+ glyph_node: free_node(p,glyph_node_size);
+ pic_node,pdf_node: free_node(p,total_pic_node_size(p));
+ pdf_save_pos_node:
+@@ -5106,7 +5117,7 @@
+ dvi_two(native_glyph(p));
+ cur_h := cur_h + width(p);
+ end else begin
+- if native_glyph_info_ptr(p) <> 0 then begin
++ if native_glyph_info_ptr(p) <> null_ptr then begin
+ len := make_xdv_glyph_array_data(p);
+ for k := 0 to len-1 do
+ dvi_out(xdv_buffer_byte(k));
+@@ -5231,7 +5242,7 @@
+ @x
+ language_node:do_nothing;
+ @y
+-language_node,deleted_native_node:do_nothing;
++language_node:do_nothing;
+ @z
+
+ @x
+@@ -6012,6 +6023,11 @@
+ goto next_p;
+
+ @ Here we compute the effective width of a glue node as in |hlist_out|.
++
++@=
++glue_node: begin round_glue;
++ @;
++ end;
+ @z
+
+ @x
+@@ -6106,7 +6122,7 @@
+ native_length(q) := n;
+
+ native_glyph_count(q) := 0;
+- native_glyph_info_ptr(q) := 0;
++ native_glyph_info_ptr(q) := null_ptr;
+
+ new_native_word_node := q;
+ end;
+@@ -6163,7 +6179,7 @@
+
+ native_size(p) := native_node_size + 1;
+ native_glyph_count(p) := 0;
+- native_glyph_info_ptr(p) := 0;
++ native_glyph_info_ptr(p) := null_ptr;
+ native_font(p) := f;
+
+ if c > @"FFFF then begin
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex.defines
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/xetex.defines 2006-12-06 18:29:15.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex.defines 2007-08-13 16:22:35.000000000 +0200
+@@ -32,6 +32,8 @@
+
+ { xetex.defines: additions for xetex }
+
++@define @field ptr;
++@define const nullptr;
+ @define type voidpointer;
+ @define function getnativechar();
+ @define procedure setnativechar();
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex.h
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/xetex.h 2006-12-06 18:29:15.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex.h 2007-08-13 16:22:35.000000000 +0200
+@@ -63,8 +63,7 @@
+
+ #define dviopenout(f) open_dvi_output(&(f))
+
+-#define casttoptr(x) (void*)(x)
+-#define casttointeger(x) (long)(x)
++#define nullptr (NULL)
+ #define glyphinfobyte(p,k) ((unsigned char*)p)[k]
+ #define casttoushort(x) (unsigned short)(x)
+
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex.mk
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/xetex.mk 2007-08-13 16:22:35.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex.mk 2007-08-13 16:22:35.000000000 +0200
+@@ -279,7 +279,7 @@
+
+ xefmtdir = $(web2cdir)/xetex
+ $(xefmtdir)::
+- $(SHELL) $(top_srcdir)/../mkinstalldirs $(xefmtdir)
++ $(SHELL) $(top_srcdir)/../mkinstalldirs ${DESTDIR}$(xefmtdir)
+
+ xetex.fmt: xetex
+ $(dumpenv) $(MAKE) progname=xetex files="xetex.ini unicode-letters.tex plain.tex cmr10.tfm" prereq-check
+@@ -298,7 +298,7 @@
+
+ install-programs: @XETEX@ install-xetex-programs
+ install-xetex-programs: xetex $(bindir)
+- for p in xetex; do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
++ for p in xetex; do $(INSTALL_LIBTOOL_PROG) $$p ${DESTDIR}$(bindir); done
+
+ install-links: @XETEX@ install-xetex-links
+ install-xetex-links: install-xetex-programs
+@@ -308,13 +308,13 @@
+ install-fmts: @XETEX@ install-xetex-fmts
+ install-xetex-fmts: xefmts $(xefmtdir)
+ xefmts="$(all_xefmts)"; \
+- for f in $$xefmts; do $(INSTALL_DATA) $$f $(xefmtdir)/$$f; done
++ for f in $$xefmts; do $(INSTALL_DATA) $$f ${DESTDIR}$(xefmtdir)/$$f; done
+ xefmts="$(xefmts)"; \
+ for f in $$xefmts; do base=`basename $$f .fmt`; \
+- (cd $(bindir) && (rm -f $$base; $(LN) xetex $$base)); done
++ (cd ${DESTDIR}$(bindir) && (rm -f $$base; $(LN) xetex $$base)); done
+
+ install-data:: @XETEX@ install-xetex-data
+ install-xetex-pool: xetex.pool $(texpooldir)
+- $(INSTALL_DATA) xetex.pool $(texpooldir)/xetex.pool
++ $(INSTALL_DATA) xetex.pool ${DESTDIR}$(texpooldir)/xetex.pool
+
+ # end of xetex.mk
+Index: texlive-bin-2007/build/source/texk/xdvipdfmx/src/tt_cmap.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/xdvipdfmx/src/tt_cmap.c 2006-09-29 17:15:10.000000000 +0200
++++ texlive-bin-2007/build/source/texk/xdvipdfmx/src/tt_cmap.c 2007-08-13 16:22:35.000000000 +0200
+@@ -303,6 +303,9 @@
+ if (cc >= map->startCount[i]) {
+ if (map->idRangeOffset[i] == 0) {
+ gid = (cc + map->idDelta[i]) & 0xffff;
++ } else if (cc == 0xffff && map->idRangeOffset[i] == 0xffff) {
++ /* this is for protection against some old broken fonts... */
++ gid = 0;
+ } else {
+ j = map->idRangeOffset[i] - (segCount - i) * 2;
+ j = (cc - map->startCount[i]) + (j / 2);
+@@ -630,6 +633,9 @@
+ ch = c0 + j;
+ if (map->idRangeOffset[i] == 0) {
+ gid = (ch + map->idDelta[i]) & 0xffff;
++ } else if (c0 == 0xffff && c1 == 0xffff && map->idRangeOffset[i] == 0xffff) {
++ /* this is for protection against some old broken fonts... */
++ gid = 0;
+ } else {
+ gid = (map->glyphIndexArray[j+d] +
+ map->idDelta[i]) & 0xffff;
+@@ -952,6 +958,9 @@
+ ch = c0 + j;
+ if (map->idRangeOffset[i] == 0) {
+ gid = (ch + map->idDelta[i]) & 0xffff;
++ } else if (c0 == 0xffff && c1 == 0xffff && map->idRangeOffset[i] == 0xffff) {
++ /* this is for protection against some old broken fonts... */
++ gid = 0;
+ } else {
+ gid = (map->glyphIndexArray[j+d] +
+ map->idDelta[i]) & 0xffff;
--- texlive-bin-2007.dfsg.1.orig/debian/patches/22_xdvi
+++ texlive-bin-2007.dfsg.1/debian/patches/22_xdvi
@@ -0,0 +1,43 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 22_xdvi.dpatch
+##
+## DP: force input focus for the text input
+## DP: field that appears after hitting Ctrl-F (string search).
+## DP: thanks Florent, taken from tetex.
+## DP: fix segfault when hitting g with -nogrey, upstream fix from Stefan Ulrich
+
+@DPATCH@
+ build/source/texk/xdvik/dvi-draw.c | 3 +++
+ build/source/texk/xdvik/gui/search-dialog.c | 5 +++++
+ 2 files changed, 8 insertions(+)
+
+Index: texlive-bin-2006.svn3816/build/source/texk/xdvik/gui/search-dialog.c
+===================================================================
+--- texlive-bin-2006.svn3816.orig/build/source/texk/xdvik/gui/search-dialog.c 2006-01-17 22:41:51.000000000 +0100
++++ texlive-bin-2006.svn3816/build/source/texk/xdvik/gui/search-dialog.c 2007-01-26 04:00:04.000000000 +0100
+@@ -694,6 +694,11 @@
+ #ifdef MOTIF
+ XtAddCallback(searchbox_input, XmNactivateCallback, cb_search_get_term, settings);
+ #endif
++
++ /* Fix for #1499566: Force input focus for text input field */
++#ifndef MOTIF
++ XtSetKeyboardFocus(find_paned, searchbox_input);
++#endif
+
+ /*
+ * form for left row of options checkbuttons
+Index: texlive-bin-2006.svn3816/build/source/texk/xdvik/dvi-draw.c
+===================================================================
+--- texlive-bin-2006.svn3816.orig/build/source/texk/xdvik/dvi-draw.c 2006-01-17 22:41:51.000000000 +0100
++++ texlive-bin-2006.svn3816/build/source/texk/xdvik/dvi-draw.c 2007-01-26 04:00:04.000000000 +0100
+@@ -1255,6 +1255,9 @@
+ do_color_change();
+ }
+ #endif
++ if (pixeltbl == NULL) {
++ do_color_change();
++ }
+
+ /* TODO: rounding errors causing color fringing (see HACK comment below):
+
--- texlive-bin-2007.dfsg.1.orig/debian/patches/13_fmtutil_fixes
+++ texlive-bin-2007.dfsg.1/debian/patches/13_fmtutil_fixes
@@ -0,0 +1,83 @@
+# 13_fmtutil_fixes
+#
+# Remove the following calls to BuildFormat:
+# - texmf/bin-metafont.tpm BuildFormat/metafont
+# call moved to texlive-base/metafont.tpm
+# - texmf/bin-etex.tpm BuildFormat/etex
+# call moved to texlive-base/plain.tpm
+# - texmf/bin-pdftex.tpm BuildFormat/pdftex
+# call moved to texlive-base/plain.tpm
+# - texmf/bin-tex.tpm BuildFormat/tex
+# call moved to texlive-base/plain.tpm
+# (see texlive-base/debian/patches/10_fmtutil_fixes)
+#
+# Reason behind: the ini files are only available in the texlive-base
+# package.
+#
+# We don't need to fix the formats.XXXX.cnf files itself, because they will
+# not be read at all. But we have to included FIXES format.XXXX.cnf files
+# in texlive-base, because the postrm script uses the information therein
+# to remove the formats.
+
+ texmf/tpm/bin-etex.tpm | 3 ---
+ texmf/tpm/bin-metafont.tpm | 3 ---
+ texmf/tpm/bin-pdftex.tpm | 3 ---
+ texmf/tpm/bin-tex.tpm | 3 ---
+ 4 files changed, 12 deletions(-)
+
+Index: texlive-bin-2007/texmf/tpm/bin-metafont.tpm
+===================================================================
+--- texlive-bin-2007.orig/texmf/tpm/bin-metafont.tpm 2007-02-07 12:34:15.000000000 +0100
++++ texlive-bin-2007/texmf/tpm/bin-metafont.tpm 2007-05-21 13:02:53.000000000 +0200
+@@ -94,9 +94,6 @@
+
+
+
+-
+-
+-
+ TLCore/bin-metafont
+
+
+Index: texlive-bin-2007/texmf/tpm/bin-etex.tpm
+===================================================================
+--- texlive-bin-2007.orig/texmf/tpm/bin-etex.tpm 2007-05-21 13:05:05.000000000 +0200
++++ texlive-bin-2007/texmf/tpm/bin-etex.tpm 2007-05-21 13:05:53.000000000 +0200
+@@ -51,9 +51,6 @@
+
+
+
+-
+-
+-
+ TLCore/bin-etex
+
+
+Index: texlive-bin-2007/texmf/tpm/bin-pdftex.tpm
+===================================================================
+--- texlive-bin-2007.orig/texmf/tpm/bin-pdftex.tpm 2007-05-21 13:05:29.000000000 +0200
++++ texlive-bin-2007/texmf/tpm/bin-pdftex.tpm 2007-05-21 13:05:44.000000000 +0200
+@@ -212,9 +212,6 @@
+
+
+
+-
+-
+-
+ TLCore/bin-pdftex
+
+
+Index: texlive-bin-2007/texmf/tpm/bin-tex.tpm
+===================================================================
+--- texlive-bin-2007.orig/texmf/tpm/bin-tex.tpm 2007-05-21 13:05:24.000000000 +0200
++++ texlive-bin-2007/texmf/tpm/bin-tex.tpm 2007-05-21 13:06:00.000000000 +0200
+@@ -56,9 +56,6 @@
+
+
+
+-
+-
+-
+ TLCore/bin-tex
+
+
--- texlive-bin-2007.dfsg.1.orig/debian/patches/a2ping-man-fixes
+++ texlive-bin-2007.dfsg.1/debian/patches/a2ping-man-fixes
@@ -0,0 +1,522 @@
+a2ping-man-fixes
+remove all .pl extensions of a2ping in the a2ping script and its pod
+documentation. Then also update the man page
+---
+ build/source/texk/tetex/a2ping | 38 +++----
+ texmf/doc/man/man1/a2ping.1 | 221 ++++++++++++++++++++++++++++-------------
+ 2 files changed, 170 insertions(+), 89 deletions(-)
+
+Index: texlive-bin-2007/build/source/texk/tetex/a2ping
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/tetex/a2ping 2007-06-29 08:08:38.000000000 +0200
++++ texlive-bin-2007/build/source/texk/tetex/a2ping 2007-06-29 08:09:39.000000000 +0200
+@@ -12,8 +12,8 @@
+ #
+ # !! Imp: merge back to a2ping.pa
+ # !! Ghostcript compute pipe too slow
+-# $ a2ping.pl -v debrecen-hyph.ps de brecen-hyph.pdf
+-# a2ping.pl 2.77p, 2004-04-28 -- Written by from April 2003.
++# $ a2ping -v debrecen-hyph.ps de brecen-hyph.pdf
++# a2ping 2.77p, 2004-04-28 -- Written by from April 2003.
+ # This is free software, GNU GPL >=2.0. There is NO WARRANTY.
+ # (epstopdf 2.7 Copyright 1998-2001 by Sebastian Rahtz et al.)
+ # * Strongest BoundingBox comment: %%HiResBoundingBox:
+@@ -340,7 +340,7 @@
+ BEGIN{$ INC{'Htex/a2ping.pm'}='Htex/a2ping.pm'}
+
+ package Htex::a2ping;
+-# a2ping.pl -- convert between PS, EPS and PDF and other page description formats
++# a2ping -- convert between PS, EPS and PDF and other page description formats
+ # by pts@fazekas.hu et al. at Wed Apr 16 14:54:13 CEST 2003
+ # a2ping.pa created at Sun Apr 20 22:25:47 2003
+ #
+@@ -358,7 +358,7 @@
+ # Imp: gs(704?!) sometimes finds too small bbox, see Univers.eps
+ # Imp: respect bbox in METAPOST %! (not EPS), don't use Compute-GS T-
+ # Imp: -sPDFPassword=...
+-# Imp: `a2ping.pl -v jf.eps pdf1: t.pdf' PDF1: must be forced to have --below
++# Imp: `a2ping -v jf.eps pdf1: t.pdf' PDF1: must be forced to have --below
+ # Imp: option to `clip' an EPS to the specified bbox -- does file size decrease?
+ # Imp: fix bug a2ping -v ~/a2ping_bug.ps a2ping_bug.pdf; running type1fix on
+ # all fonts with dff.pl has fixed the problem
+@@ -387,7 +387,7 @@
+ # Imp: possibly accept /PageSize from %%DocumentMedia
+ # Imp: /DocumentMedia seems to screw up sub-pt placement in gv(1)
+ #
+-# Dat: example: a2ping.pl --extra=-c:ijg:50 -r86 nn1.eps nn1.jpg
++# Dat: example: a2ping --extra=-c:ijg:50 -r86 nn1.eps nn1.jpg
+ # Dat: calling ``showpage'' is not required for -sDEVICE=pdfwrite with gs 6.50,
+ # but -sDEVICE=pgmraw depends on it
+ # Dat: the functionality of pdfboxes.pl cannot be provided here with a shorter
+@@ -400,7 +400,7 @@
+ # /ImagingBBox /HWResolution /HWSize /.MediaSize (we undef all)
+
+ ### program identification
+-my $program = "a2ping.pl";
++my $program = "a2ping";
+ my $filedate="2007-03-07"; # my $filedate="2001/03/05";
+ my $copyright = "Written by from April 2003.
+ This is free software, GNU GPL >=2.0. There is NO WARRANTY.
+@@ -1439,7 +1439,7 @@
+ # chance to override its settings.) So we emit a fake
+ # %%BeginSetup..%%EndSetup pair just before our code doing
+ # `setpagedevice'.
+- # !! ?? run pstops first, and then a2ping.pl
++ # !! ?? run pstops first, and then a2ping
+ # !! why does a PDF -> PS conversion need $is_restored?
+ # vvv Dat: `mark' is necessary, because pstops 1.17 from xpdf(1) emits lines
+ # lines leaving `false' on the stack:
+@@ -1974,7 +1974,7 @@
+ my $ofn=$OutputFilename;
+ if (is_via_sam2p()) {
+ # Dat: fortunately the following file format names are commin in sam2p(1)
+- # and a2ping.pl: PNG XWD BMP TIFF JPEG GIF XPM
++ # and a2ping: PNG XWD BMP TIFF JPEG GIF XPM
+ @pnm2sampled_cmd=('sam2p',"$FileFormat:",'--'); # Imp: use convert(1) if no sam2p(1)
+ $ofn=fix_force_out('SS.pnm');
+ push @pnm2sampled_cmd, $ofn, $OutputFilename;
+@@ -2263,7 +2263,7 @@
+ if (@pnm2sampled_cmd) { # $scale3_pnm_fn -> $OutputFilename
+ do_system @pnm2sampled_cmd; # Dat: uses @extra -- really share that?
+ temp_unlink $scale3_pnm_fn;
+-} else { # BUGFIX for `a2ping.pl -v --antialias=no negyzet.eps negyzet.png' at Wed Jul 20 21:34:29 CEST 2005
++} else { # BUGFIX for `a2ping -v --antialias=no negyzet.eps negyzet.png' at Wed Jul 20 21:34:29 CEST 2005
+ fix_close_out();
+ }
+ undef $unlink_OutputFilename;
+@@ -2298,14 +2298,14 @@
+
+ =head1 NAME
+
+-a2ping.pl -- convert between PS, EPS and PDF and other page description
++a2ping -- convert between PS, EPS and PDF and other page description
+ formats
+
+ =head1 SYNOPSIS
+
+-Z<> B [B<-->]B
+- B [B<-->]B
+- B [I] > [[I:] I]
++Z<> B [B<-->]B
++ B [B<-->]B
++ B [I] > [[I:] I]
+
+ =head1 DESCRIPTION
+
+@@ -2338,8 +2338,8 @@
+
+ =head1 EXTERNAL PROGRAMS
+
+-The internal file format of B is PS/EPS. Everything read is
+-first converted to PS or EPS, then processed by B, then
++The internal file format of B is PS/EPS. Everything read is
++first converted to PS or EPS, then processed by B, then
+ converted to the output format.
+
+ To analyse the bounding box and other properties of non-EPS PS files
+@@ -2352,7 +2352,7 @@
+
+ Sampled input formats are PNG, JPEG, TIFF, PNM, BMP, GIF, LBM, XPM, PCX
+ and TGA. To read sampled input formats, B is used. B is
+-a raster image converter written in C++ by the author of B.
++a raster image converter written in C++ by the author of B.
+
+ Extra output formats are PNG, XWD, BMP, TIFF, JPEG, GIF and XPM. To
+ write extra output formats, B and GS are used.
+@@ -2455,7 +2455,7 @@
+ =item *
+
+ If your EPS contains a wrong bounding box, you can fix it by running
+-C
++C
+
+ =item *
+
+@@ -2481,7 +2481,7 @@
+ =item *
+
+ If you have an incompatible PS that GS can read but your printer cannot print,
+-just run C
++just run C
+
+ =item *
+
+@@ -2644,7 +2644,7 @@
+ * improved bbox discovery
+ * many bugfixes
+ * MetaPost EPS input fixes for prologues:=0;
+- * a2ping.pl -v --papersize=50,60 --bboxfrom=compute-gs t.ps t2.ps
++ * a2ping -v --papersize=50,60 --bboxfrom=compute-gs t.ps t2.ps
+ * consistent bbox, --PageSize, /PageSize handling
+ * consistent --Resolution and --Duplex handling
+
+Index: texlive-bin-2007/texmf/doc/man/man1/a2ping.1
+===================================================================
+--- texlive-bin-2007.orig/texmf/doc/man/man1/a2ping.1 2007-06-29 08:09:50.000000000 +0200
++++ texlive-bin-2007/texmf/doc/man/man1/a2ping.1 2007-06-29 08:10:05.000000000 +0200
+@@ -1,4 +1,4 @@
+-.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.13
++.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
+ .\"
+ .\" Standard preamble:
+ .\" ========================================================================
+@@ -25,11 +25,11 @@
+ ..
+ .\" Set up some character translations and predefined strings. \*(-- will
+ .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+-.\" double quote, and \*(R" will give a right double quote. | will give a
+-.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
+-.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
+-.\" expand to `' in nroff, nothing in troff, for use with C<>.
+-.tr \(*W-|\(bv\*(Tr
++.\" double quote, and \*(R" will give a right double quote. \*(C+ will
++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
++.\" nothing in troff, for use with C<>.
++.tr \(*W-
+ .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+ .ie n \{\
+ . ds -- \(*W-
+@@ -129,7 +129,7 @@
+ .\" ========================================================================
+ .\"
+ .IX Title "A2PING 1"
+-.TH A2PING 1 "2004-05-26" "perl v5.8.1" "User Contributed Perl Documentation"
++.TH A2PING 1 "2007-06-29" "perl v5.8.8" "User Contributed Perl Documentation"
+ .ds pts-dev \*[.T]
+ .do if '\*[.T]'ascii' .ds pts-dev tty
+ .do if '\*[.T]'ascii8' .ds pts-dev tty
+@@ -145,13 +145,13 @@
+ .ad n
+
+ .SH "NAME"
+-a2ping.pl \-\- convert between PS, EPS and PDF and other page description
++a2ping \-\- convert between PS, EPS and PDF and other page description
+ formats
+ .SH "SYNOPSIS"
+ .IX Header "SYNOPSIS"
+-\&\& \fBa2ping.pl\fR [\fB\-\-\fR]\fBhelp\fR
+- \fBa2ping.pl\fR [\fB\-\-\fR]\fBdoc\fR
+- \fBa2ping.pl\fR [\fIoptions\fR] <\fIinputfile\fR> [[\fIoutformat\fR:] \fIoutputfile\fR]
++\&\& \fBa2ping\fR [\fB\-\-\fR]\fBhelp\fR
++ \fBa2ping\fR [\fB\-\-\fR]\fBdoc\fR
++ \fBa2ping\fR [\fIoptions\fR] <\fIinputfile\fR> [[\fIoutformat\fR:] \fIoutputfile\fR]
+ .SH "DESCRIPTION"
+ .IX Header "DESCRIPTION"
+ \&\fBa2ping\fR is a \s-1UNIX\s0 command line utility written in Perl that
+@@ -182,8 +182,8 @@
+ extension of the output file determines the FileFormat (\fIoutformat\fR).
+ .SH "EXTERNAL PROGRAMS"
+ .IX Header "EXTERNAL PROGRAMS"
+-The internal file format of \fBa2ping.pl\fR is \s-1PS/EPS\s0. Everything read is
+-first converted to \s-1PS\s0 or \s-1EPS\s0, then processed by \fBa2ping.pl\fR, then
++The internal file format of \fBa2ping\fR is \s-1PS/EPS\s0. Everything read is
++first converted to \s-1PS\s0 or \s-1EPS\s0, then processed by \fBa2ping\fR, then
+ converted to the output format.
+ .PP
+ To analyse the bounding box and other properties of non-EPS \s-1PS\s0 files
+@@ -196,42 +196,106 @@
+ .PP
+ Sampled input formats are \s-1PNG\s0, \s-1JPEG\s0, \s-1TIFF\s0, \s-1PNM\s0, \s-1BMP\s0, \s-1GIF\s0, \s-1LBM\s0, \s-1XPM\s0, \s-1PCX\s0
+ and \s-1TGA\s0. To read sampled input formats, \fBsam2p\fR is used. \fBsam2p\fR is
+-a raster image converter written in \*(C+ by the author of \fBa2ping.pl\fR.
++a raster image converter written in \*(C+ by the author of \fBa2ping\fR.
+ .PP
+ Extra output formats are \s-1PNG\s0, \s-1XWD\s0, \s-1BMP\s0, \s-1TIFF\s0, \s-1JPEG\s0, \s-1GIF\s0 and \s-1XPM\s0. To
+ write extra output formats, \fBsam2p\fR and \s-1GS\s0 are used.
+ .PP
+ \&\s-1PNM\s0 output formats are \s-1PGM\s0, \s-1PGM\s0 and \s-1PPM\s0. To write \s-1PNM\s0 output formats, \s-1GS\s0
+ is used.
++.SH "OPTIONS"
++.IX Header "OPTIONS"
++.Sh "General Options"
++.IX Subsection "General Options"
++.IP "\fB\-h\fR, \fB\-\-help\fR" 2
++.IX Item "-h, --help"
++Show a summary of the usage
++.IP "\fB\-\-doc\fR" 2
++.IX Item "--doc"
++Show the man page
++.IP "\fB\-v\fR, \fB\-\-(no)verbose\fR" 2
++.IX Item "-v, --(no)verbose"
++Show progress and debug messages (default: no)
++.Sh "Options for the Bounding box"
++.IX Subsection "Options for the Bounding box"
++.IP "\fB\-\-(no)hires\fR" 2
++.IX Item "--(no)hires"
++Use HiResBoundingBox in the input file, if present (default: yes)
++.IP "\fB\-\-(no)exact\fR" 2
++.IX Item "--(no)exact"
++Use ExactBoundingBox in the input file, if present (default: no)
++.IP "\fB\-\-(no)keepoldmediabox\fR" 2
++.IX Item "--(no)keepoldmediabox"
++keep only old, [0 0]\-based MediaBox in \s-1PDF\s0 (default: no)
++.IP "\fB\-\-bboxfrom=\fR\fIadsc|compute\-gs|guess|pagesize\fR" 2
++.IX Item "--bboxfrom=adsc|compute-gs|guess|pagesize"
++Method for determining the BoundingBox (default: guess)
++.IP "\fB\-\-(no)below\fR" 2
++.IX Item "--(no)below"
++Allow page content below and left of the origin (default: no)
++.Sh "Options for graphics and fonts"
++.IX Subsection "Options for graphics and fonts"
++.IP "\fB\-\-(no)compress\fR" 2
++.IX Item "--(no)compress"
++use compression (default: best)
++.IP "\fB\-\-(no)antialias\fR" 2
++.IX Item "--(no)antialias"
++render shades at outlines. Possible values: (=\fIscale3yes\fR =\fIno\fR =\fIyes\fR) (default: scale3no)
++.IP "\fB\-\-(no)lossy\fR" 2
++.IX Item "--(no)lossy"
++allow lossy image filters (\s-1EPS\-\s0>\s-1PDF\s0) (default: yes)
++.IP "\fB\-\-papersize=\fR\fIunchanged|force\-unknown|600bpx5cm\fR" 2
++.IX Item "--papersize=unchanged|force-unknown|600bpx5cm"
++(default: default) (bp)
++.IP "\fB\-\-threshold=\fR" 2
++.IX Item "--threshold="
++min color for 1 in 8\->1 bit conv (default: 128)
++.Sh "Options for debugging and changing internals"
++.IX Subsection "Options for debugging and changing internals"
++.IP "\fB\-\-(no)tmpunlink\fR" 2
++.IX Item "--(no)tmpunlink"
++Unlink temporary files (default: yes). Use \fB\-\-notmpunklink\fR if you
++want to inspect intermediate files.
++.IP "\fB\-\-gs\-cmd=\fR\fIpath\fR" 2
++.IX Item "--gs-cmd=path"
++path to Ghostscript program (default: gs or gswin32c)
++.IP "\fB\-\-gs\-ccmd=\fR\fIpath\fR" 2
++.IX Item "--gs-ccmd=path"
++path to Ghostscript for BoundingBox calculation (default: gs or gswin32c)
++.IP "\fB\-\-gsextra=\fR\fI\s-1GS_ARGS\s0\fR" 2
++.IX Item "--gsextra=GS_ARGS"
++Pass extra arguments to gs
++.IP "\fB\-\-extra=\fR" 2
++.IX Item "--extra="
++Pass extra arguments to external program (i.e pdftops)
+ .SH "TIPS AND TRICKS"
+ .IX Header "TIPS AND TRICKS"
+-.IP "\(bu" 2
+-Call with the \fB\-v\fR option to see progress and debug messages.
+-.IP "\(bu" 2
++.RS 2
++.IP "*" 2
+ If your \s-1EPS\s0 contains a wrong bounding box, you can fix it by running
+-\&\f(CW\*(C`a2ping.pl \-v \-\-bboxfrom=compute\-gs thefile.eps \-\-\*(C'\fR
+-.IP "\(bu" 2
++\&\f(CW\*(C`a2ping \-v \-\-bboxfrom=compute\-gs thefile.eps \-\-\*(C'\fR
++.IP "*" 2
+ You can specify \fB\-\fR as \fIinputfile\fR to get stdin and as \fIoutputfile\fR
+ to get stdout. This works even for \s-1PDF\s0 files (which must be seekable),
+ because \fBa2ping\fR copies them to a temporary file automatically.
+-.IP "\(bu" 2
++.IP "*" 2
+ If \fIinputfile\fR and \fIoutputfile\fR are the same, \fBa2ping\fR copies the
+ \&\fIinputfile\fR to a temporary location first. However, this usage is
+ recommended only if there is a backup of the file to be restored in case
+ \&\fBa2ping\fR doesn't produce the desired result.
+-.IP "\(bu" 2
++.IP "*" 2
+ If you specify \fB\-\-\fR as \fIoutputfile\fR, it will be the same as \fIinputfile\fR.
+-.IP "\(bu" 2
++.IP "*" 2
+ \&\fBa2ping\fR respects \fB\-\-Duplex\fR for FileFormat \s-1PCL5\s0, even though \s-1GS\s0 doesn't.
+-.IP "\(bu" 2
++.IP "*" 2
+ If you have an incompatible \s-1PS\s0 that \s-1GS\s0 can read but your printer cannot print,
+-just run \f(CW\*(C`a2ping.pl foo.ps PDF: \- | a2ping.pl \- PS: foo.ps\*(C'\fR
+-.IP "\(bu" 2
++just run \f(CW\*(C`a2ping foo.ps PDF: \- | a2ping \- PS: foo.ps\*(C'\fR
++.IP "*" 2
+ If you have a \s-1PS\s0 coming from Win32 (often with extension \f(CW\*(C`.prn\*(C'\fR), run
+ it through \fBa2ping\fR. It will remove the resolution changes and the
+ progress text printed to the terminal (which confuses \fIgv\fR\|(1) and makes
+ some filters in the print queue emit incorrect output).
+-.IP "\(bu" 2
++.IP "*" 2
+ \&\fBa2ping\fR does antialiasing (\fB\-\-antialias=scale3no\fR) of glyphs and
+ curves when emitting a sampled image (FileFormats such as \s-1PGM\s0 and \s-1PPM\s0).
+ This improves readability of the glyphs. \fB=yes\fR instructs \s-1GS\s0 to do
+@@ -240,49 +304,59 @@
+ as big, and then scales it back down. \fB=scale3no\fR turns on both 3x3
+ scaling and \s-1GS\s0 internal antialiasing, which results in thicker lines and
+ worse quality in general.
+-.IP "\(bu" 2
++.IP "*" 2
+ When creating a \s-1PBM\s0 file, antialiasing usually doesn't improve the
+ quality, so it is switched off by default. But if you set
+ \&\fB\-\-antialias=scale3no\fR or \fB\-\-antialias=scale3yes\fR, \s-1GS\s0 will render a \s-1PGM\s0 file,
+ and the value of \fB\-\-threshold\fR determines the minimum intensity for white in
+ the final \s-1PBM\s0.
+-.IP "\(bu" 2
++.IP "*" 2
+ If you need a bigger sampled output file, specify a larger
+ \&\fB\-\-Resolution\fR. The default is \fB\-\-Resolution=72\fR. If your sampled output file
+ is going to be really big, you should specify \fB\-\-AntiAlias=yes\fR instead of
+ the default \fB\-\-AntiAlias=scale3no\fR to speed up conversion.
++.IP "*" 2
++To make sure fonts are included in a \s-1PDF\s0 file generated from eps, use
++\&\fB\-\-gsextra='\-dEmbedAllFonts=true \-dPDFSETTINGS=/printer'\fR.
++.RE
++.RS 2
+ .SH "MISC"
+ .IX Header "MISC"
+-.IP "\(bu" 2
++.IP "*" 2
+ Doesn't depend on the filename or extension of the input file.
+-.IP "\(bu" 2
++.IP "*" 2
+ Conversion from \s-1EPS\s0 to \s-1PDF:\s0 fixes glitches etc., calls gs
+ \&\-sDEVICE=pdfwrite
+-.IP "\(bu" 2
++.IP "*" 2
+ Conversion from \s-1EPS\s0 to \s-1EPS:\s0 fixes various glitches, moves (llx,lly) to
+ (0,0), removes binary junk from the beginning of the \s-1EPS\s0 etc.
+-.IP "\(bu" 2
++.IP "*" 2
+ Conversion from \s-1PDF\s0 to \s-1PDF:\s0 keeps the file intact
+-.IP "\(bu" 2
++.IP "*" 2
+ Conversion from \s-1PDF\s0 to \s-1EPS:\s0 calls pdftops \-eps (of the xpdf package)
+-.IP "\(bu" 2
++.IP "*" 2
+ Conversion from \s-1PS\s0 to \s-1EPS:\s0 keeps 1st page only, removes setpagedevice etc.
++.RE
++.RS 2
+ .SH "AUTHORS"
+ .IX Header "AUTHORS"
+-The author of \fBa2ping\fR is Szab Pter <\fIpts@fazekas.hu\fR>.
+-.PP
++The author of \fBa2ping\fR is Pter Szab <\fIpts@fazekas.hu\fR>.
++.Sp
+ \&\fBa2ping\fR is inspired by and historically based on the \fBepstopdf\fR Perl
+ script modified by Thomas Esser, Sept. 1998, but his modifications have
+ been removed from \fBa2ping\fR, and also \fBa2ping\fR and \fBepstopdf\fR do not
+ share common code anymore. \fBepstopdf\fR is written by Sebastian Rahtz,
+ for Elsevier Science. \fBepstopdf\fR contained extra tricks from Hans Hagen's
+ texutil.
++.Sp
++\&\fBa2ping\fR contains contributions from several people, see the \s-1HISTORY\s0 for
++details. Thank you all for contributing!
+ .SH "HISTORY"
+ .IX Header "HISTORY"
+ .Sh "1999/05/06 v2.5 (Heiko Oberdiek)"
+ .IX Subsection "1999/05/06 v2.5 (Heiko Oberdiek)"
+ .Vb 14
+-\& * New options: --hires, --exact, --filter, --help.
++\& * New options: \-\-hires, \-\-exact, \-\-filter, \-\-help.
+ \& * Many cosmetics: title, usage, ...
+ \& * New code for debug, warning, error
+ \& * Detecting of cygwin perl
+@@ -308,73 +382,80 @@
+ \& * Newline before grestore for the case that there is no
+ \& whitespace at the end of the eps file.
+ .Ve
+-.Sh "2003/02/02 (Szab Pter)"
+-.IX Subsection "2003/02/02 (Szab Pter)"
++.Sh "2003/02/02 (Pter Szab)"
++.IX Subsection "2003/02/02 (Pter Szab)"
+ .Vb 10
+-\& * option --below
++\& * option \-\-below
+ \& * removes DOS EPSF binary junk correctly
+ \& * adds all 3 BoundingBox DSC comments
+ \& * reads all 3 BoundingBox DSC comments, and picks the best
+ \& * forces BoundingBox to be an integer
+-\& * adds %%EndComments and proper %!PS-Adobe-?-? EPSF-?.? header
++\& * adds %%EndComments and proper %!PS\-Adobe\-?\-? EPSF\-?.? header
+ \& * adds %%Pages:
+ \& * adds invocation syntax: a2ping
+ \& * can convert PDF to EPS (by calling pdftops(1)) and PDF to PDF
+ \& * emulates work for PDF input
+ .Ve
+-.Sh "2003/04/16 (Szab Pter)"
+-.IX Subsection "2003/04/16 (Szab Pter)"
++.Sh "2003/04/16 (Pter Szab)"
++.IX Subsection "2003/04/16 (Pter Szab)"
+ .Vb 7
+ \& * added PS and sam2p support, renamed to a2ping
+-\& * sam2p and pdftops if $InputFilename eq '-';
++\& * sam2p and pdftops if $InputFilename eq '\-';
+ \& * remove PJL UEL header from the beginning
+-\& * works for PS non-EPS files for input
++\& * works for PS non\-EPS files for input
+ \& * input support for PNG JPEG TIFF PNM BMP GIF LBM XPM PCX TGA via sam2p
+ \& * removes ^L (form feed) from end of EPS file
+-\& * -x=-c:rle to add sam2p options
++\& * \-x=\-c:rle to add sam2p options
+ .Ve
+-.Sh "2003/04/26 (Szab Pter)"
+-.IX Subsection "2003/04/26 (Szab Pter)"
++.Sh "2003/04/26 (Pter Szab)"
++.IX Subsection "2003/04/26 (Pter Szab)"
+ .Vb 14
+ \& * omit the unnecessary setpagedevice calls when creating normal eps
+-\& * --noverbose --nocompress supported differently
+-\& * no more option defaults :-(
++\& * \-\-noverbose \-\-nocompress supported differently
++\& * no more option defaults :\-(
+ \& * justlib2
+-\& * multi-page output with PS:, PDF:, PCL5:
+-\& * after `a2ping -pa4', file out.pcl says: `HP PCL printer data - A4 page
++\& * multi\-page output with PS:, PDF:, PCL5:
++\& * after `a2ping \-pa4', file out.pcl says: `HP PCL printer data \- A4 page
+ \& size', instead of `US letter'
+-\& * justlib2-ified doesn't depend on Getopt::Long anymore
++\& * justlib2\-ified doesn't depend on Getopt::Long anymore
+ \& * fully supports filtering (stdin and/or stdout), PDF and PCL5 output to
+ \& pipe (!$$ll_zero)
+ \& * adds DSC ``%%DocumentMedia: plain 612 792 0 () ()''
+-\& * BoundingBox precedence for EPS input: --PageSize, %%*BoundingBox,
+-\& setpagedevice. Precedence for other inputs: --PageSize, setpagedevice,
++\& * BoundingBox precedence for EPS input: \-\-PageSize, %%*BoundingBox,
++\& setpagedevice. Precedence for other inputs: \-\-PageSize, setpagedevice,
+ \& %%*BoundingBox
+ .Ve
+-.Sh "2003/09/25 (Szab Pter)"
+-.IX Subsection "2003/09/25 (Szab Pter)"
++.Sh "2003/09/25 (Pter Szab)"
++.IX Subsection "2003/09/25 (Pter Szab)"
+ .Vb 7
+-\& * --bboxfrom=adsc: %%BoundingBox overrides -sDEVICE=bbox
++\& * \-\-bboxfrom=adsc: %%BoundingBox overrides \-sDEVICE=bbox
+ \& * improved bbox discovery
+ \& * many bugfixes
+ \& * MetaPost EPS input fixes for prologues:=0;
+-\& * a2ping.pl -v --papersize=50,60 --bboxfrom=compute-gs t.ps t2.ps
+-\& * consistent bbox, --PageSize, /PageSize handling
+-\& * consistent --Resolution and --Duplex handling
++\& * a2ping \-v \-\-papersize=50,60 \-\-bboxfrom=compute\-gs t.ps t2.ps
++\& * consistent bbox, \-\-PageSize, /PageSize handling
++\& * consistent \-\-Resolution and \-\-Duplex handling
+ .Ve
+-.Sh "2003/12/02 (Szab Pter)"
+-.IX Subsection "2003/12/02 (Szab Pter)"
++.Sh "2003/12/02 (Pter Szab)"
++.IX Subsection "2003/12/02 (Pter Szab)"
+ .Vb 1
+-\& * --bboxfrom=compute-gs option to fix PS -> EPS bbox (gs -sDEVICE=bbox), tuzv.eps
++\& * \-\-bboxfrom=compute\-gs option to fix PS \-> EPS bbox (gs \-sDEVICE=bbox), tuzv.eps
+ .Ve
+-.Sh "2004/02/10 v2.77 (Szab Pter)"
+-.IX Subsection "2004/02/10 v2.77 (Szab Pter)"
++.Sh "2004/02/10 v2.77p fixed (Pter Szab)"
++.IX Subsection "2004/02/10 v2.77p fixed (Pter Szab)"
+ .Vb 7
+-\& * the compute-pipe routine is now run unless --bboxfrom=guess with EPS
+-\& * added --gsextra=
+-\& * added --antialias=
++\& * the compute\-pipe routine is now run unless \-\-bboxfrom=guess with EPS
++\& * added \-\-gsextra=
++\& * added \-\-antialias=
+ \& * added FileFormat PBM, PGM, PPM
+ \& * separated FileFormat features to FL_* constants
+-\& * added --doc
++\& * added \-\-doc
+ \& * there is no default FileFormat (PDF) anymore
+ .Ve
++.Sh "2007/03/07 (Pter Szab and Frank Kster)"
++.IX Subsection "2007/03/07 (Pter Szab and Frank Kster)"
++.Vb 3
++\& * various improvements for tetex2 and tetex3 compatibility
++\& * various other improvements
++\& * POD documentation enhancements (font embedding tricks) by Frank Kster
++.Ve
--- texlive-bin-2007.dfsg.1.orig/debian/patches/a2ping-upstream-fixes
+++ texlive-bin-2007.dfsg.1/debian/patches/a2ping-upstream-fixes
@@ -0,0 +1,833 @@
+a2ping-upstream-fixes
+include fixes made by upstream:
+2007/03/07 (Pter Szab and Frank Kster)
+
+* various improvements for tetex2 and tetex3 compatibility
+* various other improvements
+* POD documentation enhancements (font embedding tricks) by Frank Kster
+---
+ build/source/texk/tetex/a2ping | 446 ++++++++++++++++++++++++++++++++---------
+ 1 file changed, 358 insertions(+), 88 deletions(-)
+
+Index: texlive-bin-2007/build/source/texk/tetex/a2ping
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/tetex/a2ping 2007-06-29 08:05:33.000000000 +0200
++++ texlive-bin-2007/build/source/texk/tetex/a2ping 2007-06-29 08:06:09.000000000 +0200
+@@ -10,6 +10,29 @@
+ # This program is free software, licensed under the GNU GPL, >=2.0.
+ # This software comes with absolutely NO WARRANTY. Use at your own risk!
+ #
++# !! Imp: merge back to a2ping.pa
++# !! Ghostcript compute pipe too slow
++# $ a2ping.pl -v debrecen-hyph.ps de brecen-hyph.pdf
++# a2ping.pl 2.77p, 2004-04-28 -- Written by from April 2003.
++# This is free software, GNU GPL >=2.0. There is NO WARRANTY.
++# (epstopdf 2.7 Copyright 1998-2001 by Sebastian Rahtz et al.)
++# * Strongest BoundingBox comment: %%HiResBoundingBox:
++# * Doing --PaperSize unchanged
++# * Output filename: debrecen-hyph.pdf
++# * Output FileFormat: PDF
++# * Ghostscript ps2pdf command: gs -dSAFER
++# * Compression: zip
++# * Input filename: debrecen-hyph.ps
++# * Computing BBox info from non-EPS PS file
++# * Ghostscript compute pipe: gs -dSAFER -dWRITESYSTEMDICT -dNOPAUSE -sDEVICE=bbox -sFN=debrecen-hyph.ps /tmp/a2ping_pl-16977-298938572-c.tgs 2>&1
++# * Applying BoundingBox from Compute-GS T-: 71 81 539 769
++# * Applying HiResBoundingBox from Compute-GS T-H: 71.837998 81.971997 538.235984 768.113977
++# * Scanning header for BoundingBox
++# * Applying BoundingBox from ADSC T-: 0 0 596 842
++# * Final BoundingBox: 0 0 596 842
++# * Ghostscript ps2pdf pipe: gs -dSAFER -q -dBATCH -sDEVICE=pdfwrite -sOutputFile =debrecen-hyph.pdf -
++# * Done OK, created PDF file debrecen-hyph.pdf (338451 bytes)
++#
+ package just; BEGIN{$INC{'just.pm'}='just.pm'}
+ BEGIN{ $just::VERSION=2 }
+ sub end(){1}
+@@ -329,8 +352,9 @@
+ use strict;
+ use integer;
+ use Htex::papers;
+-BEGIN { $Htex::a2ping::VERSION="2.77p" }
++BEGIN { $Htex::a2ping::VERSION="2.78p" }
+
++# Imp: option to ignore `%%Orientation: Portrait', which gs respects and rotates by 90 degrees if necessary
+ # Imp: gs(704?!) sometimes finds too small bbox, see Univers.eps
+ # Imp: respect bbox in METAPOST %! (not EPS), don't use Compute-GS T-
+ # Imp: -sPDFPassword=...
+@@ -377,7 +401,7 @@
+
+ ### program identification
+ my $program = "a2ping.pl";
+-my $filedate="2004-04-28"; # my $filedate="2001/03/05";
++my $filedate="2007-03-07"; # my $filedate="2001/03/05";
+ my $copyright = "Written by from April 2003.
+ This is free software, GNU GPL >=2.0. There is NO WARRANTY.
+ (epstopdf 2.7 Copyright 1998-2001 by Sebastian Rahtz et al.)\n";
+@@ -420,7 +444,7 @@
+ }
+ END { unlink keys %tmpfiles; }
+ sub temp_unlink($) {
+- if (exists $tmpfiles{$_[0]}) {
++ if (defined $_[0] and exists $tmpfiles{$_[0]}) {
+ unlink $_[0] if $tmpunlink_p;
+ delete $tmpfiles{$_[0]};
+ }
+@@ -436,19 +460,18 @@
+ }
+
+ #** @return arg rounded down to int
+-sub floor($) {
++sub myfloor($) {
+ # Dat: Perl int() rounds towards zero
+ no integer;
+- $_[0] < 0 ? -int(-$_[0]) : int($_[0])
++ $_[0]==int($_[0]) ? $_[0] : $_[0] < 0 ? -int(1-$_[0]) : int($_[0])
+ }
+
+ #** @return arg rounded up to int
+-sub ceil($) {
+- no integer;
+- $_[0]==int($_[0]) ? $_[0] : 1+ ($_[0] < 0 ? -int(-$_[0]) : int($_[0]))
++sub myceil($) {
++ no integer; #### BUGFIX at Wed Nov 15 17:23:29 CET 2006
++ $_[0]==int($_[0]) ? $_[0] : 1+ ($_[0] < 0 ? -int(-$_[0]) : int($_[0]));
+ }
+
+-
+ just::main;
+
+ # ---
+@@ -460,8 +483,8 @@
+ sub FL_SAMPLED(){16} # is it a sampled (raster, pixel-based)
+ sub FL_ANY_ORIGIN_OK(){32} # (llx,lly) may be anything, not just (0,0)
+ sub FL_HAS_ANTIALIAS(){64}
+-sub FL_VIA_SAM2P(){128} # sam2p(1) can convert PNM to such a format
+-sub FL_OK_SAM2P(){256}
++sub FL_VIA_SAM2P(){128} # sam2p(1) should convert PNM to such a format
++sub FL_OK_SAM2P(){256} # sam2p(1) can convert PNM to such a format
+
+ my %fmts=( # Name=>[flags]
+ 'EPS'=>[FL_PAGE1_STOP],
+@@ -511,6 +534,8 @@
+ --(no)below allow below+left_from baseline (def: no)
+ --(no)tmpunlink unlink temporary files (def: yes)
+ --(no)antialias render shades at outlines (def: scale3no) (=scale3yes =no =yes)
++--(no)lossy allow lossy image filters (EPS->PDF) (def: yes)
++--(no)keepoldmediabox keep only old, [0 0]-based MediaBox in PDF (def: no)
+ --gs-cmd= path to Ghostscript (def: gs or gswin32c)
+ --gs-ccmd= path to Ghostscript, 4 bbox calc (def: gs or gswin32c)
+ --gsextra= extra arg to gs
+@@ -547,6 +572,8 @@
+ # $::opt_filter=0; # deprecated
+ # $::opt_outputfile=undef; # deprecated
+ $::opt_below=undef;
++$::opt_keepoldmediabox=0;
++$::opt_lossy=1;
+ $::opt_antialias=undef; # render shades at path outlines for better readability
+ $::opt_gs_cmd=undef;
+ $::opt_extra="";
+@@ -634,7 +661,7 @@
+ my %argnone=qw(help 1 verbose 1 noverbose 1 nocompress 1 noantialias 1); # 0 arg
+ my %argmaybe=qw(); # 0 or 1 arg
+ my %argbool=qw(hires 1 exact 1 below 1 gs 1 filter 1 tmpunlink 1
+- approx 1); # boolean arg
++ approx 1 lossy 1 keepoldmediabox 1); # boolean arg
+ # Dat: --noverbose --nocompress
+ my $opts_ok=1;
+ for ($I=0; $I<@ARGV; $I++) {
+@@ -693,6 +720,8 @@
+ elsif ($optname eq "hires") { $::opt_hires =$optval }
+ elsif ($optname eq "exact") { $::opt_exact =$optval }
+ elsif ($optname eq "below") { $::opt_below =$optval }
++ elsif ($optname eq "keepoldmediabox") { $::opt_keepoldmediabox=$optval }
++ elsif ($optname eq "lossy") { $::opt_lossy =$optval }
+ elsif ($optname eq "approx") { $::opt_approx=$optval }
+ elsif ($optname eq "threshold") { $::opt_threshold=$optval+0 } # Imp: accept only int 0..256
+ elsif ($optname eq "filter") {
+@@ -750,8 +779,9 @@
+ $GS=$::opt_gs_cmd if defined $::opt_gs_cmd;
+ my $CGS=$GS;
+ $CGS=$::opt_gs_ccmd if defined $::opt_gs_ccmd;
+-$GS.= " -dSAFER"; # -dWRITESYSTEMDICT
+-$CGS.=" -dSAFER"; # -dWRITESYSTEMDICT
++# vvv SUXX: (r) file doesn't work with gs 8.5x -DSAFER
++#$GS.= " -dSAFER"; # -dWRITESYSTEMDICT
++#$CGS.=" -dSAFER"; # -dWRITESYSTEMDICT
+
+ ### get input and output filename
+ if (!defined $InputFilename and defined $OutputFilename) { # --filter
+@@ -863,6 +893,7 @@
+
+ #**** pts ****
+ sub read_error() { error "read $InputFilename: $!" }
++my $in_mac_p=0; # 0: "\n" or "\r\n" is line terminator; 1: "\r" is line terminator
+ my $bytes_left=-1; # -1==unlimited
+ my $already_read=0;
+ sub dem1($){defined$_[0]?$_[0]:-1}
+@@ -875,7 +906,10 @@
+ if (defined $_[0]) { read_error if 0>dem1 read IN, $S, $_[0] }
+ else {
+ $!=0; # clean up error code
+- $S=;
++ if ($in_mac_p) {
++ local $/="\r";
++ $S=~s@\r\Z(?!\n)@\n@ if defined($S=);
++ } else { $S= }
+ read_error if !defined($S) and $!;
+ $S="" if !defined $S; # EOF
+ }
+@@ -1005,6 +1039,81 @@
+ }
+ binmode IN;
+
++#** Dat: uses $FileFormat, $InputFileName, $OutputFileName
++#** @param $S prepend to pipe
++sub run_sam2p($$) {
++ my($approx_p,$S)=@_;
++ # Imp: why isn't sam2p(1) PNG -> PNG idempotent?
++ my $tfmt=$FileFormat eq'markedEPS' || $FileFormat eq 'EPS' ? 'EPS'
++ : $FileFormat eq'markedPS' || $FileFormat eq 'PS' ? 'PS' # Dat: emits no /PageSize
++ : $FileFormat eq'PDF1' || $FileFormat eq 'PDF' ? 'PDF'
++ : undef;
++ if (defined $tfmt) {}
++ elsif (is_via_sam2p() or is_ok_sam2p()) {$tfmt=$FileFormat; $::opt_approx=1}
++ else { error "sam2p doesn't support our FileFormat $FileFormat" }
++ fix_pipe_in ".img", $S, 0;
++ if ($approx_p) {
++ if ($tfmt eq 'GIF') {
++ # Dat: reduce palette to 8-bit if necessary
++ my @args=('sam2p',@extra,"$tfmt:",'--',$InputFilename,$OutputFilename);
++ debug "Running: @args";
++ my $cmd=join(' ',map{fnq$_}@args)." 2>&1";
++ my $res=readpipe($cmd);
++ if ($res=~/\binvalid combination, no applicable OutputRule\b/) {
++ # Dat: reduce palette to 8-bit
++ #die "NOR";
++ my $have_convert_p;
++ my $have_pnmquant_p=0;
++ for my $dir (split/:/,$ENV{PATH}) {
++ if ((-f"$dir/pnmquant")) { $have_pnmquant_p=1 }
++ }
++ if (!$have_pnmquant_p) {
++ $have_convert_p=0;
++ for my $dir (split/:/,$ENV{PATH}) {
++ if ((-f"$dir/convert")) { $have_convert_p=1 }
++ }
++ }
++ my $cmd;
++ if ($have_pnmquant_p) {
++ my @args1=('sam2p','PPM:','--',$InputFilename,'-');
++ my @args2=('sam2p',@extra,"$tfmt:",'--','-',$OutputFilename);
++ $cmd=join(' ',map{fnq$_}@args1)." | pnmquant 256 | ".
++ join(' ',map{fnq$_}@args2);
++ } elsif ($have_convert_p) {
++ my @args1=('sam2p','PPM:','--',$InputFilename,'-');
++ my @args2=('sam2p',@extra,"$tfmt:",'--','-',$OutputFilename);
++ # vvv Dat: `convert - GIF:-' does quantize (and emits GIF)
++ $cmd=join(' ',map{fnq$_}@args1)." | convert - GIF:- | ".
++ join(' ',map{fnq$_}@args2);
++ }
++ debug "Running pipe: $cmd";
++ exec($cmd);
++ } elsif ($? !=0) { die $res }
++ # die $cmd;
++ #debug "Running: $progname @extra @_";
++ #error "prog $progname failed: $? $!"
++ #if 0!=system $progname, @extra, @_; # Dat: non-zero exit() or not found
++ }
++ do_exec('sam2p', ("$tfmt:", '--', $InputFilename, $OutputFilename));
++ } else {
++ warning "post-processing of sam2p PDF output increases file size" if $tfmt eq 'PDF';
++ $tfmt='EPS' if $tfmt eq 'PDF'; # Imp: PDF1<->PDF
++ close IN;
++ my $tpfn=temp_prefix()."Psimg";
++ error "Cannot open temp pipe dest: $tpfn" unless open TP, "> $tpfn";
++ $tmpfiles{$tpfn}=1;
++ die unless close TP;
++ do_system('sam2p', ("$tfmt:", '--', $InputFilename, $tpfn));
++ error "Cannot open temp pipe src: $tpfn" unless open IN, "< $tpfn";
++ $already_read=0; $bytes_left=-1;
++ $InputFilename=$tpfn; # '-'
++ goto SCAN_AGAIN
++ }
++}
++
++#** Force this value for %%HiResBoundingBox if a %BoundingBox is read
++my $force_hiresbbox_value;
++
+ ### scan first line, check for DOS EPSF (and remove DOS headers)
+ my $header;
+ { SCAN_AGAIN:
+@@ -1049,44 +1158,37 @@
+ $S.=readIN;
+ $S=substr($S,1);
+ error "$InputFilename: bad HP PJL UEL header: ".(~chomp($S)&&$S)
+- if $S!~/\A%-12345X\@PJL ENTER LANGUAGE\s*=\s*POSTSCRIPT\s*\r?$/i;
++ if $S!~/\A\\e?%-12345X\@PJL ENTER LANGUAGE\s*=\s*POSTSCRIPT\s*\r?$/i;
+ 1 while length($S=readIN())!=0 and substr($S,0,4)ne'%!PS';
+ die "$InputFilename: premature HP PJL UEL header" if length($S)==0;
+ } elsif ($iff eq "P") {
+ # no-op yet, see later
+ } elsif ($iff eq "?") {
+ error "unknown input image format: $InputFilename";
+- } else { # some vector graphics format
+- # Imp: why isn't sam2p(1) PNG -> PNG idempotent?
+- my $sfmt=$FileFormat eq'markedEPS' || $FileFormat eq 'EPS' ? 'EPS'
+- : $FileFormat eq'markedPS' || $FileFormat eq 'PS' ? 'PS' # Dat: emits no /PageSize
+- : $FileFormat eq'PDF1' || $FileFormat eq 'PDF' ? 'PDF'
+- : undef;
+- if (defined $sfmt) {}
+- elsif (is_via_sam2p() or is_ok_sam2p()) {$sfmt=$FileFormat; $::opt_approx=1}
+- else { error "sam2p doesn't support our FileFormat $FileFormat" }
+- fix_pipe_in ".img", $S, 0;
+- if ($::opt_approx) {
+- do_exec('sam2p', ("$sfmt:", '--', $InputFilename, $OutputFilename));
+- } else {
+- warning "post-processing of sam2p PDF output increases file size" if $sfmt eq 'PDF';
+- $sfmt='EPS' if $sfmt eq 'PDF'; # Imp: PDF1<->PDF
+- close IN;
+- my $tpfn=temp_prefix()."Psimg";
+- error "Cannot open temp pipe dest: $tpfn" unless open TP, "> $tpfn";
+- $tmpfiles{$tpfn}=1;
+- die unless close TP;
+- do_system('sam2p', ("$sfmt:", '--', $InputFilename, $tpfn));
+- error "Cannot open temp pipe src: $tpfn" unless open IN, "< $tpfn";
+- $already_read=0; $bytes_left=-1;
+- $InputFilename=$tpfn; # '-'
+- goto SCAN_AGAIN
+- }
++ } else { # source file is in some raster graphics format
++ run_sam2p($::opt_approx,$S);
++ goto SCAN_AGAIN
+ }
+
+ # now deal with PS, EPS and PDF
+ if (substr($S,0,1) eq '%') {
+- $S.=readIN;
++ { my $max=128;
++ my $C;
++ while (length($S)<$max and defined($C=readIN(1)) and
++ $C ne "\n" and $C ne "\r") { $S.=$C }
++ error "couldn't find end of PS/PDF header line in $max bytes\n" if
++ length($S)>=$max or !defined($C);
++ $C=($C eq "\r") ? readIN(1) : "NONE";
++ if (!defined$C or ($C ne "\n" and $C ne "NONE")) {
++ use IO::Handle; # Dat: needed for ungetc
++ IN->ungetc(ord($C)) if defined $C;
++ debug "MAC \\r detected";
++ $in_mac_p=1;
++ } elsif ($C eq "\n") { # Dat: \r\n, DOS CRLF
++ $in_mac_p=0; $S.="\r";
++ } else { $in_mac_p=0 }
++ $S.="\n";
++ } # $S.=readIN;
+ if (substr($S,0,4)eq'%PDF') {
+ # error "$InputFilename: won't read a PDF file";
+ if ($FileFormat eq 'PDF') { # convert PDF to PDF
+@@ -1147,21 +1249,34 @@
+ error "closing PIPE: $?" unless close PIPE;
+ error "BoundingBox not found in pdftops output" if !@L;
+ debug "Got PaperSize: @L";
+- $L[0]=ceil $L[0]; $L[1]=ceil $L[1]; # Dat: pdftops expects integer papersize :-( )
++
++ # vvv Dat: pdftops without -eps doesn't report HiResBoundingBox,
++ # so we force it here
++ # at Wed Nov 15 17:19:23 CET 2006
++ $::opt_bboxfrom='adsc' if $::opt_bboxfrom eq 'guess';
++ $force_hiresbbox_value="0 0 @L";
++
++ #die defined $L[1];
++ $L[0]=myceil $L[0]; $L[1]=myceil $L[1]; # Dat: pdftops expects integer papersize :-( )
+ if ($::opt_approx) {
+- do_exec 'pdftops', '-paperw', $L[0], '-paperh', $L[1], $InputFilename, $OutputFilename;
++ # vvv Dat: even pdftops 3.01 accepts only integer for -paperw and paperh
++ do_exec 'pdftops', '-paperw', myfloor($L[0]+0.5), '-paperh', myfloor($L[1]+0.5), $InputFilename, $OutputFilename;
+ } else {
+ my $tpfn=temp_prefix()."Pps";
+ error "Cannot open temp pipe dest: $tpfn" unless open TP, "> $tpfn";
+ $tmpfiles{$tpfn}=1;
+ die unless close TP;
+- do_system 'pdftops', '-paperw', $L[0], '-paperh', $L[1], $InputFilename, $tpfn;
++ do_system 'pdftops', '-paperw', myfloor($L[0]+0.5), '-paperh', myfloor($L[1]+0.5), $InputFilename, $tpfn;
+ error "Cannot open temp pipe src: $tpfn" unless open IN, "< $tpfn";
+ $already_read=0; $bytes_left=-1;
+ $InputFilename=$tpfn; # '-'
+ goto SCAN_AGAIN
+ }
++ } elsif (is_ok_sam2p() or is_via_sam2p()) {
++ # Dat: PDF to GIF conversion
++ run_sam2p(1,$S);
+ }
++
+ error "cannot create from PDF: FileFormat $FileFormat";
+ OK:
+ }
+@@ -1211,11 +1326,11 @@
+ ($px,$py)=($1+0,$2+0) if $after_correct=~m@/PageSize\s*\[(\S+)\s+(\S+)+\]@;
+ my @paper=Htex::papers::any("$px,$py");
+ $paper[0]=defined $paper[0] ? "%%DocumentPaperSizes: $paper[0]\n" : "";
+- $bbx.="%%BoundingBox: ".floor($llx)." ".floor($lly)." ".
+- ceil($urx)." ". ceil($ury)."\n";
++ $bbx.="%%BoundingBox: ".myfloor($llx)." ".myfloor($lly)." ".
++ myceil($urx)." ". myceil($ury)."\n";
+ $bbx.="%%HiResBoundingBox: $llx $lly $urx $ury\n".
+- "%%ExactBoundingBox: $llx $lly $urx $ury\n" if floor($llx)!=$llx
+- or floor($lly)!=$lly or ceil($urx)!=$urx or ceil($ury)!=$ury;
++ "%%ExactBoundingBox: $llx $lly $urx $ury\n" if myfloor($llx)!=$llx
++ or myfloor($lly)!=$lly or myceil($urx)!=$urx or myceil($ury)!=$ury;
+ $bbx.="%%DocumentMedia: plain $px $py 0 () ()\n". # like pdftops(1)
+ "$paper[0]";
+ # ^^^ Imp: can DocumentMedia be non-integer? As of us, it can.
+@@ -1250,10 +1365,10 @@
+ }
+ my $new_bbox="$llx $lly $urx $ury";
+ if ($old_bbox eq $new_bbox) {
+- debug "Final BoundingBox: $new_bbox";
++ debug "Final (HiRes)BoundingBox: $new_bbox";
+ } else {
+- debug "Old BoundingBox: $old_bbox";
+- debug "Final corrected BoundingBox: $new_bbox";
++ debug "Old (HiRes)BoundingBox: $old_bbox";
++ debug "Final corrected (HiRes)BoundingBox: $new_bbox";
+ }
+ $pagedev_mark="/pdfmark where{pop}{/pdfmark/cleartomark load def}ifelse\n$pagedev_mark"
+ if length($pagedev_mark)!=0;
+@@ -1263,27 +1378,42 @@
+ # recompress the images already compressed in the EPS file, but keep
+ # them in their original, compressed form. So we rather instruct GS to
+ # recompress
++ # !! Dat: /CompatibilityLevel 1.3 %PDF-1.2 -- Dat: 1.2 won't embed Courier
+ my $markpagedevices="";
++ my $imagesopts=($::opt_lossy ? "
++/AutoFilterMonoImages true
++/AutoFilterGrayImages true
++/AutoFilterColorImages true
++/MonoImageFilter /CCITTFaxEncode
++/GrayImageFilter /DCTEncode
++/ColorImageFilter /DCTEncode
++" : "
++/AutoFilterMonoImages false
++/AutoFilterGrayImages false
++/AutoFilterColorImages false
++/MonoImageFilter /LZWEncode
++/GrayImageFilter /LZWEncode
++/ColorImageFilter /LZWEncode
++"); # Dat: assumes new, patent-free LZW
+ if (is_pdfmark()) {
++ # Dat: CompatibilityLevel 1.3 is required for font embedding & all /FlateDecode
+ $markpagedevices="
+-/CompatibilityLevel 1.2 %PDF-1.2
++/CompatibilityLevel 1.3 %PDF-1.3
+ /EmbedAllFonts true
+ /Optimize true % ignored by gs-6.70
+ /AutoRotatePages /None
+ /UseFlateCompression ".($::opt_compression ne 'none'?"true":"false")."
+ /AutoPositionEPSFiles false
+-/AutoFilterGrayImages false
+ /ConvertImagesToIndexed false
+ /DownsampleMonoImages false
+ /DownsampleGrayImages false
+ /DownsampleColorImages false
+-/AutoFilterColorImages false
+ /EncodeMonoImages true
+ /EncodeGrayImages true
+ /EncodeColorImages true
+ /AntiAliasMonoImages false
+ /AntiAliasGrayImages false
+-/AntiAliasColorImages false\n";
++/AntiAliasColorImages false\n$imagesopts";
+ $markpagedevices=(length($markpagedevices)!=0 ? "<< $markpagedevices >> setpagedevice\n" : "");
+ $markpagedevices.="1 dict dup /ImagingBBox null put setpagedevice\n";
+ $markpagedevices.="1 dict dup /Policies 1 dict dup /PageSize 3 put put setpagedevice\n"; # ripped from pdftops(1)
+@@ -1298,7 +1428,7 @@
+ # Dat: true for FileFormat PGM
+ # Dat: emit /PageSize even for PDF1
+ # Dat: Ghostscript 6.70 rounds /PageSize down, but we need up when creating /MediaBox for PDF
+- $setpagesize="2 dict dup /PageSize [".ceil($urx)." ".ceil($ury)."] put setpagedevice\n";
++ $setpagesize="2 dict dup /PageSize [".myceil($urx)." ".myceil($ury)."] put setpagedevice\n";
+ # ^^^ Dat: PLRM.pdf doesn't forbid a non-integer /PageSize
+ }
+ my $bsetup=is_page1_stop()?"":"%%BeginSetup\n%%EndSetup\n";
+@@ -1310,7 +1440,20 @@
+ # %%BeginSetup..%%EndSetup pair just before our code doing
+ # `setpagedevice'.
+ # !! ?? run pstops first, and then a2ping.pl
+- my $save=$is_restored?"save\n":"";
++ # !! why does a PDF -> PS conversion need $is_restored?
++ # vvv Dat: `mark' is necessary, because pstops 1.17 from xpdf(1) emits lines
++ # lines leaving `false' on the stack:
++ # %%BeginResource: font SKPOPP+LMRoman12-Regular
++ # %!PS-AdobeFont-1.0: LMRoman12-Regular 0.86
++ # %%CreationDate: 4th August (Monday) 2003
++ # % Generated by MetaType1 (a MetaPost-based engine)
++ # % CM sources: copyright (C) 1997 AMS, all rights reserved; METATYPE1/Type 1 ver
++ # % ADL: 694 194 112
++ # %%EndComments
++ # FontDirectory/LMRoman12-Regular known{/LMRoman12-Regular findfont dup/UniqueID
++ # /UniqueID get 0 eq exch/FontType get 1 eq and}{pop false}ifelse
++ # {save true}{false}ifelse}{false}ifelse
++ my $save=$is_restored?"save mark\n":"";
+ $bbx.$fontsdefs."%%EndComments\n".$bsetup.$setpagesize.$markpagedevices.$pagedev_mark.$after_correct.$save.$translate
+ }
+
+@@ -1532,9 +1675,9 @@
+ ## die $res;
+ temp_unlink $tfn;
+ ## print STDERR $res;
+- error "not a GS output from $GS"
++ error $?==11 ? "segmentation fault in $GS" : "not a GS output from $GS ($?)"
+ if !defined $res # BUGFIX at Sun Mar 7 18:51:34 CET 2004
+- or $res!~s/\A\w+ Ghostscript \d.*\n// # AFPL Ghostscript 6.50 (2000-12-02)
++ or $res!~s/\A(?:\w+ Ghostscript \d|Copyright .* artofcode ).*\n// # AFPL Ghostscript 6.50 (2000-12-02)
+ or $res!~s/.*?^bbox-begin\n//m;
+ if ($res!~s/\nbbox-success\n\Z(?!\n)/\n/) {
+ warning # not `error', mpost(1) `prologues:=0; ... btex fonts' output won't compile
+@@ -1587,6 +1730,7 @@
+ elsif ($line=~/^sides-dumplex==false$/) { $duplexi=2 }
+ elsif ($line=~/^sides-tumble==true$/) { $tumblei=1 }
+ elsif ($line=~/^sides-tumble==false$/) { $tumblei=2 }
++ elsif ($line=~/^add-showpage==\d+$/) { } # !!
+ elsif (length($line)==0 or $line=~/^(?:Copyright |This software )/) {}
+ elsif ($line=~/^Loading (\S+) font from.*[.][.][.]/) { debug "GS builtin font used: $1" }
+ else { debug "unknown line ($line)" }
+@@ -1619,7 +1763,7 @@
+ die if is_page1_stop();
+ # vvv ($llx,$lly,$urx,$ury)=(0,0,$papersize_x,$papersize_y);
+ # $do_bb_line->("set 0 0 $papersize_x $papersize_y"," from /PageSize");
+- $after_correct.="1 dict dup /PageSize [".ceil($papersize_x)." ".ceil($papersize_y)."] put setpagedevice\n";
++ $after_correct.="1 dict dup /PageSize [".myceil($papersize_x)." ".myceil($papersize_y)."] put setpagedevice\n";
+ # ^^^ Dat: both PS and markedPS would benefit from /PaperSize
+ # ^^^ Dat: will be put after CorrectBoundingBox
+ # Dat: unneeded: $allow_adsc_bb=0 if $FileFormat eq 'PDF'; # force this into /CropBox (otherwise only /MediaBox)
+@@ -1655,8 +1799,11 @@
+ }
+ }
+ # vvv Dat: save...restore is _always_ necessary to undo the changes made
+- # in the file itself
+- $is_restored=1; # $after_comments.="save\n";
++ # by the file itself (??)
++ # vvv BUGFIX (only EPS) at Tue Feb 8 21:40:11 CET 2005
++ # vvv Dat: now with PS output it is possible that garbage is left on
++ # the stack (see the `LMRoman' example above)
++ $is_restored=1 if $FileFormat eq'EPS' or $FileFormat eq'markedEPS';
+ $after_comments.=$undefs; # after our precious setpagedevice calls
+ # debug "pop_count=$pop_count;";
+ # debug "end_count=$end_count;";
+@@ -1696,7 +1843,7 @@
+ my %fontsnames;
+ my @creator;
+ read_again: while (length($_=readIN)) {
+- ##print STDERR "(($_))\n";
++ #print STDERR "(($_))\n";
+ ### end of header
+ next unless /\S/;
+ y@\r@@d; chomp;
+@@ -1715,8 +1862,9 @@
+ $creator_adobeps_p=1;
+ } elsif (/^%%Creator:\s*MetaPost\b/i) {
+ $creator_metapost_p=1;
+- } elsif ((substr($_,0,2)ne'%%' and substr($_,0,7)ne'%*Font:')
+- and substr($_,0,5)ne'%EPS ' # epsincl.mp
++ } elsif ((substr($_,0,2)ne'%%' and substr($_,0,7)ne'%*Font:' and
++ substr($_,0,5)ne'%ADO_' and !/^%AI\d_/ # Dat: %ADO_DSC_..., %AI7_Thumbnail
++ and substr($_,0,5)ne'%EPS ') # epsincl.mp
+ or !$creator_metapost_p and substr($_,0,5)eq'%%End'
+ or /^%%Begin(?:Prolog|Setup)\b/i
+ ) { $after_comments.="$_\n"; last }
+@@ -1741,7 +1889,12 @@
+ } elsif (/^$BBregex$BBValues/oi) { ### BoundingBox with values
+ s@($BBregex)\s*1\s+1\s+@$1 0 0 @ if $creator_adobeps_p;
+ # vvv $bbtype may be possibly already set by compute-gs
+- $do_bb_line->($_," from ADSC") if $allow_adsc_bb;
++ if ($allow_adsc_bb) {
++ $do_bb_line->($_," from ADSC");
++ if ($force_hiresbbox_value) {
++ $do_bb_line->("%%HiResBoundingBox: $force_hiresbbox_value"," from ADSC");
++ }
++ }
+ } elsif (/^$BBregex\s*\(atend\)/oi) {
+ ### BoundingBox with (atend)
+ debug "At end $1BoundingBox";
+@@ -1750,6 +1903,8 @@
+ $do_atend=1
+ } elsif (/^%%Page:/i and !$creator_metapost_p) { # at Thu Sep 25 15:59:52 CEST 2003
+ $after_comments.="$_\n"; last
++ } elsif (/^%(?:ADO_DSC_|AI\d_)/) { # Dat: example: %ADO_DSC_Encoding: MacOS Roman
++ $to_OUT.="%$_\n";
+ } elsif (/^%\*Font:\s+(\S+)\s+/) { # mpost(1) output
+ ## debug $_;
+ $fontsdefs.="$_\n"; # put in front (before `gsave ... translate')
+@@ -1884,7 +2039,7 @@
+ # vvv Dat: $after_code is pop+end
+ print OUT "\n$extra_trailer$after_code",
+ ("grestore\n"x$need_grestore),
+- ("restore\n"x$is_restored),
++ ("cleartomark restore\n"x$is_restored),
+ "%%EOF\n";
+ error "closing gs filter: $? $!" unless close OUT;
+
+@@ -1939,6 +2094,7 @@
+ my $tfn=temp_prefix()."p.tgs";
+ error "temp open $tfn: $!" unless open F, "> $tfn";
+ $tmpfiles{$tfn}=1;
++ # vvv Dat: doesn't work with gs 8.53: Error: /undefined in readxrefentry
+ die unless print F "% this is temporary gs command file created by $program".'
+ GS_PDF_ProcSet begin
+ pdfdict begin
+@@ -1949,7 +2105,10 @@
+ % vvv Dat: modifies Objects[0]
+ 1 pdffindpageref 0 get
+ Objects 0 OFT put
+- readxrefentry ===
++ %===
++ %print_xref
++ { readxrefentry } stopped { Objects exch lget } if
++ ===
+ currentdict pdfclose end end end
+ ';
+ die unless close F;
+@@ -1957,6 +2116,7 @@
+ my $gs2="$GS -dNODISPLAY -dBATCH -sFN=".fnq(fix_pipe_out(undef))." -q ".fnq($tfn);
+ debug "Ghostscript dup pipe: $gs2";
+ my $offset=`$gs2`;
++ #die $offset;
+ chomp $offset;
+ temp_unlink $tfn;
+ if ($offset=~/\A\d+\Z(?!\n)/) {
+@@ -1966,14 +2126,26 @@
+ die unless seek F, $offset+=0, 0;
+ my $pageobj;
+ die unless 32 $OutputFilename
+ do_system @pnm2sampled_cmd; # Dat: uses @extra -- really share that?
+ temp_unlink $scale3_pnm_fn;
++} else { # BUGFIX for `a2ping.pl -v --antialias=no negyzet.eps negyzet.png' at Wed Jul 20 21:34:29 CEST 2005
++ fix_close_out();
+ }
+-fix_close_out();
+ undef $unlink_OutputFilename;
+ if ($OutputFilename eq '-') {
+ debug "Done OK, stdout is $FileFormat"
+@@ -2187,14 +2360,97 @@
+ PNM output formats are PGM, PGM and PPM. To write PNM output formats, GS
+ is used.
+
++=head1 OPTIONS
+
+-=head1 TIPS AND TRICKS
++=head2 General Options
+
+ =over 2
+
+-=item *
++=item B<-h>, B<--help>
++
++Show a summary of the usage
++
++=item B<--doc>
++
++Show the man page
++
++=item B<-v>, B<--(no)verbose>
++
++Show progress and debug messages (default: no)
++
++=head2 Options for the Bounding box
++
++=item B<--(no)hires>
++
++Use HiResBoundingBox in the input file, if present (default: yes)
++
++=item B<--(no)exact>
++
++Use ExactBoundingBox in the input file, if present (default: no)
+
+-Call with the B<-v> option to see progress and debug messages.
++=item B<--(no)keepoldmediabox>
++
++keep only old, [0 0]-based MediaBox in PDF (default: no)
++
++=item B<--bboxfrom=>I
++
++Method for determining the BoundingBox (default: guess)
++
++=item B<--(no)below>
++
++Allow page content below and left of the origin (default: no)
++
++
++=head2 Options for graphics and fonts
++
++=item B<--(no)compress>
++
++use compression (default: best)
++
++=item B<--(no)antialias>
++
++render shades at outlines. Possible values: (=I =I =I) (default: scale3no)
++
++=item B<--(no)lossy>
++
++allow lossy image filters (EPS->PDF) (default: yes)
++
++=item B<--papersize=>I
++
++(default: default) (bp)
++
++=item B<--threshold=>
++
++min color for 1 in 8->1 bit conv (default: 128)
++
++
++=head2 Options for debugging and changing internals
++
++=item B<--(no)tmpunlink>
++
++Unlink temporary files (default: yes). Use B<--notmpunklink> if you
++want to inspect intermediate files.
++
++=item B<--gs-cmd=>I
++
++path to Ghostscript program (default: gs or gswin32c)
++
++=item B<--gs-ccmd=>I
++
++path to Ghostscript for BoundingBox calculation (default: gs or gswin32c)
++
++=item B<--gsextra=>I
++
++Pass extra arguments to gs
++
++=item B<--extra=>
++
++Pass extra arguments to external program (i.e pdftops)
++
++
++=head1 TIPS AND TRICKS
++
++=over 2
+
+ =item *
+
+@@ -2260,6 +2516,11 @@
+ is going to be really big, you should specify B<--AntiAlias=yes> instead of
+ the default B<--AntiAlias=scale3no> to speed up conversion.
+
++=item *
++
++To make sure fonts are included in a PDF file generated from eps, use
++B<--gsextra='-dEmbedAllFonts=true -dPDFSETTINGS=/printer'>.
++
+ =back
+
+
+@@ -2297,7 +2558,7 @@
+
+ =head1 AUTHORS
+
+-The author of B is Szab Pter >.
++The author of B is Pter Szab >.
+
+ B is inspired by and historically based on the B Perl
+ script modified by Thomas Esser, Sept. 1998, but his modifications have
+@@ -2306,6 +2567,9 @@
+ for Elsevier Science. B contained extra tricks from Hans Hagen's
+ texutil.
+
++B contains contributions from several people, see the HISTORY for
++details. Thank you all for contributing!
++
+ =head1 HISTORY
+
+ =head2 1999/05/06 v2.5 (Heiko Oberdiek)
+@@ -2334,7 +2598,7 @@
+ * Newline before grestore for the case that there is no
+ whitespace at the end of the eps file.
+
+-=head2 2003/02/02 (Szab Pter)
++=head2 2003/02/02 (Pter Szab)
+
+ * option --below
+ * removes DOS EPSF binary junk correctly
+@@ -2347,7 +2611,7 @@
+ * can convert PDF to EPS (by calling pdftops(1)) and PDF to PDF
+ * emulates work for PDF input
+
+-=head2 2003/04/16 (Szab Pter)
++=head2 2003/04/16 (Pter Szab)
+
+ * added PS and sam2p support, renamed to a2ping
+ * sam2p and pdftops if $InputFilename eq '-';
+@@ -2357,7 +2621,7 @@
+ * removes ^L (form feed) from end of EPS file
+ * -x=-c:rle to add sam2p options
+
+-=head2 2003/04/26 (Szab Pter)
++=head2 2003/04/26 (Pter Szab)
+
+ * omit the unnecessary setpagedevice calls when creating normal eps
+ * --noverbose --nocompress supported differently
+@@ -2374,7 +2638,7 @@
+ setpagedevice. Precedence for other inputs: --PageSize, setpagedevice,
+ %%*BoundingBox
+
+-=head2 2003/09/25 (Szab Pter)
++=head2 2003/09/25 (Pter Szab)
+
+ * --bboxfrom=adsc: %%BoundingBox overrides -sDEVICE=bbox
+ * improved bbox discovery
+@@ -2384,11 +2648,11 @@
+ * consistent bbox, --PageSize, /PageSize handling
+ * consistent --Resolution and --Duplex handling
+
+-=head2 2003/12/02 (Szab Pter)
++=head2 2003/12/02 (Pter Szab)
+
+ * --bboxfrom=compute-gs option to fix PS -> EPS bbox (gs -sDEVICE=bbox), tuzv.eps
+
+-=head2 2004/02/10 v2.77 (Szab Pter)
++=head2 2004/02/10 v2.77p fixed (Pter Szab)
+
+ * the compute-pipe routine is now run unless --bboxfrom=guess with EPS
+ * added --gsextra=
+@@ -2397,3 +2661,9 @@
+ * separated FileFormat features to FL_* constants
+ * added --doc
+ * there is no default FileFormat (PDF) anymore
++
++=head2 2007/03/07 (Pter Szab and Frank Kster)
++
++ * various improvements for tetex2 and tetex3 compatibility
++ * various other improvements
++ * POD documentation enhancements (font embedding tricks) by Frank Kster
--- texlive-bin-2007.dfsg.1.orig/debian/patches/config.ps-update
+++ texlive-bin-2007.dfsg.1/debian/patches/config.ps-update
@@ -0,0 +1,635 @@
+Update config.ps from TeX Live 2007.
+This fixes some bugs with setting the right page size in created pdf
+documents.
+---
+ texmf/dvips/config/config.ps | 525 ++++++++++++++++++++++++++++++++++++-------
+ 1 file changed, 443 insertions(+), 82 deletions(-)
+
+Index: texlive-bin-2007/texmf/dvips/config/config.ps
+===================================================================
+--- texlive-bin-2007.orig/texmf/dvips/config/config.ps 2007-07-02 07:42:08.000000000 +0200
++++ texlive-bin-2007/texmf/dvips/config/config.ps 2007-07-02 07:42:26.000000000 +0200
+@@ -1,4 +1,5 @@
+-% teTeX's config.ps. Thomas Esser, 1998, public domain.
++% config.ps - configuration file for dvips.
++% Tomas Rokicki, Thomas Esser, Karl Berry, et al., 1986ff, public domain.
+
+ % Memory available. Download the three-line PostScript file:
+ % %! Hey, we're PostScript
+@@ -11,7 +12,7 @@
+ % `\special' and config files (via the `E' option) and opening of any
+ % absolute filenames. z1, the default, forbids shell escapes but
+ % allows absolute filenames. z0 allows both. The corresponding
+-% commandline options are -R0|-R1|-R2
++% command line options are -R0|-R1|-R2
+ z1
+
+ % How to print, maybe with lp instead lpr, etc. If commented-out, output
+@@ -43,167 +44,527 @@
+
+ % Partially download Type 1 fonts by default. Only reason not to do
+ % this is if you encounter bugs. (Please report them to
+-% @email{tex-k@@mail.tug.org} if you do.)
++% @email{tex-k@tug.org} if you do.)
+ j
+
+ % This shows how to add your own map file.
+ % Remove the comment and adjust the name:
+ % p +myfonts.map
+
+-% 0 0 595 842 is the right bounding box that most applications expect
+-% for A4. Since dvips always rounds up, choose something slightly smaller.
++% If we have setpagedevice, use that.
++% else if we have the a4 resp. letter operator, use that.
++% else do nothing to set the page size.
++%
++% In the past, the a4size and letterSize definitions did not set the
++% page size, but we want to set it if we can so that ps2pdf can work
++% properly. Here, a4 and a4size, and letter and letterSize, are
++% identical, and we prefer the a4/letter names -- texconfig uses them.
++
++% 0 0 595 842 is the right bounding box that applications expect
++% for A4. Since dvips always rounds up, choose something slightly
++% smaller for our paper size.
+
+-@ A4size 594.99bp 841.99bp
++@ a4 210mm 297mm
+ @+ ! %%DocumentPaperSizes: a4
+-@+ %%PaperSize: A4
++@+ %%BeginPaperSize: a4
++@+ /setpagedevice where
++@+ { pop << /PageSize [595 842] >> setpagedevice }
++@+ { /a4 where { pop a4 } if }
++@+ ifelse
++@+ %%EndPaperSize
+
+-@ letterSize 8.5in 11in
++@ letter 8.5in 11in
+ @+ ! %%DocumentPaperSizes: Letter
++@+ %%BeginPaperSize: Letter
++@+ /setpagedevice where
++@+ { pop << /PageSize [612 792] >> setpagedevice }
++@+ { /letter where { pop letter } if }
++@+ ifelse
++@+ %%EndPaperSize
+
+-@ letter 8.5in 11in
++@ a4size 210mm 297mm
++@+ ! %%DocumentPaperSizes: a4
++@+ %%BeginPaperSize: a4
++@+ /setpagedevice where
++@+ { pop << /PageSize [595 842] >> setpagedevice }
++@+ { /a4 where { pop a4 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ letterSize 8.5in 11in
+ @+ ! %%DocumentPaperSizes: Letter
+ @+ %%BeginPaperSize: Letter
+-@+ letter
++@+ /setpagedevice where
++@+ { pop << /PageSize [612 792] >> setpagedevice }
++@+ { /letter where { pop letter } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ halfexecutive 133mm 184mm
++@+ ! %%DocumentPaperSizes: halfexecutive
++@+ %%BeginPaperSize: halfexecutive
++@+ /setpagedevice where
++@+ { pop << /PageSize [378 522] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ halfletter 140mm 216mm
++@+ ! %%DocumentPaperSizes: halfletter
++@+ %%BeginPaperSize: halfletter
++@+ /setpagedevice where
++@+ { pop << /PageSize [396 612] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ statement 140mm 216mm
++@+ ! %%DocumentPaperSizes: statement
++@+ %%BeginPaperSize: statement
++@+ /setpagedevice where
++@+ { pop << /PageSize [396 612] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ executive 184mm 267mm
++@+ ! %%DocumentPaperSizes: executive
++@+ %%BeginPaperSize: executive
++@+ /setpagedevice where
++@+ { pop << /PageSize [522 756] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++% for powerdot
++@ screen 8.25in 11in
++@+ ! %%DocumentPaperSizes: Screen
++@+ %%BeginPaperSize: Screen
++@+ /setpagedevice where
++@+ { pop << /PageSize [594 792] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++% a common size for printers (in north america).
++@ sixbynine 6in 9in
++@+ ! %%DocumentPaperSizes: SixByNine
++@+ %%BeginPaperSize: SixByNine
++@+ /setpagedevice where
++@+ { pop << /PageSize [432 648] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ quarto 215mm 275mm
++@+ ! %%DocumentPaperSizes: quarto
++@+ %%BeginPaperSize: quarto
++@+ /setpagedevice where
++@+ { pop << /PageSize [610 780] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ note 216mm 279mm
++@+ ! %%DocumentPaperSizes: note
++@+ %%BeginPaperSize: note
++@+ /setpagedevice where
++@+ { pop << /PageSize [612 792] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ folio 216mm 330mm
++@+ ! %%DocumentPaperSizes: folio
++@+ %%BeginPaperSize: folio
++@+ /setpagedevice where
++@+ { pop << /PageSize [612 936] >> setpagedevice }
++@+ if
+ @+ %%EndPaperSize
+
+ @ legal 8.5in 14in
+ @+ ! %%DocumentPaperSizes: Legal
+ @+ %%BeginPaperSize: Legal
+-@+ legal
++@+ /setpagedevice where
++@+ { pop << /PageSize [612 1008] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ 10x14 10in 14in
++@+ ! %%DocumentPaperSizes: 10x14
++@+ %%BeginPaperSize: 10x14
++@+ /setpagedevice where
++@+ { pop << /PageSize [720 1008] >> setpagedevice }
++@+ if
+ @+ %%EndPaperSize
+
+ @ ledger 17in 11in
+ @+ ! %%DocumentPaperSizes: Ledger
+ @+ %%BeginPaperSize: Ledger
+-@+ ledger
++@+ /setpagedevice where
++@+ { pop << /PageSize [1224 792] >> setpagedevice }
++@+ if
+ @+ %%EndPaperSize
+
+ @ tabloid 11in 17in
+ @+ ! %%DocumentPaperSizes: Tabloid
+ @+ %%BeginPaperSize: Tabloid
+-@+ 11x17
+-@+ %%EndPaperSize
+-
+-@ a6 105mm 148mm
+-@+ ! %%DocumentPaperSizes: a6
+-@+ %%BeginPaperSize: a6
+-@+ a6
+-@+ %%EndPaperSize
+-
+-@ a5 148mm 210mm
+-@+ ! %%DocumentPaperSizes: a5
+-@+ %%BeginPaperSize: a5
+-@+ a5
++@+ /setpagedevice where
++@+ { pop << /PageSize [792 1224] >> setpagedevice }
++@+ if
+ @+ %%EndPaperSize
+
+-@ a4 594.99bp 841.99bp
+-@+ ! %%DocumentPaperSizes: a4
+-@+ %%BeginPaperSize: a4
+-@+ a4
++@ 11x17 11in 17in
++@+ ! %%DocumentPaperSizes: 11x17
++@+ %%BeginPaperSize: 11x17
++@+ /setpagedevice where
++@+ { pop << /PageSize [792 1224] >> setpagedevice }
++@+ if
+ @+ %%EndPaperSize
+
+-@ a3 297mm 420mm
+-@+ ! %%DocumentPaperSizes: a3
+-@+ %%BeginPaperSize: a3
+-@+ a3
+-@+ %%EndPaperSize
+-
+-@ a2 420mm 595mm
+-@+ ! %%DocumentPaperSizes: a2
+-@+ %%BeginPaperSize: a2
+-@+ a2
++@ a0 841mm 1189mm
++@+ ! %%DocumentPaperSizes: a0
++@+ %%BeginPaperSize: a0
++@+ /setpagedevice where
++@+ { pop << /PageSize [2384 3370] >> setpagedevice }
++@+ { /a0 where { pop a0 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+-@ a1 595mm 841mm
++@ a1 594mm 841mm
+ @+ ! %%DocumentPaperSizes: a1
+ @+ %%BeginPaperSize: a1
+-@+ a1
++@+ /setpagedevice where
++@+ { pop << /PageSize [1684 2384] >> setpagedevice }
++@+ { /a1 where { pop a1 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+-@ a0 841mm 1189mm
+-@+ ! %%DocumentPaperSizes: a0
+-@+ %%BeginPaperSize: a0
+-@+ a0
+-@+ %%EndPaperSize
+-
+-@ b6 125mm 176mm
+-@+ ! %%DocumentPaperSizes: b6
+-@+ %%BeginPaperSize: b6
+-@+ b6
++@ a2 420mm 594mm
++@+ ! %%DocumentPaperSizes: a2
++@+ %%BeginPaperSize: a2
++@+ /setpagedevice where
++@+ { pop << /PageSize [1191 1684] >> setpagedevice }
++@+ { /a2 where { pop a2 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+-@ b5 176mm 250mm
+-@+ ! %%DocumentPaperSizes: b5
+-@+ %%BeginPaperSize: b5
+-@+ b5
++@ a3 297mm 420mm
++@+ ! %%DocumentPaperSizes: a3
++@+ %%BeginPaperSize: a3
++@+ /setpagedevice where
++@+ { pop << /PageSize [842 1191] >> setpagedevice }
++@+ { /a3 where { pop a3 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+-@ b4 250mm 353mm
+-@+ ! %%DocumentPaperSizes: b4
+-@+ %%BeginPaperSize: b4
+-@+ b4
++@ a5 148mm 210mm
++@+ ! %%DocumentPaperSizes: a5
++@+ %%BeginPaperSize: a5
++@+ /setpagedevice where
++@+ { pop << /PageSize [420 595] >> setpagedevice }
++@+ { /a5 where { pop a5 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+-@ b3 353mm 500mm
+-@+ ! %%DocumentPaperSizes: b3
+-@+ %%BeginPaperSize: b3
+-@+ b3
++@ a6 105mm 148mm
++@+ ! %%DocumentPaperSizes: a6
++@+ %%BeginPaperSize: a6
++@+ /setpagedevice where
++@+ { pop << /PageSize [298 420] >> setpagedevice }
++@+ { /a6 where { pop a6 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ a7 74mm 105mm
++@+ ! %%DocumentPaperSizes: a7
++@+ %%BeginPaperSize: a7
++@+ /setpagedevice where
++@+ { pop << /PageSize [210 298] >> setpagedevice }
++@+ { /a7 where { pop a7 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ a8 52mm 74mm
++@+ ! %%DocumentPaperSizes: a8
++@+ %%BeginPaperSize: a8
++@+ /setpagedevice where
++@+ { pop << /PageSize [147 210] >> setpagedevice }
++@+ { /a8 where { pop a8 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ a9 37mm 52mm
++@+ ! %%DocumentPaperSizes: a9
++@+ %%BeginPaperSize: a9
++@+ /setpagedevice where
++@+ { pop << /PageSize [105 147] >> setpagedevice }
++@+ { /a9 where { pop a9 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ a10 26mm 37mm
++@+ ! %%DocumentPaperSizes: a10
++@+ %%BeginPaperSize: a10
++@+ /setpagedevice where
++@+ { pop << /PageSize [74 105] >> setpagedevice }
++@+ { /a10 where { pop a10 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+ @ jisb0 1030mm 1456mm
+ @+ ! %%DocumentPaperSizes: jisb0
+ @+ %%BeginPaperSize: jisb0
+-@+ jisb0
++@+ /setpagedevice where
++@+ { pop << /PageSize [2920 4127] >> setpagedevice }
++@+ { /jisb0 where { pop jisb0 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+ @ jisb1 728mm 1030mm
+ @+ ! %%DocumentPaperSizes: jisb1
+ @+ %%BeginPaperSize: jisb1
+-@+ jisb1
++@+ /setpagedevice where
++@+ { pop << /PageSize [2064 2920] >> setpagedevice }
++@+ { /jisb1 where { pop jisb1 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+ @ jisb2 515mm 728mm
+ @+ ! %%DocumentPaperSizes: jisb2
+ @+ %%BeginPaperSize: jisb2
+-@+ jisb2
++@+ /setpagedevice where
++@+ { pop << /PageSize [1460 2064] >> setpagedevice }
++@+ { /jisb2 where { pop jisb2 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+ @ jisb3 364mm 515mm
+ @+ ! %%DocumentPaperSizes: jisb3
+ @+ %%BeginPaperSize: jisb3
+-@+ jisb3
++@+ /setpagedevice where
++@+ { pop << /PageSize [1032 1460] >> setpagedevice }
++@+ { /jisb3 where { pop jisb3 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+ @ jisb4 257mm 364mm
+ @+ ! %%DocumentPaperSizes: jisb4
+ @+ %%BeginPaperSize: jisb4
+-@+ jisb4
++@+ /setpagedevice where
++@+ { pop << /PageSize [729 1032] >> setpagedevice }
++@+ { /jisb4 where { pop jisb4 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+ @ jisb5 182mm 257mm
+ @+ ! %%DocumentPaperSizes: jisb5
+ @+ %%BeginPaperSize: jisb5
+-@+ jisb5
++@+ /setpagedevice where
++@+ { pop << /PageSize [516 729] >> setpagedevice }
++@+ { /jisb5 where { pop jisb5 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+ @ jisb6 128mm 182mm
+ @+ ! %%DocumentPaperSizes: jisb6
+ @+ %%BeginPaperSize: jisb6
+-@+ jisb6
++@+ /setpagedevice where
++@+ { pop << /PageSize [363 516] >> setpagedevice }
++@+ { /jisb6 where { pop jisb6 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ jisb7 91mm 128mm
++@+ ! %%DocumentPaperSizes: jisb7
++@+ %%BeginPaperSize: jisb7
++@+ /setpagedevice where
++@+ { pop << /PageSize [258 363] >> setpagedevice }
++@+ { /jisb7 where { pop jisb7 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ jisb8 64mm 91mm
++@+ ! %%DocumentPaperSizes: jisb8
++@+ %%BeginPaperSize: jisb8
++@+ /setpagedevice where
++@+ { pop << /PageSize [181 258] >> setpagedevice }
++@+ { /jisb8 where { pop jisb8 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ b0 1000mm 1414mm
++@+ ! %%DocumentPaperSizes: b0
++@+ %%BeginPaperSize: b0
++@+ /setpagedevice where
++@+ { pop << /PageSize [2835 4008] >> setpagedevice }
++@+ { /b0 where { pop b0 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ b1 707mm 1000mm
++@+ ! %%DocumentPaperSizes: b1
++@+ %%BeginPaperSize: b1
++@+ /setpagedevice where
++@+ { pop << /PageSize [2004 2835] >> setpagedevice }
++@+ { /b1 where { pop b1 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ b2 500mm 707mm
++@+ ! %%DocumentPaperSizes: b2
++@+ %%BeginPaperSize: b2
++@+ /setpagedevice where
++@+ { pop << /PageSize [1417 2004] >> setpagedevice }
++@+ { /b2 where { pop b2 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ b3 353mm 500mm
++@+ ! %%DocumentPaperSizes: b3
++@+ %%BeginPaperSize: b3
++@+ /setpagedevice where
++@+ { pop << /PageSize [1001 1417] >> setpagedevice }
++@+ { /b3 where { pop b3 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ b4 250mm 353mm
++@+ ! %%DocumentPaperSizes: b4
++@+ %%BeginPaperSize: b4
++@+ /setpagedevice where
++@+ { pop << /PageSize [709 1001] >> setpagedevice }
++@+ { /b4 where { pop b4 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ b5 176mm 250mm
++@+ ! %%DocumentPaperSizes: b5
++@+ %%BeginPaperSize: b5
++@+ /setpagedevice where
++@+ { pop << /PageSize [499 709] >> setpagedevice }
++@+ { /b5 where { pop b5 } if }
++@+ ifelse
+ @+ %%EndPaperSize
+
+-% not defined in Ghostscript, per Akira.
+-% @ jisb7 91mm 128mm
+-% @+ ! %%DocumentPaperSizes: jisb7
+-% @+ %%BeginPaperSize: jisb7
+-% @+ jisb7
+-% @+ %%EndPaperSize
+-%
+-% @ jisb8 64mm 91mm
+-% @+ ! %%DocumentPaperSizes: jisb8
+-% @+ %%BeginPaperSize: jisb8
+-% @+ jisb8
+-% @+ %%EndPaperSize
++@ b6 125mm 176mm
++@+ ! %%DocumentPaperSizes: b6
++@+ %%BeginPaperSize: b6
++@+ /setpagedevice where
++@+ { pop << /PageSize [354 499] >> setpagedevice }
++@+ { /b6 where { pop b6 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ c5 162mm 229mm
++@+ ! %%DocumentPaperSizes: c5
++@+ %%BeginPaperSize: c5
++@+ /setpagedevice where
++@+ { pop << /PageSize [459 649] >> setpagedevice }
++@+ { /c5 where { pop c5 } if }
++@+ ifelse
++@+ %%EndPaperSize
++
++@ DL 110mm 220mm
++@+ ! %%DocumentPaperSizes: DL
++@+ %%BeginPaperSize: DL
++@+ /setpagedevice where
++@+ { pop << /PageSize [312 624] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ Comm10 105mm 241mm
++@+ ! %%DocumentPaperSizes: Comm10
++@+ %%BeginPaperSize: Comm10
++@+ /setpagedevice where
++@+ { pop << /PageSize [297 684] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ Monarch 98.4mm 190.5mm
++@+ ! %%DocumentPaperSizes: Monarch
++@+ %%BeginPaperSize: Monarch
++@+ /setpagedevice where
++@+ { pop << /PageSize [279 540] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ archE 36in 48in
++@+ ! %%DocumentPaperSizes: archE
++@+ %%BeginPaperSize: archE
++@+ /setpagedevice where
++@+ { pop << /PageSize [2592 3456] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ archD 24in 36in
++@+ ! %%DocumentPaperSizes: archD
++@+ %%BeginPaperSize: archD
++@+ /setpagedevice where
++@+ { pop << /PageSize [1728 2592] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ archC 18in 24in
++@+ ! %%DocumentPaperSizes: archC
++@+ %%BeginPaperSize: archC
++@+ /setpagedevice where
++@+ { pop << /PageSize [1296 1728] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ archB 12in 18in
++@+ ! %%DocumentPaperSizes: archB
++@+ %%BeginPaperSize: archB
++@+ /setpagedevice where
++@+ { pop << /PageSize [864 1296] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ archA 9in 12in
++@+ ! %%DocumentPaperSizes: archA
++@+ %%BeginPaperSize: archA
++@+ /setpagedevice where
++@+ { pop << /PageSize [648 864] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ flsa 216mm 330.2mm
++@+ ! %%DocumentPaperSizes: flsa
++@+ %%BeginPaperSize: flsa
++@+ /setpagedevice where
++@+ { pop << /PageSize [612 936] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ flse 216mm 330.2mm
++@+ ! %%DocumentPaperSizes: flse
++@+ %%BeginPaperSize: flse
++@+ /setpagedevice where
++@+ { pop << /PageSize [612 936] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ csheet 431.8mm 558.8mm
++@+ ! %%DocumentPaperSizes: csheet
++@+ %%BeginPaperSize: csheet
++@+ /setpagedevice where
++@+ { pop << /PageSize [1224 1584] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ dsheet 558.8mm 863.6mm
++@+ ! %%DocumentPaperSizes: dsheet
++@+ %%BeginPaperSize: dsheet
++@+ /setpagedevice where
++@+ { pop << /PageSize [1584 2448] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ esheet 863.6mm 1117.6mm
++@+ ! %%DocumentPaperSizes: esheet
++@+ %%BeginPaperSize: esheet
++@+ /setpagedevice where
++@+ { pop << /PageSize [2448 3168] >> setpagedevice }
++@+ if
++@+ %%EndPaperSize
++
++@ unknown 0in 0in
++@+ statusdict /setpageparams known { hsize vsize 0 1 statusdict begin {
++@+ setpageparams } stopped end } { true } ifelse { statusdict /setpage known
++@+ { hsize vsize 1 statusdict begin { setpage } stopped pop end } if } if
+
+ @ unknown 0in 0in
+ @+ statusdict /setpageparams known { hsize vsize 0 1 statusdict begin {
--- texlive-bin-2007.dfsg.1.orig/debian/patches/30_libpoppler_0.5.9
+++ texlive-bin-2007.dfsg.1/debian/patches/30_libpoppler_0.5.9
@@ -0,0 +1,454 @@
+# 30_libpoppler.dpatch
+#
+# use libpoppler instead of libxpdf in pdfetex and xetex
+# don't build pdftosrc as it needs libpoppler from experimental
+
+@DPATCH@
+ build/source/configure | 6 +-
+ build/source/configure.in | 8 +--
+ build/source/texk/web2c/pdftexdir/Makefile.in | 2
+ build/source/texk/web2c/pdftexdir/depend.mk | 58 +----------------------
+ build/source/texk/web2c/pdftexdir/pdftex.mk | 9 ++-
+ build/source/texk/web2c/pdftexdir/pdftexextra.in | 2
+ build/source/texk/web2c/pdftexdir/pdftoepdf.cc | 54 ++++++++++-----------
+ build/source/texk/web2c/pdftexdir/pdftosrc.cc | 40 ++++++++-------
+ build/source/texk/web2c/pdftexdir/utils.c | 4 -
+ build/source/texk/web2c/xetexdir/XeTeX_ext.c | 4 -
+ build/source/texk/web2c/xetexdir/pdfimage.cpp | 24 +++++++--
+ build/source/texk/web2c/xetexdir/xetex.mk | 8 ++-
+ 12 files changed, 96 insertions(+), 123 deletions(-)
+
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/depend.mk
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/depend.mk 2007-07-03 12:03:20.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/depend.mk 2007-07-03 12:08:40.000000000 +0200
+@@ -1,55 +1,5 @@
+-epdf.o: epdf.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-mapfile.o: mapfile.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-papersiz.o: papersiz.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h
+-utils.o: utils.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h \
+- ../../../libs/zlib/zlib.h ../../../libs/zlib/zconf.h \
+- ../../../libs/md5/md5.h pdftexextra.h \
+- ../../../libs/obsdcompat/openbsd-compat.h
+-vfpacket.o: vfpacket.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h
+-pkin.o: pkin.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writefont.o: writefont.c ../../../libs/xpdf/goo/gmem.h ptexlib.h \
+- ../pdftexd.h ../texmfmp.h ../cpascal.h ../config.h ../help.h \
+- ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writet1.o: writet1.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writet3.o: writet3.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writezip.o: writezip.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h ../../../libs/zlib/zlib.h ../../../libs/zlib/zconf.h
+-writeenc.o: writeenc.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h
+-writettf.o: writettf.c ptexlib.h writettf.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h macnames.c
+-writejpg.o: writejpg.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h image.h
+-writepng.o: writepng.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h image.h
+-writeimg.o: writeimg.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h image.h
+-pdftoepdf.o: pdftoepdf.cc ../../../libs/xpdf/xpdf/Object.h \
+- ../../../libs/xpdf/goo/gmem.h ../../../libs/xpdf/xpdf/Array.h \
+- ../../../libs/xpdf/xpdf/Dict.h ../../../libs/xpdf/xpdf/Stream.h \
+- ../../../libs/xpdf/xpdf/XRef.h ../../../libs/xpdf/xpdf/Catalog.h \
+- ../../../libs/xpdf/xpdf/Page.h ../../../libs/xpdf/xpdf/GfxFont.h \
+- ../../../libs/xpdf/xpdf/Error.h epdf.h
++pdftoepdf.o: pdftoepdf.cc epdf.h ../../kpathsea/c-auto.h \
++ ../../kpathsea/c-proto.h ../../web2c/c-auto.h ../../web2c/config.h \
++ ../../kpathsea/c-fopen.h ../../web2c/pdftexdir/ptexmac.h
+ ttf2afm.o: ttf2afm.c writettf.h macnames.c
+-pdftosrc.o: pdftosrc.cc ../../../libs/xpdf/xpdf/Object.h \
+- ../../../libs/xpdf/xpdf/Array.h ../../../libs/xpdf/xpdf/Dict.h \
+- ../../../libs/xpdf/xpdf/Stream.h ../../../libs/xpdf/xpdf/XRef.h \
+- ../../../libs/xpdf/xpdf/Catalog.h ../../../libs/xpdf/xpdf/Page.h \
+- ../../../libs/xpdf/xpdf/PDFDoc.h ../../../libs/xpdf/xpdf/Link.h \
+- ../../../libs/xpdf/xpdf/Error.h ../../../libs/xpdf/xpdf/config.h
++pdftosrc.o: pdftosrc.cc
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftoepdf.cc
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/pdftoepdf.cc 2007-07-03 12:03:20.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftoepdf.cc 2007-07-03 12:08:40.000000000 +0200
+@@ -26,25 +26,24 @@
+ #include
+ #include
+ #include
+-#include
+-#include
+-#include
+-#include
+-#include
+ #include
+-#include "Object.h"
+-#include "Stream.h"
+-#include "Array.h"
+-#include "Dict.h"
+-#include "XRef.h"
+-#include "Catalog.h"
+-#include "Link.h"
+-#include "Page.h"
+-#include "GfxFont.h"
+-#include "PDFDoc.h"
+-#include "GlobalParams.h"
+-#include "Error.h"
+-
++#include
++#include
++#include
++#include
++#include
++#include "poppler/Object.h"
++#include "poppler/Stream.h"
++#include "poppler/Array.h"
++#include "poppler/Dict.h"
++#include "poppler/XRef.h"
++#include "poppler/Link.h"
++#include "poppler/Catalog.h"
++#include "poppler/Page.h"
++#include "poppler/GfxFont.h"
++#include "poppler/PDFDoc.h"
++#include "poppler/GlobalParams.h"
++#include "poppler/Error.h"
+ #include "epdf.h"
+
+ // This file is mostly C and not very much C++; it's just used to interface
+@@ -169,7 +168,7 @@
+ fprintf(stderr, "\npdfTeX Debug: Creating %s (%d)\n", p->file_name,
+ p->occurences);
+ #endif
+- GString *docName = new GString(p->file_name);
++ GooString *docName = new GooString(p->file_name);
+ p->doc = new PDFDoc(docName); // takes ownership of docName
+ if (!p->doc->isOk() || !p->doc->okToPrint()) {
+ pdftex_fail("xpdf: reading PDF image failed");
+@@ -511,7 +510,7 @@
+ int i, l, c;
+ Ref ref;
+ char *p;
+- GString *s;
++ GooString *s;
+ if (obj->isBool()) {
+ pdf_printf("%s", obj->getBool()? "true" : "false");
+ } else if (obj->isInt()) {
+@@ -703,7 +702,7 @@
+ epdf_num_pages = pdf_doc->doc->getCatalog()->getNumPages();
+ if (page_name) {
+ // get page by name
+- GString name(page_name);
++ GooString name(page_name);
+ LinkDest *link = pdf_doc->doc->findDest(&name);
+ if (link == 0 || !link->isOk())
+ pdftex_fail("PDF inclusion: invalid destination <%s>", page_name);
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftosrc.cc
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/pdftosrc.cc 2007-07-03 12:03:20.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftosrc.cc 2007-07-03 12:08:58.000000000 +0200
+@@ -25,22 +25,23 @@
+ #include
+ #include
+ #include
+-#include
+ #include
+-#include
+-#include
+-#include
+-#include "Object.h"
+-#include "Stream.h"
+-#include "Array.h"
+-#include "Dict.h"
+-#include "XRef.h"
+-#include "Catalog.h"
+-#include "Page.h"
+-#include "GfxFont.h"
+-#include "PDFDoc.h"
+-#include "GlobalParams.h"
+-#include "Error.h"
++
++#include
++#include
++#include
++#include
++#include "poppler/Object.h"
++#include "poppler/Stream.h"
++#include "poppler/Array.h"
++#include "poppler/Dict.h"
++#include "poppler/XRef.h"
++#include "poppler/Catalog.h"
++#include "poppler/Page.h"
++#include "poppler/GfxFont.h"
++#include "poppler/PDFDoc.h"
++#include "poppler/GlobalParams.h"
++#include "poppler/Error.h"
+
+ static XRef *xref = 0;
+
+@@ -48,7 +49,7 @@
+ {
+ char *p, buf[1024];
+ PDFDoc *doc;
+- GString *fileName;
++ GooString *fileName;
+ Stream *s;
+ Object srcStream, srcName, catalogDict;
+ FILE *outfile;
+@@ -62,8 +63,8 @@
+ "Usage: pdftosrc []\n");
+ exit(1);
+ }
+- fileName = new GString(argv[1]);
+- globalParams = new GlobalParams();
++ fileName = new GooString(argv[1]);
++ globalParams = new GlobalParams(NULL);
+ doc = new PDFDoc(fileName);
+ if (!doc->isOk()) {
+ fprintf(stderr, "Invalid PDF file\n");
+@@ -83,7 +84,7 @@
+ }
+ srcStream.initNull();
+ if (objnum == 0) {
+- catalogDict.dictLookup("SourceObject", &srcStream);
++ catalogDict.dictLookup(UGooString("SourceObject"), &srcStream);
+ if (!srcStream.isStream("SourceFile")) {
+ fprintf(stderr, "No SourceObject found\n");
+ exit(1);
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/Makefile.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/Makefile.in 2007-07-03 12:03:20.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/Makefile.in 2007-07-03 12:08:40.000000000 +0200
+@@ -8,7 +8,7 @@
+ kpathsea_srcdir_parent = $(srcdir)/../..
+ kpathsea_dir_parent = ../..
+
+-ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir) -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent) @LIBXPDFCPPFLAGS@ -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATFSRCDIR) -I$(LIBOBSDCOMPATFSRCDIR)/..
++ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir) -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent) -I/usr/include/poppler -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATFSRCDIR) -I$(LIBOBSDCOMPATFSRCDIR)/..
+ CXX = @CXX@
+
+ .SUFFIXES: .cc .o
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftex.mk
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/pdftex.mk 2007-07-03 12:03:20.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftex.mk 2007-07-03 12:08:40.000000000 +0200
+@@ -2,6 +2,9 @@
+ # This fragment contains the parts of the makefile that are most likely to
+ # differ between releases of pdfeTeX.
+
++# use libpoppler instead of included xpdf code
++ADDLDFLAGS = -lpoppler
++
+ # We build pdftex
+ pdftex = @PETEX@ pdftex
+ pdftexdir = pdftexdir
+@@ -29,7 +32,7 @@
+
+ # Making pdftex
+ pdftex: pdftexd.h $(pdftex_o) $(pdftexextra_o) $(pdftexlibsdep)
+- @CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@
++ @CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@ $(ADDLDFLAGS)
+
+ # C file dependencies.
+ $(pdftex_c) pdftexcoerce.h pdftexd.h: pdftex.p $(web2c_texmf) $(srcdir)/$(pdftexdir)/pdftex.defines $(srcdir)/$(pdftexdir)/pdftex.h
+@@ -153,10 +156,10 @@
+ rm -f ttf2afm.c macnames.c
+ #
+ # pdftosrc
+-pdftosrc = pdftosrc
++pdftosrc =
+
+ pdftosrc: $(pdftexdir)/pdftosrc.o $(LIBXPDFDEP)
+- @CXXHACKLINK@ $(pdftexdir)/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@
++ @CXXHACKLINK@ $(pdftexdir)/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@ $(ADDLDFLAGS)
+ $(pdftexdir)/pdftosrc.o:$(srcdir)/$(pdftexdir)/pdftosrc.cc
+ cd $(pdftexdir) && $(MAKE) pdftosrc.o
+ check: pdftosrc-check
+Index: texlive-bin-2007/build/source/configure
+===================================================================
+--- texlive-bin-2007.orig/build/source/configure 2007-07-03 12:08:40.000000000 +0200
++++ texlive-bin-2007/build/source/configure 2007-07-03 12:08:40.000000000 +0200
+@@ -3459,9 +3459,9 @@
+
+ # we need libxpdf for pdf[ex]tex, xetex
+ test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no}
+-test "$with_pdftex" != no && : ${needs_libxpdf=yes}
+-test "$with_pdfetex" != no && : ${needs_libxpdf=yes}
+-test "$with_xetex" != no && : ${needs_libxpdf=yes}
++test "$with_pdftex" != no && : ${needs_libxpdf=no}
++test "$with_pdfetex" != no && : ${needs_libxpdf=no}
++test "$with_xetex" != no && : ${needs_libxpdf=no}
+ : ${needs_libxpdf=no}
+ export needs_libxpdf
+
+Index: texlive-bin-2007/build/source/configure.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/configure.in 2007-07-03 12:08:40.000000000 +0200
++++ texlive-bin-2007/build/source/configure.in 2007-07-03 12:08:40.000000000 +0200
+@@ -157,9 +157,9 @@
+
+ # we need libxpdf for pdf[ex]tex, xetex
+ test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no}
+-test "$with_pdftex" != no && : ${needs_libxpdf=yes}
+-test "$with_pdfetex" != no && : ${needs_libxpdf=yes}
+-test "$with_xetex" != no && : ${needs_libxpdf=yes}
++test "$with_pdftex" != no && : ${needs_libxpdf=no}
++test "$with_pdfetex" != no && : ${needs_libxpdf=no}
++test "$with_xetex" != no && : ${needs_libxpdf=no}
+ : ${needs_libxpdf=no}
+ export needs_libxpdf
+
+@@ -207,7 +207,7 @@
+ sinclude(libs/libpng/libpng.ac)
+ sinclude(libs/zlib/zlib.ac)
+ sinclude(libs/ncurses/ncurses.ac)
+-sinclude(libs/xpdf/libxpdf.ac)
++#sinclude(libs/xpdf/libxpdf.ac)
+ sinclude(libs/t1lib/t1lib.ac)
+ sinclude(libs/gd/gd.ac)
+ sinclude(libs/freetype/freetype.ac)
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_ext.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/XeTeX_ext.c 2007-07-03 12:03:20.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_ext.c 2007-07-03 12:08:40.000000000 +0200
+@@ -33,7 +33,7 @@
+ */
+
+ #ifdef XETEX_OTHER
+-#include "xpdf/config.h"
++#include "poppler/poppler-config.h"
+ #include "png.h"
+ #endif
+
+@@ -194,7 +194,7 @@
+ #else
+ "Compiled with fontconfig version %d.%d.%d; using %d.%d.%d\n"
+ "Compiled with libpng version %s; using %s\n"
+- "Compiled with xpdf version %s\n"
++ "Compiled with libpoppler version %s\n"
+ #endif
+ ;
+
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/pdfimage.cpp
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/pdfimage.cpp 2007-07-03 12:03:20.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/pdfimage.cpp 2007-07-03 12:08:40.000000000 +0200
+@@ -11,10 +11,24 @@
+
+ #include "pdfimage.h"
+
+-#include "PDFDoc.h"
+-#include "Catalog.h"
+-#include "Page.h"
+-#include "GString.h"
++#include
++#include
++#include
++#include
++#include
++#include "poppler/Object.h"
++#include "poppler/Stream.h"
++#include "poppler/Array.h"
++#include "poppler/Dict.h"
++#include "poppler/XRef.h"
++#include "poppler/Link.h"
++#include "poppler/Catalog.h"
++#include "poppler/Page.h"
++#include "poppler/GfxFont.h"
++#include "poppler/PDFDoc.h"
++#include "poppler/GlobalParams.h"
++#include "poppler/Error.h"
++
+
+ #include "XeTeX_ext.h"
+
+@@ -28,7 +42,7 @@
+ int
+ pdf_get_rect(char* filename, int page_num, int pdf_box, realrect* box)
+ {
+- GString* name = new GString(filename);
++ GooString* name = new GooString(filename);
+ PDFDoc* doc = new PDFDoc(name);
+
+ if (!doc) {
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex.mk
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/xetex.mk 2007-07-03 12:03:20.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/xetex.mk 2007-07-03 12:08:40.000000000 +0200
+@@ -4,6 +4,10 @@
+
+ Makefile: $(srcdir)/xetexdir/xetex.mk
+
++# use libpoppler instead of included xpdf code
++ADDLDFLAGS = -lpoppler
++
++
+ # We build xetex unless configure decides to skip it
+ xetex = @XETEX@ xetex
+
+@@ -29,7 +33,7 @@
+
+ @XETEX_GENERIC@ XETEX_DEFINES = -DXETEX_OTHER
+
+-@XETEX_GENERIC@ EXTRALIBS = @LDLIBXPDF@ @LDLIBPNG@ @LDFONTCONFIG@
++@XETEX_GENERIC@ EXTRALIBS = @LDLIBXPDF@ @LDLIBPNG@ @LDFONTCONFIG@ $(ADDLDFLAGS)
+
+ @XETEX_GENERIC@ EXTRADEPS = @LIBXPDFDEP@ @LIBPNGDEP@
+
+@@ -144,7 +148,7 @@
+ $(compile) $(ALL_CFLAGS) $(LIBPNGCPPFLAGS) $(ZLIBCPPFLAGS) -c $< -o $@
+
+ pdfimage.o: $(srcdir)/xetexdir/pdfimage.cpp $(srcdir)/xetexdir/pdfimage.h
+- $(CXX) $(ALL_CFLAGS) $(LIBXPDFCPPFLAGS) -c $< -o $@
++ $(CXX) $(ALL_CFLAGS) $(LIBXPDFCPPFLAGS) -I/usr/include/poppler -c $< -o $@
+
+ XeTeX_pic.o: $(srcdir)/xetexdir/XeTeX_pic.c $(srcdir)/xetexdir/XeTeX_ext.h $(XeTeXImageHdrs)
+ $(compile) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/utils.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/utils.c 2007-07-03 12:03:20.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/utils.c 2007-07-03 12:08:40.000000000 +0200
+@@ -37,7 +37,7 @@
+ #include "zlib.h"
+ #include "ptexlib.h"
+ #include "png.h"
+-#include "xpdf/config.h" /* just to get the xpdf version */
++#include "poppler/poppler-config.h" /* just to get the xpdf version */
+
+ #define check_nprintf(size_get, size_want) \
+ if ((unsigned)(size_get) >= (unsigned)(size_want)) \
+@@ -1261,7 +1261,7 @@
+ (void) asprintf(versions,
+ "Compiled with libpng %s; using libpng %s\n"
+ "Compiled with zlib %s; using zlib %s\n"
+- "Compiled with xpdf version %s\n",
++ "Compiled with libpoppler version %s\n",
+ PNG_LIBPNG_VER_STRING, png_libpng_ver,
+ ZLIB_VERSION, zlib_version, xpdfVersion);
+ }
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftexextra.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/pdftexextra.in 2007-07-03 12:03:20.000000000 +0200
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftexextra.in 2007-07-03 12:08:40.000000000 +0200
+@@ -26,7 +26,7 @@
+ (generated from ../lib/texmfmp.c).
+ */
+
+-#define BANNER "This is pdfTeX, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION"
++#define BANNER "This is pdfTeX using libpoppler, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION"
+ #define COPYRIGHT_HOLDER "Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX)"
+ #define AUTHOR NULL
+ #define PROGRAM_HELP PDFTEXHELP
--- texlive-bin-2007.dfsg.1.orig/debian/patches/30_libpoppler_0.5.4
+++ texlive-bin-2007.dfsg.1/debian/patches/30_libpoppler_0.5.4
@@ -0,0 +1,510 @@
+# 30_libpoppler.dpatch
+#
+# use libpoppler instead of libxpdf in pdfetex and xetex
+# don't build pdftosrc as it needs libpoppler from experimental
+
+@DPATCH@
+ build/source/configure | 6 +-
+ build/source/configure.in | 8 +--
+ build/source/texk/web2c/pdftexdir/Makefile.in | 2
+ build/source/texk/web2c/pdftexdir/depend.mk | 58 +----------------------
+ build/source/texk/web2c/pdftexdir/pdftex.mk | 9 ++-
+ build/source/texk/web2c/pdftexdir/pdftexextra.in | 2
+ build/source/texk/web2c/pdftexdir/pdftoepdf.cc | 54 ++++++++++-----------
+ build/source/texk/web2c/pdftexdir/pdftosrc.cc | 40 ++++++++-------
+ build/source/texk/web2c/pdftexdir/utils.c | 4 -
+ build/source/texk/web2c/xetexdir/XeTeX_ext.c | 4 -
+ build/source/texk/web2c/xetexdir/pdfimage.cpp | 24 +++++++--
+ build/source/texk/web2c/xetexdir/xetex.mk | 8 ++-
+ 12 files changed, 96 insertions(+), 123 deletions(-)
+
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/depend.mk
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/depend.mk 2006-12-27 00:37:34.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/depend.mk 2007-05-19 14:21:27.000000000 +0200
+@@ -1,55 +1,5 @@
+-epdf.o: epdf.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-mapfile.o: mapfile.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-papersiz.o: papersiz.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h
+-utils.o: utils.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h \
+- ../../../libs/zlib/zlib.h ../../../libs/zlib/zconf.h \
+- ../../../libs/md5/md5.h pdftexextra.h \
+- ../../../libs/obsdcompat/openbsd-compat.h
+-vfpacket.o: vfpacket.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h
+-pkin.o: pkin.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writefont.o: writefont.c ../../../libs/xpdf/goo/gmem.h ptexlib.h \
+- ../pdftexd.h ../texmfmp.h ../cpascal.h ../config.h ../help.h \
+- ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writet1.o: writet1.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writet3.o: writet3.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
+- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
+-writezip.o: writezip.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h ../../../libs/zlib/zlib.h ../../../libs/zlib/zconf.h
+-writeenc.o: writeenc.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h
+-writettf.o: writettf.c ptexlib.h writettf.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h macnames.c
+-writejpg.o: writejpg.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h image.h
+-writepng.o: writepng.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h image.h
+-writeimg.o: writeimg.c ptexlib.h ../pdftexd.h ../texmfmp.h \
+- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
+- ptexmac.h image.h
+-pdftoepdf.o: pdftoepdf.cc ../../../libs/xpdf/xpdf/Object.h \
+- ../../../libs/xpdf/goo/gmem.h ../../../libs/xpdf/xpdf/Array.h \
+- ../../../libs/xpdf/xpdf/Dict.h ../../../libs/xpdf/xpdf/Stream.h \
+- ../../../libs/xpdf/xpdf/XRef.h ../../../libs/xpdf/xpdf/Catalog.h \
+- ../../../libs/xpdf/xpdf/Page.h ../../../libs/xpdf/xpdf/GfxFont.h \
+- ../../../libs/xpdf/xpdf/Error.h epdf.h
++pdftoepdf.o: pdftoepdf.cc epdf.h ../../kpathsea/c-auto.h \
++ ../../kpathsea/c-proto.h ../../web2c/c-auto.h ../../web2c/config.h \
++ ../../kpathsea/c-fopen.h ../../web2c/pdftexdir/ptexmac.h
+ ttf2afm.o: ttf2afm.c writettf.h macnames.c
+-pdftosrc.o: pdftosrc.cc ../../../libs/xpdf/xpdf/Object.h \
+- ../../../libs/xpdf/xpdf/Array.h ../../../libs/xpdf/xpdf/Dict.h \
+- ../../../libs/xpdf/xpdf/Stream.h ../../../libs/xpdf/xpdf/XRef.h \
+- ../../../libs/xpdf/xpdf/Catalog.h ../../../libs/xpdf/xpdf/Page.h \
+- ../../../libs/xpdf/xpdf/PDFDoc.h ../../../libs/xpdf/xpdf/Link.h \
+- ../../../libs/xpdf/xpdf/Error.h ../../../libs/xpdf/xpdf/config.h
++pdftosrc.o: pdftosrc.cc
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftoepdf.cc
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/pdftoepdf.cc 2006-12-27 00:37:34.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftoepdf.cc 2007-05-19 14:21:27.000000000 +0200
+@@ -26,25 +26,25 @@
+ #include
+ #include
+ #include
+-#include
+-#include
+-#include
+-#include
+-#include
+ #include
+-#include "Object.h"
+-#include "Stream.h"
+-#include "Array.h"
+-#include "Dict.h"
+-#include "XRef.h"
+-#include "Catalog.h"
+-#include "Link.h"
+-#include "Page.h"
+-#include "GfxFont.h"
+-#include "PDFDoc.h"
+-#include "GlobalParams.h"
+-#include "Error.h"
+-
++#include
++#include
++#include
++#include
++#include
++#include "poppler/Object.h"
++#include "poppler/UGooString.h"
++#include "poppler/Stream.h"
++#include "poppler/Array.h"
++#include "poppler/Dict.h"
++#include "poppler/XRef.h"
++#include "poppler/Link.h"
++#include "poppler/Catalog.h"
++#include "poppler/Page.h"
++#include "poppler/GfxFont.h"
++#include "poppler/PDFDoc.h"
++#include "poppler/GlobalParams.h"
++#include "poppler/Error.h"
+ #include "epdf.h"
+
+ // This file is mostly C and not very much C++; it's just used to interface
+@@ -169,7 +169,7 @@
+ fprintf(stderr, "\npdfTeX Debug: Creating %s (%d)\n", p->file_name,
+ p->occurences);
+ #endif
+- GString *docName = new GString(p->file_name);
++ GooString *docName = new GooString(p->file_name);
+ p->doc = new PDFDoc(docName); // takes ownership of docName
+ if (!p->doc->isOk() || !p->doc->okToPrint()) {
+ pdftex_fail("xpdf: reading PDF image failed");
+@@ -212,7 +212,7 @@
+ obj->initDict(xref);
+ for (int i = 0, l = dict->getLength(); i < l; i++) {
+ Object obj1;
+- obj->dictAdd(copyString(dict->getKey(i)), dict->getValNF(i, &obj1));
++ obj->dictAdd(*(new UGooString (*dict->getKey(i))), dict->getValNF(i, &obj1));
+ }
+ }
+
+@@ -291,7 +291,7 @@
+ static void copyDictEntry(Object * obj, int i)
+ {
+ PdfObject obj1;
+- copyName(obj->dictGetKey(i));
++ copyName(obj->dictGetKey(i)->getCString());
+ pdf_puts(" ");
+ obj->dictGetValNF(i, &obj1);
+ copyObject(&obj1);
+@@ -318,7 +318,7 @@
+ pdf_puts("<<\n");
+ assert(r->type == objFont); // FontDescriptor is in fd_tree
+ for (i = 0, l = obj->dictGetLength(); i < l; ++i) {
+- key = obj->dictGetKey(i);
++ key = obj->dictGetKey(i)->getCString();
+ if (strncmp("FontDescriptor", key, strlen("FontDescriptor")) == 0
+ || strncmp("BaseFont", key, strlen("BaseFont")) == 0
+ || strncmp("Encoding", key, strlen("Encoding")) == 0)
+@@ -424,7 +424,7 @@
+ for (i = 0, l = obj->dictGetLength(); i < l; ++i) {
+ obj->dictGetValNF(i, &fontRef);
+ if (fontRef->isRef())
+- copyFont(obj->dictGetKey(i), &fontRef);
++ copyFont(obj->dictGetKey(i)->getCString(), &fontRef);
+ else
+ pdftex_fail("PDF inclusion: invalid font in reference type <%s>",
+ fontRef->getTypeName());
+@@ -511,7 +511,7 @@
+ int i, l, c;
+ Ref ref;
+ char *p;
+- GString *s;
++ GooString *s;
+ if (obj->isBool()) {
+ pdf_printf("%s", obj->getBool()? "true" : "false");
+ } else if (obj->isInt()) {
+@@ -677,7 +677,7 @@
+ float pdf_version_found, pdf_version_wanted;
+ // initialize
+ if (!isInit) {
+- globalParams = new GlobalParams();
++ globalParams = new GlobalParams(NULL);
+ globalParams->setErrQuiet(gFalse);
+ isInit = gTrue;
+ }
+@@ -703,7 +703,7 @@
+ epdf_num_pages = pdf_doc->doc->getCatalog()->getNumPages();
+ if (page_name) {
+ // get page by name
+- GString name(page_name);
++ UGooString name(page_name);
+ LinkDest *link = pdf_doc->doc->findDest(&name);
+ if (link == 0 || !link->isOk())
+ pdftex_fail("PDF inclusion: invalid destination <%s>", page_name);
+@@ -924,7 +924,7 @@
+ pdf_puts("/Resources <<\n");
+ for (i = 0, l = obj1->dictGetLength(); i < l; ++i) {
+ obj1->dictGetVal(i, &obj2);
+- key = obj1->dictGetKey(i);
++ key = obj1->dictGetKey(i)->getCString();
+ if (strcmp("Font", key) == 0)
+ copyFontResources(&obj2);
+ else if (strcmp("ProcSet", key) == 0)
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftosrc.cc
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/pdftosrc.cc 2006-12-27 00:37:34.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftosrc.cc 2007-05-19 14:21:27.000000000 +0200
+@@ -25,22 +25,24 @@
+ #include
+ #include
+ #include
+-#include
+ #include
+-#include
+-#include
+-#include
+-#include "Object.h"
+-#include "Stream.h"
+-#include "Array.h"
+-#include "Dict.h"
+-#include "XRef.h"
+-#include "Catalog.h"
+-#include "Page.h"
+-#include "GfxFont.h"
+-#include "PDFDoc.h"
+-#include "GlobalParams.h"
+-#include "Error.h"
++
++#include
++#include
++#include
++#include
++#include "poppler/Object.h"
++#include "poppler/UGooString.h"
++#include "poppler/Stream.h"
++#include "poppler/Array.h"
++#include "poppler/Dict.h"
++#include "poppler/XRef.h"
++#include "poppler/Catalog.h"
++#include "poppler/Page.h"
++#include "poppler/GfxFont.h"
++#include "poppler/PDFDoc.h"
++#include "poppler/GlobalParams.h"
++#include "poppler/Error.h"
+
+ static XRef *xref = 0;
+
+@@ -48,7 +50,7 @@
+ {
+ char *p, buf[1024];
+ PDFDoc *doc;
+- GString *fileName;
++ GooString *fileName;
+ Stream *s;
+ Object srcStream, srcName, catalogDict;
+ FILE *outfile;
+@@ -62,8 +64,8 @@
+ "Usage: pdftosrc []\n");
+ exit(1);
+ }
+- fileName = new GString(argv[1]);
+- globalParams = new GlobalParams();
++ fileName = new GooString(argv[1]);
++ globalParams = new GlobalParams(NULL);
+ doc = new PDFDoc(fileName);
+ if (!doc->isOk()) {
+ fprintf(stderr, "Invalid PDF file\n");
+@@ -83,7 +85,7 @@
+ }
+ srcStream.initNull();
+ if (objnum == 0) {
+- catalogDict.dictLookup("SourceObject", &srcStream);
++ catalogDict.dictLookup(UGooString("SourceObject"), &srcStream);
+ if (!srcStream.isStream("SourceFile")) {
+ fprintf(stderr, "No SourceObject found\n");
+ exit(1);
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/Makefile.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/Makefile.in 2006-12-27 00:37:34.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/Makefile.in 2007-05-19 14:21:27.000000000 +0200
+@@ -8,7 +8,7 @@
+ kpathsea_srcdir_parent = $(srcdir)/../..
+ kpathsea_dir_parent = ../..
+
+-ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir) -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent) @LIBXPDFCPPFLAGS@ -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATFSRCDIR) -I$(LIBOBSDCOMPATFSRCDIR)/..
++ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir) -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent) -I/usr/include/poppler -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATFSRCDIR) -I$(LIBOBSDCOMPATFSRCDIR)/..
+ CXX = @CXX@
+
+ .SUFFIXES: .cc .o
+Index: texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftex.mk
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/pdftexdir/pdftex.mk 2006-12-27 00:37:34.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/pdftexdir/pdftex.mk 2007-05-19 14:21:27.000000000 +0200
+@@ -2,6 +2,9 @@
+ # This fragment contains the parts of the makefile that are most likely to
+ # differ between releases of pdfeTeX.
+
++# use libpoppler instead of included xpdf code
++ADDLDFLAGS = -lpoppler
++
+ # We build pdftex
+ pdftex = @PETEX@ pdftex
+ pdftexdir = pdftexdir
+@@ -29,7 +32,7 @@
+
+ # Making pdftex
+ pdftex: pdftexd.h $(pdftex_o) $(pdftexextra_o) $(pdftexlibsdep)
+- @CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@
++ @CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@ $(ADDLDFLAGS)
+
+ # C file dependencies.
+ $(pdftex_c) pdftexcoerce.h pdftexd.h: pdftex.p $(web2c_texmf) $(srcdir)/$(pdftexdir)/pdftex.defines $(srcdir)/$(pdftexdir)/pdftex.h
+@@ -153,10 +156,10 @@
+ rm -f ttf2afm.c macnames.c
+ #
+ # pdftosrc
+-pdftosrc = pdftosrc
++pdftosrc =
+
+ pdftosrc: $(pdftexdir)/pdftosrc.o $(LIBXPDFDEP)
+- @CXXHACKLINK@ $(pdftexdir)/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@
++ @CXXHACKLINK@ $(pdftexdir)/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@ $(ADDLDFLAGS)
+ $(pdftexdir)/pdftosrc.o:$(srcdir)/$(pdftexdir)/pdftosrc.cc
+ cd $(pdftexdir) && $(MAKE) pdftosrc.o
+ check: pdftosrc-check
+Index: texlive-bin-2007/build/source/configure
+===================================================================
+--- texlive-bin-2007.orig/build/source/configure 2007-05-19 14:21:16.000000000 +0200
++++ texlive-bin-2007/build/source/configure 2007-05-19 14:21:27.000000000 +0200
+@@ -3459,9 +3459,9 @@
+
+ # we need libxpdf for pdf[ex]tex, xetex
+ test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no}
+-test "$with_pdftex" != no && : ${needs_libxpdf=yes}
+-test "$with_pdfetex" != no && : ${needs_libxpdf=yes}
+-test "$with_xetex" != no && : ${needs_libxpdf=yes}
++test "$with_pdftex" != no && : ${needs_libxpdf=no}
++test "$with_pdfetex" != no && : ${needs_libxpdf=no}
++test "$with_xetex" != no && : ${needs_libxpdf=no}
+ : ${needs_libxpdf=no}
+ export needs_libxpdf
+
+Index: texlive-bin-2007/build/source/configure.in
+===================================================================
+--- texlive-bin-2007.orig/build/source/configure.in 2007-05-19 14:21:16.000000000 +0200
++++ texlive-bin-2007/build/source/configure.in 2007-05-19 14:21:27.000000000 +0200
+@@ -157,9 +157,9 @@
+
+ # we need libxpdf for pdf[ex]tex, xetex
+ test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no}
+-test "$with_pdftex" != no && : ${needs_libxpdf=yes}
+-test "$with_pdfetex" != no && : ${needs_libxpdf=yes}
+-test "$with_xetex" != no && : ${needs_libxpdf=yes}
++test "$with_pdftex" != no && : ${needs_libxpdf=no}
++test "$with_pdfetex" != no && : ${needs_libxpdf=no}
++test "$with_xetex" != no && : ${needs_libxpdf=no}
+ : ${needs_libxpdf=no}
+ export needs_libxpdf
+
+@@ -207,7 +207,7 @@
+ sinclude(libs/libpng/libpng.ac)
+ sinclude(libs/zlib/zlib.ac)
+ sinclude(libs/ncurses/ncurses.ac)
+-sinclude(libs/xpdf/libxpdf.ac)
++#sinclude(libs/xpdf/libxpdf.ac)
+ sinclude(libs/t1lib/t1lib.ac)
+ sinclude(libs/gd/gd.ac)
+ sinclude(libs/freetype/freetype.ac)
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_ext.c
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/XeTeX_ext.c 2007-01-15 14:04:36.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/XeTeX_ext.c 2007-05-19 14:21:27.000000000 +0200
+@@ -33,7 +33,7 @@
+ */
+
+ #ifdef XETEX_OTHER
+-#include "xpdf/config.h"
++#include "poppler/poppler-config.h"
+ #include "png.h"
+ #endif
+
+@@ -194,7 +194,7 @@
+ #else
+ "Compiled with fontconfig version %d.%d.%d; using %d.%d.%d\n"
+ "Compiled with libpng version %s; using %s\n"
+- "Compiled with xpdf version %s\n"
++ "Compiled with libpoppler version %s\n"
+ #endif
+ ;
+
+Index: texlive-bin-2007/build/source/texk/web2c/xetexdir/pdfimage.cpp
+===================================================================
+--- texlive-bin-2007.orig/build/source/texk/web2c/xetexdir/pdfimage.cpp 2006-12-09 11:29:12.000000000 +0100
++++ texlive-bin-2007/build/source/texk/web2c/xetexdir/pdfimage.cpp 2007-05-19 14:21:27.000000000 +0200
+@@ -11,10 +11,24 @@
+
+ #include "pdfimage.h"
+
+-#include "PDFDoc.h"
+-#include "Catalog.h"
+-#include "Page.h"
+-#include "GString.h"
++#include
++#include
++#include