From 3a7b521eec26059dd6c8de57c2fd8d4c7763bfa2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 5 Dec 2011 00:32:12 +0000 Subject: new script dosepsbin (11nov11) git-svn-id: svn://tug.org/texlive/trunk@24759 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/support/dosepsbin/Makefile.in | 114 ++++++++++++ Master/texmf-dist/doc/support/dosepsbin/README | 53 ++++++ .../texmf-dist/doc/support/dosepsbin/clean-case.pl | 20 +++ .../doc/support/dosepsbin/dosepsbin.html | 199 +++++++++++++++++++++ .../texmf-dist/doc/support/dosepsbin/dosepsbin.ltx | 100 +++++++++++ .../texmf-dist/doc/support/dosepsbin/dosepsbin.pdf | Bin 0 -> 46090 bytes .../texmf-dist/doc/support/dosepsbin/dosepsbin.txt | 119 ++++++++++++ Master/texmf-dist/doc/support/dosepsbin/version.pl | 145 +++++++++++++++ 8 files changed, 750 insertions(+) create mode 100644 Master/texmf-dist/doc/support/dosepsbin/Makefile.in create mode 100644 Master/texmf-dist/doc/support/dosepsbin/README create mode 100644 Master/texmf-dist/doc/support/dosepsbin/clean-case.pl create mode 100644 Master/texmf-dist/doc/support/dosepsbin/dosepsbin.html create mode 100644 Master/texmf-dist/doc/support/dosepsbin/dosepsbin.ltx create mode 100644 Master/texmf-dist/doc/support/dosepsbin/dosepsbin.pdf create mode 100644 Master/texmf-dist/doc/support/dosepsbin/dosepsbin.txt create mode 100644 Master/texmf-dist/doc/support/dosepsbin/version.pl (limited to 'Master/texmf-dist/doc/support/dosepsbin') diff --git a/Master/texmf-dist/doc/support/dosepsbin/Makefile.in b/Master/texmf-dist/doc/support/dosepsbin/Makefile.in new file mode 100644 index 00000000000..842810a171c --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/Makefile.in @@ -0,0 +1,114 @@ +# Makefile.in +# @configure_input@ + +# Copyright 2007, 2008, 2011 by Heiko Oberdiek. +# +# The file is part of project dosepsbin. +# It's free software; you may redistribute it and/or +# modify it under the same terms as Perl itself +# (Perl Artistic License/GNU General Public License, version 2). + +VPATH = @srcdir@ +srcdir = @srcdir@ +SHELL = @SHELL@ + +prefix = @prefix@ +datarootdir = @datarootdir@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +mandir = @mandir@ +manext = 1 +man1dir = $(mandir)/man$(manext) + +INSTALL = @INSTALL@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ + +PRJ = dosepsbin +SRC_FILE = $(PRJ).pl +SRC_FILES = $(SRC_FILE) $(PRJ).ltx clean-case.pl version.pl +DOC_FILES = $(PRJ).txt $(PRJ).man $(PRJ).html $(PRJ).pdf README +ALL_FILES = $(DOC_FILES) configure +AUTOSRC_FILES = configure.ac Makefile.in install-sh +DISTRIB_FILES = $(SRC_FILES) $(ALL_FILES) $(AUTOSRC_FILES) +PDFLATEX = TEXINPUTS=$(srcdir): pdflatex +LUALATEX = TEXINPUTS=$(srcdir): lualatex +TMP_FILE = __temp__.pl +FILE_DATE_VERSION = date-version.txt + +default all: + +include $(wildcard $(srcdir)/$(PRJ).mk) + +configure: configure.ac + autoconf + +Makefile: Makefile.in configure + ./configure + +doc: $(DOC_FILES) + +$(FILE_DATE_VERSION): $(SRC_FILE) + ./version.pl + autoconf + ./configure + +$(PRJ).txt: $(SRC_FILE) + pod2text -l $< $@ + +$(PRJ).man: $(SRC_FILE) $(FILE_DATE_VERSION) + pod2man -d "$(shell cat $(FILE_DATE_VERSION))" $< $@ + +html: $(PRJ).html +$(PRJ).html: $(SRC_FILE) ./clean-case.pl + ./clean-case.pl $< $(TMP_FILE) + pod2html --title=$(PRJ) --infile=$(TMP_FILE) --outfile=$@ + +$(PRJ).pdf: $(PRJ).ltx $(PRJ).tex + $(LUALATEX) $< + makeindex $(PRJ) + $(LUALATEX) $< + makeindex $(PRJ) + $(LUALATEX) $< + makeindex $(PRJ) + $(LUALATEX) $< + makeindex $(PRJ) + $(LUALATEX) $< + +$(PRJ).tex: $(SRC_FILE) + ./clean-case.pl $< $(TMP_FILE) + pod2latex -out $@ $(TMP_FILE) + recode latin1..utf8 $@ + +distrib: $(PRJ).zip + +$(PRJ).zip: $(DISTRIB_FILES) + zip -9j $@ $+ + +install: + $(INSTALL) -d $(bindir) $(man1dir) + $(INSTALL_SCRIPT) $(srcdir)/$(PRJ).pl $(bindir)/$(PRJ) + $(INSTALL_DATA) $(srcdir)/$(PRJ).man $(man1dir)/$(PRJ).1 + +check: $(SRC_FILE) + podchecker $< + +uninstall: + -rm -f $(bindir)/$(PRJ) $(man1dir)/$(PRJ).1 + +clean: + -rm -f $(PRJ).aux $(PRJ).log $(PRJ).toc + -rm -f $(PRJ).idx $(PRJ).ind $(PRJ).ilg + -rm -f pod2htmd.tmp pod2htmi.tmp + +distclean: clean + -rm -f Makefile config.status config.log config.cache + -rm -f $(PRJ).tex + +realclean: distclean + -rm -f $(ALL_FILES) $(PRJ).zip + +mostlyclean: clean + +.PHONY: default all doc distrib install check uninstall \ + clean distclean realclean mostlyclean test html diff --git a/Master/texmf-dist/doc/support/dosepsbin/README b/Master/texmf-dist/doc/support/dosepsbin/README new file mode 100644 index 00000000000..83dd6571808 --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/README @@ -0,0 +1,53 @@ +README for dosepsbin 2011/11/10 v1.0 + +Copyright 2011 by Heiko Oberdiek + +License +======= +The file is part of project dosepsbin. +It's free software; you may redistribute it and/or +modify it under the same terms as Perl itself +(Perl Artistic License/GNU General Public License, version 2). + +Requirements +============ +* Perl + +Documentation +============= +The source of the documentation is embedded as POD data +in the Perl script dosepsbin.pl. The documentation is +available in various formats: +* Manual page: dosepsbin.man +* PDF file: dosepsbin.pdf +* HTML file: dosepsbin.html +* Text file: dosepsbin.txt +And program option --man displays the documentation on +the screen. + +Installation +============ +* Unix: + GNU autoconf was used, thus you can try: + ./configure + make install + It should install the script and manual page. + The other documentation files can be installed manually. + +* Manually: + * dosepsbin.pl: Install the file as `dosepsbin' in a directory + that is listed in environment variable `PATH', e.g. + /usr/local/bin/dosepsbin + * dosepsbin.man: Install the manual page as `dosepsbin.1' + in the appropriate directory, e.g.: + /usr/local/man/man1/dosepsbin.1 + * dosepsbin.pdf, dosepsbin.html, dosepsbin.html, README: + Install them where you find them, for example in directory: + /usr/local/share/doc/dosepsbin/ + +The files clean-case.pl and version.pl are just helper scripts for +generating the documentation and are provided for sake of completeness. +They are usually not needed, because the documentation files are +already generated and provided in the distribution. + +See the documentation for further information. diff --git a/Master/texmf-dist/doc/support/dosepsbin/clean-case.pl b/Master/texmf-dist/doc/support/dosepsbin/clean-case.pl new file mode 100644 index 00000000000..fe72e184d02 --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/clean-case.pl @@ -0,0 +1,20 @@ +#!/usr/bin/env perl +use strict; +$^W=1; + +@ARGV == 2 or die "!!! Syntax: \n"; + +my $infile = $ARGV[0]; +my $outfile = $ARGV[1]; + +open(IN, '<', $infile) or die "!!! Error: Cannot open `$infile'!\n"; +open(OUT, '>', $outfile) or die "!!! Error: Cannot write `$outfile'!\n"; +while () { + s/^(=head[1] [A-Z])(.*)/$1\L$2\E/; + s/(L<"[A-Z])([^"]+)">/$1\L$2\E">/g; + print OUT; +} +close(IN); +close(OUT); + +__END__ diff --git a/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.html b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.html new file mode 100644 index 00000000000..63477cdc835 --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.html @@ -0,0 +1,199 @@ + + + +dosepsbin + + + + + +

+ + + + + +
+

+

+

Name

+

dosepsbin -- Extract PS/WMF/TIFF sections from DOS EPS binary files

+

+

+
+

Version

+

2011-11-10 v1.0

+

+

+
+

Synopsis

+

The progam dosepsbin analyses an EPS file that is not +a plain ASCII PostScript file but given as DOS EPS binary file.

+
+    dosepsbin [options] <input file>
+

First it analyzes the input file, validates its header +and summarizes the available sections. Depending on the +given options, the sections are then written to files.

+

Options:

+
+    --eps-file <file>      Write PS section to <file>.
+    --wmf-file <file>      Write WMF section to <file>.
+    --tiff-file <file>      Write WMF section to <file>.
+    --inputfile <file>     The name of the input file.
+    --verbose              Verbose output.
+    --quiet                Only errors and warnings are printed.
+    --help                 Brief help message.
+    --man                  Full documentation.
+    --version              Print version identification.
+

The files for output must be different from the input file.

+

+

+
+

Description

+

+

+

DOS EPS Binary File Format

+

A Encapsulated PostScript (EPS) file can also given in a special +binary format to support the inclusion of a thumbnail. The file +format starts with a binary header that contains the positions of +the possible sections:

+ +

The PS section must be present and either the WMF file or the TIFF +file should be given.

+

+

+
+

Options

+
+
--eps-file=<file>
+
+
+The PS section is written to <file>. The output file must +be different from the input file. +
+

+
--wmf-file=<file>
+
+
+The WMF section is written to <file> if present. The output +file must be different from the input file. +
+

+
--tiff-file=<file>
+
+
+The TIFF section is written to <file> if present. The output +file must be different from the input file. +
+

+
--inputfile=<file>
+
+
+The input file can also be given directly on the command line. +If the file does not exist, then the file with extension `.eps' +is tried. +
+

+
--verbose
+
+
+Verbose messages. +
+

+
--quiet
+
+
+No messages are printed except for errors and warnings. +
+

+
--help
+
+
+Display help screen. +
+

+
--man
+
+
+Prints manual page. +
+

+
--version
+
+
+Print version identification and exit. +
+

+

+

+
+

Examples

+

The following command extracts the PS section from file test.eps +and stores the result in file test-ps.eps:

+
+    dosepsbin --eps-file test-ps.eps test.eps
+

+

+
+

Author

+

Heiko Oberdiek, email: heiko.oberdiek at googlemail.com

+

+

+
+

Copyright and license

+

Copyright 2011 by Heiko Oberdiek.

+

This library is free software; you may redistribute it and/or +modify it under the same terms as Perl itself +(Perl Artistic License/GNU General Public License, version 2).

+

+

+
+

See also

+

The DOS EPS binary file format is described +in section ``5.2 Windows Metafile or TIFF'':

+
+    Adobe Developer Support,
+    Encapsulated PostScript File Format Specification,
+    Version 3.0,
+    1992-05-01,
+    http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf
+

+

+
+

History

+
    +
  1. 2011/11/10 v1.0
    +
  2. + +
+ + + + diff --git a/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.ltx b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.ltx new file mode 100644 index 00000000000..c2206cdc21d --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.ltx @@ -0,0 +1,100 @@ +% dosepsbin.ltx +% +% Copyright 2011 by Heiko Oberdiek. +% +% The file is part of project dosepsbin. +% It's free software; you may redistribute it and/or +% modify it under the same terms as Perl itself +% (Perl Artistic License/GNU General Public License, version 2). + +\documentclass[a4paper,12pt]{article} + +\providecommand*{\DATE}{2011/11/10} +\providecommand*{\VERSION}{1.0} + +\usepackage[ + hmargin=1in, + top=.75in, + bottom=.5in, + includefoot, + headheight=14.5pt, + footskip=40pt, +]{geometry} + +\usepackage{fancyhdr} +\renewcommand*{\headrulewidth}{0pt} +\renewcommand*{\footrulewidth}{0.4pt} +\fancyhead{} +\fancyfoot[L]{\textsf{dosepsbin}} +\fancyfoot[C]{\DATE\ v\VERSION} +\fancyfoot[R]{\thepage} +\pagestyle{fancy} +\makeatletter +\let\ps@plain\ps@fancy +\makeatother + +\makeatletter +\renewenvironment*{theindex}{% + \section*{\indexname}% + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus .3pt}% + \let\item\@idxitem +}{% + \clearpage +} +\makeatother + +\usepackage{ifluatex} +\ifluatex + \usepackage{fontspec} +\else + \usepackage[T1]{fontenc}% + \usepackage{lmodern}% + \usepackage[utf8]{inputenc}% +\fi + +\usepackage{makeidx} + +\usepackage{hyperref} +\hypersetup{ + colorlinks, + pdfauthor={Heiko Oberdiek}, + pdftitle={dosepsbin}, +} +\definecolor{linkcolor}{rgb}{0,0,.8} +\hypersetup{ + linkcolor=linkcolor, +} + +\usepackage{bookmark} +\bookmarksetup{ + open, + numbered, +} + +\makeindex + +\author{Heiko Oberdiek} +\title{Program \textsf{dosepsbin}} +\date{\DATE\space v\VERSION} + +% ignore minor overfull \hbox warnings +\setlength{\hfuzz}{1.5pt} + +\begin{document} + +\maketitle + +\pdfbookmark[1]{\contentsname}{toc} +\tableofcontents + +\makeatletter +\let\org@section\section +\def\section{\@ifstar\org@section\org@section} +\makeatother + +\input{dosepsbin.tex} + +\printindex + +\end{document} diff --git a/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.pdf b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.pdf new file mode 100644 index 00000000000..854143d8eec Binary files /dev/null and b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.pdf differ diff --git a/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.txt b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.txt new file mode 100644 index 00000000000..3980a9e55c4 --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/dosepsbin.txt @@ -0,0 +1,119 @@ +NAME + + dosepsbin -- Extract PS/WMF/TIFF sections from DOS EPS binary files + +VERSION + + 2011-11-10 v1.0 + +SYNOPSIS + + The progam dosepsbin analyses an EPS file that is not a plain ASCII + PostScript file but given as DOS EPS binary file. + + dosepsbin [options] + + First it analyzes the *input file*, validates its header and summarizes + the available sections. Depending on the given options, the sections are + then written to files. + + Options: + + --eps-file Write PS section to . + --wmf-file Write WMF section to . + --tiff-file Write WMF section to . + --inputfile The name of the input file. + --verbose Verbose output. + --quiet Only errors and warnings are printed. + --help Brief help message. + --man Full documentation. + --version Print version identification. + + The files for output must be different from the input file. + +DESCRIPTION + + DOS EPS Binary File Format + + A Encapsulated PostScript (EPS) file can also given in a special binary + format to support the inclusion of a thumbnail. The file format starts + with a binary header that contains the positions of the possible + sections: + + * Postscript (PS) + * Windows Metafile Format (WMF) + * Tag Image File Format (TIFF) + + The PS section must be present and either the WMF file or the TIFF file + should be given. + +OPTIONS + + --eps-file=<*file*> + The PS section is written to <*file*>. The output file must be + different from the input file. + + --wmf-file=<*file*> + The WMF section is written to <*file*> if present. The output file + must be different from the input file. + + --tiff-file=<*file*> + The TIFF section is written to <*file*> if present. The output file + must be different from the input file. + + --inputfile=<*file*> + The input file can also be given directly on the command line. If + the file does not exist, then the file with extension `.eps' is + tried. + + --verbose + Verbose messages. + + --quiet + No messages are printed except for errors and warnings. + + --help + Display help screen. + + --man + Prints manual page. + + --version + Print version identification and exit. + +EXAMPLES + + The following command extracts the PS section from file test.eps and + stores the result in file test-ps.eps: + + dosepsbin --eps-file test-ps.eps test.eps + +AUTHOR + + Heiko Oberdiek, email: heiko.oberdiek at googlemail.com + +COPYRIGHT AND LICENSE + + Copyright 2011 by Heiko Oberdiek. + + This library is free software; you may redistribute it and/or modify it + under the same terms as Perl itself (Perl Artistic License/GNU General + Public License, version 2). + +SEE ALSO + + The DOS EPS binary file format is described in section "5.2 Windows + Metafile or TIFF": + + Adobe Developer Support, + Encapsulated PostScript File Format Specification, + Version 3.0, + 1992-05-01, + http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf + +HISTORY + + 2011/11/10 v1.0 + + * First version. + diff --git a/Master/texmf-dist/doc/support/dosepsbin/version.pl b/Master/texmf-dist/doc/support/dosepsbin/version.pl new file mode 100644 index 00000000000..524edb8a6ec --- /dev/null +++ b/Master/texmf-dist/doc/support/dosepsbin/version.pl @@ -0,0 +1,145 @@ +#!/usr/bin/env perl +use strict; +$^W=1; + +my $prj = 'dosepsbin'; +my $infile = "$prj.pl"; +my $acfile = 'configure.ac'; +my $ltxfile = "$prj.ltx"; +my $readmefile = 'README'; +my $datefile = 'date-version.txt'; +my $tmpfile = "version.tmp"; + +my $date = ''; +my $version = ''; +my $copyright_years = ''; +my $pl_date_version = ''; + +open(IN, '<', $infile) or die "!!! Error: Cannot open `$infile'!\n"; +while () { + if (/my \$date\s*=\s*'([0-9\/]+)'/) { + $date = $1; + next; + } + if (/my \$version\s*=\s*'([0-9\.]+)'/) { + $version = $1; + next; + } + if (/my \$copyright\s*=\s*"Copyright (.*) \$author"/) { + $copyright_years = $1; + next; + } + if (/^(\d{4}-\d{2}-\d{2} v\d+\.\d+)\s*$/) { + $pl_date_version = $1; + next; + } +} + +$date or die "!!! Error: Date not found!\n"; +$version or die "!!! Error: Version not found!\n"; +$copyright_years or die "!!! Error: Copyright years not found!\n"; +my $isodate = $date; +$isodate =~ s|/|-|g; +my $date_version = "$isodate v$version"; +$pl_date_version or die "!!! Error: VERSION/POD not found!\n"; +$pl_date_version eq $date_version or die "!!! Error: Fix VERSION in pod section!\n"; + +open(OUT, '>', $tmpfile) or die "!!! Error: Cannot open `$tmpfile'!\n"; +open(IN, '<', $acfile) or die "!!! Error: Cannot open `$acfile'!\n"; +my $found = 0; +my $update = 0; +while () { + if (/^(dnl Copyright )(.*)( by .*)$/) { + $found |= 1; + $_ = "$1$copyright_years$3\n"; + $update = 1 unless $2 eq $copyright_years; + } + if (/^(AC_INIT\(dosepsbin, )([^,]*)(,.*|\).*)$/) { + $found |= 2; + $_ = "$1$version$3\n"; + $update = 1 unless $2 eq $version; + } + print OUT; +} +die "!!! Error: COPYRIGHT or AC_INIT line not found!\n" unless $found = 3; +unlink $acfile or die "!!! Error: Cannot delete `$acfile'!\n"; +rename $tmpfile, $acfile + or die "!!! Error: Cannot rename `$tmpfile' to `$acfile'!\n"; +print "--> `$acfile' updated\n" if $update; + +open(OUT, '>', $tmpfile) or die "!!! Error: Cannot open `$tmpfile'!\n"; +open(IN, '<', $ltxfile) or die "!!! Error: Cannot open `$ltxfile'!\n"; +$found = 0; +$update = 0; +while () { + if (/^(% Copyright )(.*)( by .*)$/) { + $found |= 1; + $_ = "$1$copyright_years$3\n"; + $update = 1 unless $2 eq $copyright_years; + } + if (/^(\\providecommand\*{\\DATE}{)(.*)(})$/) { + $found |= 2; + $_ = "$1$date$3\n"; + $update = 1 unless $2 eq $date; + } + if (/^(\\providecommand\*{\\VERSION}{)(.*)(})$/) { + $found |= 4; + $_ = "$1$version$3\n"; + $update = 1 unless $2 eq $version; + } + print OUT; +} +close(IN); +close(OUT); +die "!!! Error: COPYRIGHT or DATE or VERSION line not found!\n" + unless $found == 7; +unlink $ltxfile or die "!!! Error: Cannot delete `$ltxfile'!\n"; +rename $tmpfile, $ltxfile + or die "!!! Error: Cannot rename `$tmpfile' to `$ltxfile'!\n"; +print "--> `$ltxfile' updated\n" if $update; + +open(OUT, '>', $tmpfile) or die "!!! Error: Cannot open `$tmpfile'!\n"; +open(IN, '<', $readmefile) or die "!!! Error: Cannot open `$readmefile'!\n"; +$found = 0; +$update = 0; +while () { + if (/^(Copyright )(.*)( by .*)$/) { + $found |= 1; + $_ = "$1$copyright_years$3\n"; + $update = 1 unless $2 eq $copyright_years; + } + if (/^(README for dosepsbin )([0-9\/]+) v([0-9\.]+)$/) { + $found |= 2; + $_ = "$1$date v$version\n"; + $update = 1 unless $2 eq $date and $3 eq $version; + } + print OUT; +} +close(IN); +close(OUT); +die "!!! Error: COPYRIGHT or DATE/VERSION line not found!\n" + unless $found == 3; +unlink $readmefile or die "!!! Error: Cannot delete `$readmefile'!\n"; +rename $tmpfile, $readmefile + or die "!!! Error: Cannot rename `$tmpfile' to `$readmefile'!\n"; +print "--> `$readmefile' updated.\n" if $update; + +my $old_date_version = ''; +if (-f $datefile) { + open(IN, '<', $datefile) or die "!!! Error: Cannot open `$datefile'!\n"; + my @lines = ; + $old_date_version = "@lines"; + close(IN); +} +if ($old_date_version eq $date_version) { + # print "--> `$datefile' is already uptodate.\n"; +} +else { + open(OUT, '>', $datefile) or die "!!! Error: Cannot open `$datefile'!\n"; + print OUT $date_version; + close(OUT); + print "--> `$datefile' updated.\n"; +} + +1; +__END__ -- cgit v1.2.3