summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-08-25 20:51:20 +0000
committerKarl Berry <karl@freefriends.org>2007-08-25 20:51:20 +0000
commitaedb3c36da442e7ba092091db6c7738501f32727 (patch)
tree17c8dcc63aef7fabc8a10771deb98d34e729e801 /Master/texmf-dist
parent1a1ffec14c7747126e8c552b7e63935ce040316d (diff)
finish makedtx update
git-svn-id: svn://tug.org/texlive/trunk@4819 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/makedtx/CHANGES19
-rw-r--r--Master/texmf-dist/doc/latex/makedtx/README4
-rw-r--r--Master/texmf-dist/doc/latex/makedtx/makedtx-manual.html119
-rw-r--r--Master/texmf-dist/doc/latex/makedtx/makedtx.pdfbin198173 -> 202740 bytes
-rw-r--r--Master/texmf-dist/doc/latex/makedtx/makedtx.pl342
5 files changed, 328 insertions, 156 deletions
diff --git a/Master/texmf-dist/doc/latex/makedtx/CHANGES b/Master/texmf-dist/doc/latex/makedtx/CHANGES
new file mode 100644
index 00000000000..cbd18311fda
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/makedtx/CHANGES
@@ -0,0 +1,19 @@
+version 0.94 (2007/08/19) :
+
+ * Default preamble changed to one which conforms with the
+ LaTeX Project Public License (LPPL)
+ * license switch added
+
+version 0.93 (2007/08/02) :
+
+ * version switch added
+ * comment switch added
+ * codetitle switch added
+
+version 0.91 (2006/07/21) :
+
+ * prefinale switch added
+
+version 0.9 (2005/02/11) :
+
+ * Initial beta release
diff --git a/Master/texmf-dist/doc/latex/makedtx/README b/Master/texmf-dist/doc/latex/makedtx/README
index 5e65973a0e7..e4abbba5d90 100644
--- a/Master/texmf-dist/doc/latex/makedtx/README
+++ b/Master/texmf-dist/doc/latex/makedtx/README
@@ -1,6 +1,6 @@
-makedtx v0.93b : a Perl script to help create .dtx and .ins files
+makedtx v0.94b : a Perl script to help create .dtx and .ins files
-Last Modified : 2 August 2007
+Last Modified : 19 August 2007
Author : Nicola Talbot
diff --git a/Master/texmf-dist/doc/latex/makedtx/makedtx-manual.html b/Master/texmf-dist/doc/latex/makedtx/makedtx-manual.html
index d99beb071cc..4438c92c219 100644
--- a/Master/texmf-dist/doc/latex/makedtx/makedtx-manual.html
+++ b/Master/texmf-dist/doc/latex/makedtx/makedtx-manual.html
@@ -7,8 +7,8 @@ original version by: Nikos Drakos, CBLU, University of Leeds
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
-<TITLE>makedtx v0.93b : a Perl script to help create a DTX file from source code</TITLE>
-<META NAME="description" CONTENT="makedtx v0.93b : a Perl script to help create a DTX file from source code">
+<TITLE>makedtx v0.94b : a Perl script to help create a DTX file from source code</TITLE>
+<META NAME="description" CONTENT="makedtx v0.94b : a Perl script to help create a DTX file from source code">
<META NAME="keywords" CONTENT="manual">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
@@ -22,12 +22,12 @@ original version by: Nikos Drakos, CBLU, University of Leeds
<BODY >
-<H1 ALIGN="CENTER">makedtx v0.93b : a Perl script to help create a DTX
+<H1 ALIGN="CENTER">makedtx v0.94b : a Perl script to help create a DTX
file from source code</H1>
<P ALIGN="CENTER"><STRONG>Nicola Talbot
<BR><TT><A NAME="tex2html1"
HREF="http://theoval.cmp.uea.ac.uk/~nlct/">http://theoval.cmp.uea.ac.uk/~nlct/</A></TT></STRONG></P>
-<P ALIGN="CENTER"><STRONG>2nd August 2007</STRONG></P>
+<P ALIGN="CENTER"><STRONG>19th August 2007</STRONG></P>
<P>
<BR>
@@ -100,7 +100,7 @@ HTML).
<P>
Why should I want to convert my documentation to HTML when I can just
-use PDFL<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X? The more general purpose packages that I write (such
+use PDFLaTeX? The more general purpose packages that I write (such
as <TT>datetime</TT> and <TT>glossary</TT>) I upload to CTAN, however
most of the packages I write are specific to the School of Computing
Sciences at the University of East Anglia, so these I keep on my web
@@ -116,7 +116,7 @@ also has the added convenience in that I don't have to keep copying
and pasting the character table every time I write a new package, and
it saves the laborious task of writing the installation
script<A NAME="tex2html2"
- HREF="#foot47"><SUP>1</SUP></A>.
+ HREF="#foot51"><SUP>1</SUP></A>.
<P>
This document is structured as follows: Section&nbsp;<A HREF="manual.html#sec:install">2</A>
@@ -137,7 +137,7 @@ Installation
<P>
You need to download both <TT>makedtx.dtx</TT> and
<TT>makedtx.ins</TT>, and run the installation script through
-L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X:
+LaTeX:
<P>
<TT>latex makedtx.ins</TT>
@@ -148,7 +148,7 @@ The following files will be created:
<DD>Perl script
</DD>
<DT><STRONG><TT>creatdtx.sty</TT></STRONG></DT>
-<DD>L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X package for use with <TT>makedtx.pl</TT>
+<DD>LaTeX package for use with <TT>makedtx.pl</TT>
</DD>
<DT><STRONG><TT>creatdtx.perl</TT></STRONG></DT>
<DD>Corresponding Perl script for use with LaTeX2HTML
@@ -170,7 +170,7 @@ path. If <TT>perl</TT> is located somewhere other than
<TT>/usr/bin/</TT> you will need to edit the first line of
<TT>makedtx.pl</TT>. (If you don't know where <TT>perl</TT> is
located, you can use the command: <TT>which perl</TT>.) The package
-<TT>creatdtx.sty</TT> needs to be placed somewhere on the L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X path
+<TT>creatdtx.sty</TT> needs to be placed somewhere on the LaTeX path
and <TT>creatdtx.perl</TT> should be placed in a directory searched by
. (See the documentation for details.)
@@ -208,8 +208,8 @@ best described using examples.
Suppose you have your documentation in the file <TT>foodoc.tex</TT>,
and the original source code is in the file <TT>foosrc.sty</TT>. You
want to create the files <TT>foo.dtx</TT> and <TT>foo.ins</TT>. When
-you L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X <TT>foo.dtx</TT> you want the documentation as specified
-in <TT>foodoc.tex</TT> and when you L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X <TT>foo.ins</TT> you want
+you LaTeX <TT>foo.dtx</TT> you want the documentation as specified
+in <TT>foodoc.tex</TT> and when you LaTeX <TT>foo.ins</TT> you want
the file <TT>foo.sty</TT> to be created, using the code specified in
<TT>foosrc.sty</TT>. You will need to do:
<PRE>
@@ -296,12 +296,28 @@ manually and you don't want your modifications overwritten.
<DD>Set the preamble to
<TT>text</TT>. The default preamble is:
<P>
-<TT>Copyright (C) <I>date</I> <I>author</I>, all rights reserved.
-If you modify this file, you must change its name first.
-You are NOT ALLOWED to distribute this file alone. You are NOT
-ALLOWED to take money for the distribution or use of either this
-file or a changed version, except for a nominal charge for copying
-etc.
+<TT>
+ <I>basename</I>.dtx
+ Copyright <I>date</I> <I>author</I>
+</TT>
+<P>
+<TT>This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either version 1.3
+ of this license of (at your option) any later version.
+ The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+ and version 1.3 or later is part of all distributions of LaTeX
+ version 2005/12/01 or later.
+</TT>
+<P>
+<TT>This work has the LPPL maintenance status `maintained'.
+</TT>
+<P>
+<TT>The Current Maintainer of this work is <I>author</I>.
+</TT>
+<P>
+<TT>This work consists of the files <I>basename</I>.dtx and
+ <I>basename</I>.ins and the derived files <I>file list</I>.
</TT>
<P>
@@ -309,6 +325,22 @@ where <I>date</I> is the copyright date, and <I>author</I> is the
author's name (see below).
<P>
+<B>Note that this has been changed as of makedtx v0.94.
+Older versions of makedtx do not conform to any of the free
+licenses.</B>
+
+<P>
+</DD>
+<DT><STRONG><TT>-license</TT> <I>name</I></STRONG></DT>
+<DD>This sets the preamble to
+the license text for the license <I>name</I>. Currently <I>name</I>
+may be either <TT>lppl</TT> (the default, which produces the
+default preamble detailed above), <TT>bsd</TT> or <TT>gpl</TT>.
+You may use either <TT>-license</TT> or <TT>-preamble</TT>,
+but not both. (If you have used the <TT>-preamble</TT> switch, the
+<TT>-license</TT> switch will be ignored.)
+
+<P>
</DD>
<DT><STRONG><TT>-postamble</TT> <I>text</I></STRONG></DT>
<DD>Set the postamble to
@@ -353,7 +385,7 @@ in the dtx file.
<TT>&#092;file</TT> command in the installation script. To illustrate this,
let's suppose you have source files <TT>foo.sty</TT>, <TT>bar.sty</TT>
and <TT>foobar.pl</TT> in the subdirectory <TT>sourcefiles</TT>.
-Since <TT>foo.sty</TT> and <TT>bar.sty</TT> are L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X files, they
+Since <TT>foo.sty</TT> and <TT>bar.sty</TT> are LaTeX files, they
should have pre- and postambles, but <TT>foobar.pl</TT> is a Perl
file, and since the percent symbol (%) is not a comment character in
Perl, there should be no pre- and postambles for this file. Therefore
@@ -375,9 +407,7 @@ corresponding files. So, in the above example, when you do:
preamble but you do want the character table included use
<code>\\usepreamble\\empty</code> instead of <code>\\nopreamble</code>.
Conversely, if you want a preamble but don't want the character table
-do something like <code>\\nopreamble\\usepreamble\\defaultpreamble</code>,
-although I can't think of a good reason for wanting either of these
-situations.)
+do something like <code>\\nopreamble\\usepreamble\\defaultpreamble</code>.
<P>
Note that the <code>=&gt;</code><I>text</I> part is optional. If it is
@@ -419,7 +449,7 @@ The creatdtx Package
<P>
The documentation source code, as specified using the <TT>-doc</TT>
-switch will typically be a standard L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X document using the
+switch will typically be a standard LaTeX document using the
<TT>ltxdoc</TT> class file. Unlike the DTX file, there is no
<TT>&#092;DocInput</TT> command, and the lines do not begin with a percent
symbol, which means that the document can be, say, passed to the
@@ -434,7 +464,7 @@ although this package will be not be included in the DTX file by
package:<TT>&#092;ifmakedtx{</TT><EM>dtx text</EM><TT>}{</TT><EM>non dtx text</EM><TT>}</TT>. The first
argument <I>dtx text</I> will be copied to the DTX file by
<TT>makedtx.pl</TT>, but the second argument <I>non dtx text</I>
-won't. However, if you L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X the document, the first argument will
+won't. However, if you LaTeX the document, the first argument will
be ignored, and the second argument will be used.
<P>
@@ -447,7 +477,7 @@ line:
<P>
<BR>
<BR>the <TT>html</TT> package will only be
-loaded if you L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X <TT>foodoc.tex</TT>, but not when you L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X <TT>foo.dtx</TT>.
+loaded if you LaTeX <TT>foodoc.tex</TT>, but not when you LaTeX <TT>foo.dtx</TT>.
<P>
The Perl script <TT>creatdtx.perl</TT> ignores the following commands
@@ -491,7 +521,7 @@ something like:
</PRE>
Now let's make some (very brief) documentation. Let's call the file,
say <TT>manual.tex</TT><A NAME="tex2html3"
- HREF="#foot450"><SUP>2</SUP></A>:
+ HREF="#foot477"><SUP>2</SUP></A>:
<PRE>
\documentclass{ltxdoc}
\usepackage{creatdtx}
@@ -591,16 +621,27 @@ code:
</PRE>
The installation file <TT>dashdate.ins</TT> looks like:
<PRE>
- % dashdate.ins generated using makedtx.pl version 0.9b 2005/2/10 22:22
+ % dashdate.ins generated using makedtx.pl version 0.94b 2007/8/19 22:22
\input docstrip
\preamble
- Copyright (C) 2005 AN Other, all rights reserved.
- If you modify this file, you must change its name first.
- You are NOT ALLOWED to distribute this file alone. You are NOT
- ALLOWED to take money for the distribution or use of either this
- file or a changed version, except for a nominal charge for copying
- etc.
+ dashdate.dtx
+ Copyright 2007 AN Other
+
+ This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either version 1.3
+ of this license of (at your option) any later version.
+ The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+ and version 1.3 or later is part of all distributions of LaTeX
+ version 2005/12/01 or later.
+
+ This work has the LPPL maintenance status `maintained'.
+
+ The Current Maintainer of this work is AN Other.
+
+ This work consists of the files dashdate.dtx and
+ dashdate.ins and the derived file dashdate.sty.
\endpreamble
\askforoverwritefalse
@@ -655,8 +696,8 @@ comment character in Perl, the <TT>macrocode</TT> environment is not
included in the source code, and needs to be added. (If you are
unfamiliar with DocStrip and the use of the <TT>macrocode</TT>
environment, I suggest you read either <I>A guide to
-L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X</I>&nbsp;[<A
- HREF="manual.html#Kopka98">2</A>, Appendix&nbsp;D] or <I>The L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X companion</I>&nbsp;[<A
+LaTeX</I>&nbsp;[<A
+ HREF="manual.html#Kopka98">2</A>, Appendix&nbsp;D] or <I>The LaTeX companion</I>&nbsp;[<A
HREF="manual.html#Goossens93">1</A>, Chapter&nbsp;14].)
<P>
@@ -893,24 +934,24 @@ will be equivalent to
<H2><A NAME="SECTION00090000000000000000">
Bibliography</A>
</H2><DL COMPACT><DD><P></P><DT><A NAME="Goossens93">1</A>
-<DD> The L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X companion. Michel&nbsp;Goossens, Frank&nbsp;Mittelbach and Alexander&nbsp;Samarin.
+<DD> The LaTeX companion. Michel&nbsp;Goossens, Frank&nbsp;Mittelbach and Alexander&nbsp;Samarin.
Addison-Wesley 1993.
<P>
<P></P><DT><A NAME="Kopka98">2</A>
-<DD> A guide to L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X. Helmut&nbsp;Kopka and Patrick&nbsp;W.&nbsp;Daly. Addison-Wesley 1998.
+<DD> A guide to LaTeX. Helmut&nbsp;Kopka and Patrick&nbsp;W.&nbsp;Daly. Addison-Wesley 1998.
</DL>
<BR><HR><H4>Footnotes</H4>
<DL>
-<DT><A NAME="foot47">...
+<DT><A NAME="foot51">...
script</A><A
HREF="manual.html#tex2html2"><SUP>1</SUP></A></DT>
<DD>or at least, it's laborious if there are rather a lot
of files associated with a package
</DD>
-<DT><A NAME="foot450">...manual.tex</A><A
+<DT><A NAME="foot477">...manual.tex</A><A
HREF="manual.html#tex2html3"><SUP>2</SUP></A></DT>
<DD>Note: if you want to use
on this document, you will need to use, e.g.,
@@ -924,7 +965,7 @@ of files associated with a package
<A href=http://theoval.cmp.uea.ac.uk/~nlct/>Nicola L. C. Talbot</A>.
<A HREF=http://www.cmp.uea.ac.uk/>School of Computing Sciences</A>.
<A HREF=http://www.uea.ac.uk/>University of East Anglia.</A>
-Last Modified: 2007-08-02
+Last Modified: 2007-08-19
</ADDRESS>
</BODY>
</HTML>
diff --git a/Master/texmf-dist/doc/latex/makedtx/makedtx.pdf b/Master/texmf-dist/doc/latex/makedtx/makedtx.pdf
index 69afe1db94d..79a8b5e822b 100644
--- a/Master/texmf-dist/doc/latex/makedtx/makedtx.pdf
+++ b/Master/texmf-dist/doc/latex/makedtx/makedtx.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/makedtx/makedtx.pl b/Master/texmf-dist/doc/latex/makedtx/makedtx.pl
index ea0825c6409..41516e79920 100644
--- a/Master/texmf-dist/doc/latex/makedtx/makedtx.pl
+++ b/Master/texmf-dist/doc/latex/makedtx/makedtx.pl
@@ -1,10 +1,10 @@
#!/usr/bin/perl
# File : makedtx
-# Author : Dr Nicola Talbot
+# Author : Nicola L. C. Talbot
# Date : 29 Oct 2004
-# Last Modified : 2 Aug 2007
-# Version : 0.93b
+# Last Modified : 19 Aug 2007
+# Version : 0.94b
# usage : makedtx [options] -src <expr>=><expr> -doc <filename> <basename>
#
@@ -16,7 +16,7 @@
use Getopt::Long;
-$version = "0.93b";
+$version = "0.94b";
# process command line options
@@ -27,7 +27,7 @@ $version = "0.93b";
"preamble=s", "postamble=s", "setambles=s@", "macrocode=s@",
"author=s", "date=s", "stopeventually=s",
"prefinale=s", "codetitle=s", "comment=s@",
-"version") or &syntaxerror();
+"version", "license=s") or &syntaxerror();
$srcdir = ".";
$patternop = "=";
@@ -40,6 +40,7 @@ $author = (getpwuid($<))[6] || 'Unknown';
$stopeventually = "";
$prefinale = "";
$codetitle = "The Code";
+$license = "lppl";
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
@@ -123,38 +124,32 @@ foreach $setting (keys %optctl)
{
@comment = @{ $optctl{$setting} };
}
+ elsif ($setting eq "license")
+ {
+ $license = $optctl{$setting};
+ }
}
-if ($preamble eq "")
+if ($#ARGV != 0)
{
- $preamble = "Copyright (C) $year $author, all rights reserved.\n";
- $preamble = $preamble . "If you modify this file, you must change its name first.\n";
- $preamble = $preamble . "You are NOT ALLOWED to distribute this file alone. You are NOT\n";
- $preamble = $preamble . "ALLOWED to take money for the distribution or use of either this\n";
- $preamble = $preamble . "file or a changed version, except for a nominal charge for copying\n";
- $preamble = $preamble . "etc.";
+ print "No basename specified\n";
+ &syntaxerror();
}
+$basename = $ARGV[0];
+
if ($docsrc eq "")
{
print "No document source specified (missing -doc)\n";
&syntaxerror();
}
-if ($#ARGV != 0)
-{
- print "No basename specified\n";
- &syntaxerror();
-}
-
if ($#source == -1)
{
print "No source code specified (missing -src)\n";
&syntaxerror();
}
-$basename = $ARGV[0];
-
open DTX, ">$basename.dtx" or die "Can't open '$basename.dtx'\n";
if ($verbose)
@@ -162,6 +157,148 @@ if ($verbose)
print "Documentation source : " . $docsrc . "\n";
}
+# work out the derived files
+
+ @srcdirfile = glob("$srcdir/*");
+
+ @derivedfiles = ();
+
+ @outputfiles = ();
+
+$numoutput = 0;
+
+foreach $source (@source)
+{
+ ($infile, $outfile, $remainder) = split /=>/, $source;
+
+ if ($outfile eq "")
+ {
+ print "-src $source argument invalid (no output file specified)\n";
+
+ &syntaxerror();
+ }
+
+ if (not ($remainder eq ""))
+ {
+ print "-src $source argument invalid (too many => specified)\n";
+
+ &syntaxerror();
+ }
+
+ foreach $srcdirfile (@srcdirfile)
+ {
+ $fileexp = $srcdir . "/" . $infile;
+
+ $_ = $srcdirfile;
+
+ $expr = "s$patternop$fileexp$patternop$outfile$patternop";
+
+ if (eval($expr))
+ {
+ $thisoutfile = $_;
+
+ $thisinfile = $srcdirfile;
+
+ $file{$thisinfile} = $thisoutfile;
+ $derivedfiles[$numoutput]{'in'} = $thisinfile;
+ $derivedfiles[$numoutput]{'out'} = $thisoutfile;
+ $outputfiles[$numoutput] = $thisoutfile;
+
+ $numoutput++;
+ }
+ }
+}
+
+if ($preamble eq "")
+{
+ if ($license eq "lppl")
+ {
+ $preamble = <<_END_LICENSE
+
+ $basename.dtx
+ Copyright $year $author
+
+ This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either version 1.3
+ of this license of (at your option) any later version.
+ The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+ and version 1.3 or later is part of all distributions of LaTeX
+ version 2005/12/01 or later.
+
+ This work has the LPPL maintenance status `maintained'.
+
+ The Current Maintainer of this work is $author.
+
+_END_LICENSE
+ }
+ elsif ($license eq 'bsd')
+ {
+ $preamble = <<_END_LICENSE
+
+ $basename.dtx
+ Copyright (c) $year $author
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+_END_LICENSE
+ }
+ elsif ($license eq 'gpl')
+ {
+ $preamble = <<_END_LICENSE
+
+ $basename.dtx
+ Copyright (c) $year $author
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+_END_LICENSE
+ }
+ else
+ {
+ die "Unknown license '$license'\n".
+ "Known licenses: lppl, bsd, gpl";
+ }
+
+ $preamble .= " This work consists of the files "
+ . "$basename.dtx and $basename.ins and the derived "
+ . ($numoutput > 1 ? "files" : "file")
+ . " " . join(', ', @outputfiles) . ".\n";
+}
+
open DOC, $docsrc or die "Can't open '$docsrc'\n";
print DTX "\%\\iffalse\n";
@@ -191,6 +328,13 @@ foreach $setting (keys %optctl)
print DTX "\% -macrocode \"$macrocode\"\n";
}
}
+ elsif ($setting eq "comment")
+ {
+ foreach $comment (@comment)
+ {
+ print DTX "\% -comment \"$comment\"\n";
+ }
+ }
else
{
$val = $optctl{$setting};
@@ -411,104 +555,69 @@ if ($stopfound==0)
print DTX "\%\\section{$codetitle}\n";
-@srcdirfile = glob("$srcdir/*");
-
- %file = ();
-
-foreach $source (@source)
+for (my $idx = 0; $idx <= $#derivedfiles; $idx++)
{
- ($infile, $outfile, $remainder) = split /=>/, $source;
-
- if ($outfile eq "")
- {
- print "-src $source argument invalid (no output file specified)\n";
+ $thisinfile = $derivedfiles[$idx]{'in'};
+ $thisoutfile = $derivedfiles[$idx]{'out'};
- &syntaxerror();
- }
-
- if (not ($remainder eq ""))
+ if ($verbose)
{
- print "-src $source argument invalid (too many => specified)\n";
-
- &syntaxerror();
+ print "$srcdirfile -> $_ \n";
}
- foreach $srcdirfile (@srcdirfile)
- {
- $fileexp = $srcdir . "/" . $infile;
+ open SRC, $thisinfile or die "Can't open $thisinfile\n";
- $_ = $srcdirfile;
+ print DTX "\%\\iffalse\n";
+ print DTX "\% \\begin{macrocode}\n";
+ print DTX "\%<*$thisoutfile>\n";
+ print DTX "\% \\end{macrocode}\n";
+ print DTX "\%\\fi\n";
- $expr = "s$patternop$fileexp$patternop$outfile$patternop";
+ $macrocode = 0;
+ $comment = 0;
- if (eval($expr))
+ foreach $expr (@comment)
+ {
+ if ($thisoutfile =~ m/$expr/)
{
- if ($verbose)
- {
- print "$srcdirfile -> $_ \n";
- }
-
- $thisoutfile = $_;
-
- $thisinfile = $srcdirfile;
-
- open SRC, $thisinfile or die "Can't open $thisinfile\n";
-
print DTX "\%\\iffalse\n";
- print DTX "\% \\begin{macrocode}\n";
- print DTX "\%<*$thisoutfile>\n";
- print DTX "\% \\end{macrocode}\n";
- print DTX "\%\\fi\n";
-
- $macrocode = 0;
- $comment = 0;
-
- foreach $expr (@comment)
- {
- if ($thisoutfile =~ m/$expr/)
- {
- print DTX "\%\\iffalse\n";
-
- $comment = 1;
- }
- }
- foreach $expr (@macrocode)
- {
- if ($thisoutfile =~ m/$expr/)
- {
- print DTX "\% \\begin{macrocode}\n";
+ $comment = 1;
+ }
+ }
- $macrocode = 1;
- }
- }
+ foreach $expr (@macrocode)
+ {
+ if ($thisoutfile =~ m/$expr/)
+ {
+ print DTX "\% \\begin{macrocode}\n";
- while (<SRC>)
- {
- print DTX "$_";
- }
+ $macrocode = 1;
+ }
+ }
- if ($macrocode == 1)
- {
- print DTX "\% \\end{macrocode}\n";
- }
+ while (<SRC>)
+ {
+ print DTX "$_";
+ }
- if ($comment == 1)
- {
- print DTX "\%\\fi\n";
- }
+ if ($macrocode == 1)
+ {
+ print DTX "\% \\end{macrocode}\n";
+ }
- print DTX "\%\\iffalse\n";
- print DTX "\% \\begin{macrocode}\n";
- print DTX "\%</$thisoutfile>\n";
- print DTX "\% \\end{macrocode}\n";
- print DTX "\%\\fi\n";
+ if ($comment == 1)
+ {
+ print DTX "\%\\fi\n";
+ }
- close SRC;
+ print DTX "\%\\iffalse\n";
+ print DTX "\% \\begin{macrocode}\n";
+ print DTX "\%</$thisoutfile>\n";
+ print DTX "\% \\end{macrocode}\n";
+ print DTX "\%\\fi\n";
- $file{$thisinfile} = $thisoutfile;
- }
- }
+ close SRC;
}
print DTX "\%$prefinale\n" if ($prefinale);
@@ -546,9 +655,10 @@ if (!$noins)
print INS "\\generate{";
- foreach $file (keys %file)
+ for (my $idx = 0; $idx <= $#derivedfiles; $idx++)
{
- $outfile = $file{$file};
+ $file = $derivedfiles[$idx]{'in'};
+ $outfile = $derivedfiles[$idx]{'out'};
print INS "\\file{$outfile}{";
@@ -638,23 +748,25 @@ sub help
print "Optional Arguments:\n\n";
- print "-dir <directory> : search for source files in <directory>\n";
- print "-op <character> : set the pattern matching operator (default '$patternop')\n";
- print "-askforoverwrite : set askforoverwrite switch in INS file to true\n";
+ print "-dir <directory> : search for source files in <directory>\n";
+ print "-op <character> : set the pattern matching operator (default '$patternop')\n";
+ print "-askforoverwrite : set askforoverwrite switch in INS file to true\n";
print "-noaskforoverwrite : set askforoverwrite switch in INS file to false (default)\n";
print "-preamble <text> : set the preamble. Standard one inserted if omitted\n";
print "-postamble <text> : set the postamble.\n";
print "-setambles \"<pattern>=><text>\" : set pre- and postambles to <text> if file matches pattern\n";
- print "-author <text> : name of author (inserted into standard preamble. User name inserted if omitted)\n";
- print "-date <text> : copyright date\n";
- print "-ins : create the ins file (default)\n";
- print "-noins : don't create the ins file\n";
- print "-prefinale <text> : add <text> immediately prior to \\Finale\n";
- print "-macrocode <expr> : surround any file which matches <expr> in a macrocode environment\n";
- print "-comment <expr> : surround any file which matches <expr> with \\iffalse \\fi pair\n";
- print "-codetitle <text> : The title for the documented code section (default: The Code)\n";
- print "-h : help message\n";
- print "-v : verbose\n\n";
+ print "-author <text> : name of author (inserted into standard preamble. User name inserted if omitted)\n";
+ print "-date <text> : copyright date\n";
+ print "-ins : create the ins file (default)\n";
+ print "-noins : don't create the ins file\n";
+ print "-prefinale <text> : add <text> immediately prior to \\Finale\n";
+ print "-macrocode <expr> : surround any file which matches <expr> in a macrocode environment\n";
+ print "-comment <expr> : surround any file which matches <expr> with \\iffalse \\fi pair\n";
+ print "-codetitle <text> : The title for the documented code section (default: The Code)\n";
+ print "-license <license> : use the given license for the preamble.\n";
+ print " Known licenses: lppl (default), bsd, gpl.\n";
+ print "-h : help message\n";
+ print "-v : verbose\n\n";
print "Examples:\n\n";