Commit | Line | Data |
---|---|---|
61cd9dc9 | 1 | #!/bin/sh -e |
c84bdaf6 LC |
2 | # gendocs.sh -- generate a GNU manual in many formats. This script is |
3 | # mentioned in maintain.texi. See the help message below for usage details. | |
4 | ||
af07e104 | 5 | scriptversion=2013-02-03.15 |
c84bdaf6 | 6 | |
af07e104 | 7 | # Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 |
7ae4e75a | 8 | # Free Software Foundation, Inc. |
c84bdaf6 LC |
9 | # |
10 | # This program is free software: you can redistribute it and/or modify | |
11 | # it under the terms of the GNU General Public License as published by | |
12 | # the Free Software Foundation; either version 3 of the License, or | |
13 | # (at your option) any later version. | |
14 | # | |
15 | # This program is distributed in the hope that it will be useful, | |
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | # GNU General Public License for more details. | |
19 | # | |
20 | # You should have received a copy of the GNU General Public License | |
21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
22 | # | |
23 | # Original author: Mohit Agarwal. | |
24 | # Send bug reports and any other correspondence to bug-texinfo@gnu.org. | |
0f00f2c3 LC |
25 | # |
26 | # The latest version of this script, and the companion template, is | |
27 | # available from Texinfo CVS: | |
28 | # http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs.sh | |
29 | # http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs_template | |
30 | # | |
31 | # An up-to-date copy is also maintained in Gnulib (gnu.org/software/gnulib). | |
c84bdaf6 | 32 | |
7ae4e75a LC |
33 | # TODO: |
34 | # - image importation was only implemented for HTML generated by | |
35 | # makeinfo. But it should be simple enough to adjust. | |
36 | # - images are not imported in the source tarball. All the needed | |
37 | # formats (PDF, PNG, etc.) should be included. | |
38 | ||
c84bdaf6 LC |
39 | prog=`basename "$0"` |
40 | srcdir=`pwd` | |
41 | ||
42 | scripturl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs.sh" | |
43 | templateurl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs_template" | |
44 | ||
45 | : ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="} | |
46 | : ${MAKEINFO="makeinfo"} | |
47 | : ${TEXI2DVI="texi2dvi -t @finalout"} | |
c84bdaf6 LC |
48 | : ${DOCBOOK2HTML="docbook2html"} |
49 | : ${DOCBOOK2PDF="docbook2pdf"} | |
c84bdaf6 LC |
50 | : ${DOCBOOK2TXT="docbook2txt"} |
51 | : ${GENDOCS_TEMPLATE_DIR="."} | |
7ae4e75a | 52 | : ${PERL='perl'} |
c84bdaf6 LC |
53 | : ${TEXI2HTML="texi2html"} |
54 | unset CDPATH | |
55 | unset use_texi2html | |
56 | ||
57 | version="gendocs.sh $scriptversion | |
58 | ||
af07e104 | 59 | Copyright 2013 Free Software Foundation, Inc. |
c84bdaf6 LC |
60 | There is NO warranty. You may redistribute this software |
61 | under the terms of the GNU General Public License. | |
62 | For more information about these matters, see the files named COPYING." | |
63 | ||
64 | usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE | |
65 | ||
7ae4e75a LC |
66 | Generate output in various formats from PACKAGE.texinfo (or .texi or |
67 | .txi) source. See the GNU Maintainers document for a more extensive | |
68 | discussion: | |
c84bdaf6 LC |
69 | http://www.gnu.org/prep/maintain_toc.html |
70 | ||
71 | Options: | |
af07e104 AW |
72 | --email ADR use ADR as contact in generated web pages; always give this. |
73 | ||
74 | -s SRCFILE read Texinfo from SRCFILE, instead of PACKAGE.{texinfo|texi|txi} | |
75 | -o OUTDIR write files into OUTDIR, instead of manual/. | |
76 | -I DIR append DIR to the Texinfo search path. | |
77 | --common ARG pass ARG in all invocations. | |
78 | --html ARG pass ARG to makeinfo or texi2html for HTML targets. | |
79 | --info ARG pass ARG to makeinfo for Info, instead of --no-split. | |
80 | --no-ascii skip generating the plain text output. | |
81 | --source ARG include ARG in tar archive of sources. | |
82 | --split HOW make split HTML by node, section, chapter; default node. | |
83 | ||
84 | --texi2html use texi2html to make HTML target, with all split versions. | |
85 | --docbook convert through DocBook too (xml, txt, html, pdf). | |
86 | ||
87 | --help display this help and exit successfully. | |
88 | --version display version information and exit successfully. | |
c84bdaf6 LC |
89 | |
90 | Simple example: $prog --email bug-gnu-emacs@gnu.org emacs \"GNU Emacs Manual\" | |
91 | ||
92 | Typical sequence: | |
93 | cd PACKAGESOURCE/doc | |
94 | wget \"$scripturl\" | |
95 | wget \"$templateurl\" | |
96 | $prog --email BUGLIST MANUAL \"GNU MANUAL - One-line description\" | |
97 | ||
7ae4e75a LC |
98 | Output will be in a new subdirectory \"manual\" (by default; |
99 | use -o OUTDIR to override). Move all the new files into your web CVS | |
100 | tree, as explained in the Web Pages node of maintain.texi. | |
c84bdaf6 | 101 | |
af07e104 AW |
102 | Please use the --email ADDRESS option so your own bug-reporting |
103 | address will be used in the generated HTML pages. | |
c84bdaf6 LC |
104 | |
105 | MANUAL-TITLE is included as part of the HTML <title> of the overall | |
106 | manual/index.html file. It should include the name of the package being | |
107 | documented. manual/index.html is created by substitution from the file | |
108 | $GENDOCS_TEMPLATE_DIR/gendocs_template. (Feel free to modify the | |
109 | generic template for your own purposes.) | |
110 | ||
111 | If you have several manuals, you'll need to run this script several | |
112 | times with different MANUAL values, specifying a different output | |
113 | directory with -o each time. Then write (by hand) an overall index.html | |
114 | with links to them all. | |
115 | ||
116 | If a manual's Texinfo sources are spread across several directories, | |
117 | first copy or symlink all Texinfo sources into a single directory. | |
118 | (Part of the script's work is to make a tar.gz of the sources.) | |
119 | ||
7ae4e75a LC |
120 | As implied above, by default monolithic Info files are generated. |
121 | If you want split Info, or other Info options, use --info to override. | |
122 | ||
123 | You can set the environment variables MAKEINFO, TEXI2DVI, TEXI2HTML, | |
124 | and PERL to control the programs that get executed, and | |
9157d901 LC |
125 | GENDOCS_TEMPLATE_DIR to control where the gendocs_template file is |
126 | looked for. With --docbook, the environment variables DOCBOOK2HTML, | |
af07e104 | 127 | DOCBOOK2PDF, and DOCBOOK2TXT are also consulted. |
c84bdaf6 | 128 | |
9157d901 LC |
129 | By default, makeinfo and texi2dvi are run in the default (English) |
130 | locale, since that's the language of most Texinfo manuals. If you | |
131 | happen to have a non-English manual and non-English web site, see the | |
132 | SETLANG setting in the source. | |
c84bdaf6 LC |
133 | |
134 | Email bug reports or enhancement requests to bug-texinfo@gnu.org. | |
135 | " | |
136 | ||
c84bdaf6 LC |
137 | MANUAL_TITLE= |
138 | PACKAGE= | |
139 | EMAIL=webmasters@gnu.org # please override with --email | |
af07e104 AW |
140 | commonarg= # passed to all makeinfo/texi2html invcations. |
141 | dirargs= # passed to all tools (-I dir). | |
7ae4e75a | 142 | dirs= # -I's directories. |
c84bdaf6 | 143 | htmlarg= |
7ae4e75a | 144 | infoarg=--no-split |
af07e104 | 145 | generate_ascii=true |
c84bdaf6 | 146 | outdir=manual |
af07e104 AW |
147 | source_extra= |
148 | split=node | |
dde9c5a4 | 149 | srcfile= |
c84bdaf6 LC |
150 | |
151 | while test $# -gt 0; do | |
152 | case $1 in | |
af07e104 AW |
153 | -s) shift; srcfile=$1;; |
154 | -o) shift; outdir=$1;; | |
155 | -I) shift; dirargs="$dirargs -I '$1'"; dirs="$dirs $1";; | |
156 | --common) shift; commonarg=$1;; | |
157 | --docbook) docbook=yes;; | |
158 | --email) shift; EMAIL=$1;; | |
159 | --html) shift; htmlarg=$1;; | |
160 | --info) shift; infoarg=$1;; | |
161 | --no-ascii) generate_ascii=false;; | |
162 | --source) shift; source_extra=$1;; | |
163 | --split) shift; split=$1;; | |
c84bdaf6 | 164 | --texi2html) use_texi2html=1;; |
af07e104 AW |
165 | |
166 | --help) echo "$usage"; exit 0;; | |
167 | --version) echo "$version"; exit 0;; | |
c84bdaf6 LC |
168 | -*) |
169 | echo "$0: Unknown option \`$1'." >&2 | |
170 | echo "$0: Try \`--help' for more information." >&2 | |
171 | exit 1;; | |
172 | *) | |
173 | if test -z "$PACKAGE"; then | |
174 | PACKAGE=$1 | |
175 | elif test -z "$MANUAL_TITLE"; then | |
176 | MANUAL_TITLE=$1 | |
177 | else | |
178 | echo "$0: extra non-option argument \`$1'." >&2 | |
179 | exit 1 | |
180 | fi;; | |
181 | esac | |
182 | shift | |
183 | done | |
184 | ||
af07e104 AW |
185 | # makeinfo uses the dirargs, but texi2dvi doesn't. |
186 | commonarg=" $dirargs $commonarg" | |
187 | ||
a927b6c1 LC |
188 | # For most of the following, the base name is just $PACKAGE |
189 | base=$PACKAGE | |
190 | ||
dde9c5a4 | 191 | if test -n "$srcfile"; then |
a927b6c1 LC |
192 | # but here, we use the basename of $srcfile |
193 | base=`basename "$srcfile"` | |
194 | case $base in | |
195 | *.txi|*.texi|*.texinfo) base=`echo "$base"|sed 's/\.[texinfo]*$//'`;; | |
196 | esac | |
197 | PACKAGE=$base | |
dde9c5a4 | 198 | elif test -s "$srcdir/$PACKAGE.texinfo"; then |
c84bdaf6 LC |
199 | srcfile=$srcdir/$PACKAGE.texinfo |
200 | elif test -s "$srcdir/$PACKAGE.texi"; then | |
201 | srcfile=$srcdir/$PACKAGE.texi | |
202 | elif test -s "$srcdir/$PACKAGE.txi"; then | |
203 | srcfile=$srcdir/$PACKAGE.txi | |
204 | else | |
205 | echo "$0: cannot find .texinfo or .texi or .txi for $PACKAGE in $srcdir." >&2 | |
206 | exit 1 | |
207 | fi | |
208 | ||
209 | if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then | |
210 | echo "$0: cannot read $GENDOCS_TEMPLATE_DIR/gendocs_template." >&2 | |
211 | echo "$0: it is available from $templateurl." >&2 | |
212 | exit 1 | |
213 | fi | |
214 | ||
7ae4e75a LC |
215 | # Function to return size of $1 in something resembling kilobytes. |
216 | calcsize() | |
217 | { | |
218 | size=`ls -ksl $1 | awk '{print $1}'` | |
219 | echo $size | |
220 | } | |
221 | ||
222 | # copy_images OUTDIR HTML-FILE... | |
223 | # ------------------------------- | |
224 | # Copy all the images needed by the HTML-FILEs into OUTDIR. Look | |
225 | # for them in the -I directories. | |
226 | copy_images() | |
227 | { | |
228 | local odir | |
229 | odir=$1 | |
230 | shift | |
231 | $PERL -n -e " | |
232 | BEGIN { | |
233 | \$me = '$prog'; | |
234 | \$odir = '$odir'; | |
235 | @dirs = qw($dirs); | |
236 | } | |
237 | " -e ' | |
238 | /<img src="(.*?)"/g && ++$need{$1}; | |
239 | ||
240 | END { | |
241 | #print "$me: @{[keys %need]}\n"; # for debugging, show images found. | |
242 | FILE: for my $f (keys %need) { | |
243 | for my $d (@dirs) { | |
244 | if (-f "$d/$f") { | |
245 | use File::Basename; | |
246 | my $dest = dirname ("$odir/$f"); | |
247 | # | |
248 | use File::Path; | |
249 | -d $dest || mkpath ($dest) | |
250 | || die "$me: cannot mkdir $dest: $!\n"; | |
251 | # | |
252 | use File::Copy; | |
253 | copy ("$d/$f", $dest) | |
254 | || die "$me: cannot copy $d/$f to $dest: $!\n"; | |
255 | next FILE; | |
256 | } | |
257 | } | |
258 | die "$me: $ARGV: cannot find image $f\n"; | |
259 | } | |
260 | } | |
261 | ' -- "$@" || exit 1 | |
262 | } | |
263 | ||
c84bdaf6 | 264 | case $outdir in |
0f00f2c3 LC |
265 | /*) abs_outdir=$outdir;; |
266 | *) abs_outdir=$srcdir/$outdir;; | |
c84bdaf6 LC |
267 | esac |
268 | ||
af07e104 AW |
269 | echo "Making output for $srcfile" |
270 | echo " in `pwd`" | |
271 | mkdir -p "$outdir/" | |
c84bdaf6 | 272 | |
7ae4e75a | 273 | cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\"" |
af07e104 | 274 | echo "Generating info... ($cmd)" |
c84bdaf6 | 275 | eval "$cmd" |
0f00f2c3 | 276 | tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info* |
af07e104 | 277 | ls -l "$outdir/$PACKAGE.info.tar.gz" |
0f00f2c3 | 278 | info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"` |
c84bdaf6 LC |
279 | # do not mv the info files, there's no point in having them available |
280 | # separately on the web. | |
281 | ||
af07e104 AW |
282 | cmd="$SETLANG $TEXI2DVI $dirargs \"$srcfile\"" |
283 | printf "\nGenerating dvi... ($cmd)\n" | |
c84bdaf6 | 284 | eval "$cmd" |
c84bdaf6 LC |
285 | # compress/finish dvi: |
286 | gzip -f -9 $PACKAGE.dvi | |
287 | dvi_gz_size=`calcsize $PACKAGE.dvi.gz` | |
0f00f2c3 | 288 | mv $PACKAGE.dvi.gz "$outdir/" |
af07e104 | 289 | ls -l "$outdir/$PACKAGE.dvi.gz" |
c84bdaf6 | 290 | |
af07e104 AW |
291 | cmd="$SETLANG $TEXI2DVI --pdf $dirargs \"$srcfile\"" |
292 | printf "\nGenerating pdf... ($cmd)\n" | |
c84bdaf6 LC |
293 | eval "$cmd" |
294 | pdf_size=`calcsize $PACKAGE.pdf` | |
0f00f2c3 | 295 | mv $PACKAGE.pdf "$outdir/" |
af07e104 | 296 | ls -l "$outdir/$PACKAGE.pdf" |
c84bdaf6 | 297 | |
af07e104 AW |
298 | if $generate_ascii; then |
299 | opt="-o $PACKAGE.txt --no-split --no-headers $commonarg" | |
300 | cmd="$SETLANG $MAKEINFO $opt \"$srcfile\"" | |
301 | printf "\nGenerating ascii... ($cmd)\n" | |
302 | eval "$cmd" | |
303 | ascii_size=`calcsize $PACKAGE.txt` | |
304 | gzip -f -9 -c $PACKAGE.txt >"$outdir/$PACKAGE.txt.gz" | |
305 | ascii_gz_size=`calcsize "$outdir/$PACKAGE.txt.gz"` | |
306 | mv $PACKAGE.txt "$outdir/" | |
307 | ls -l "$outdir/$PACKAGE.txt" "$outdir/$PACKAGE.txt.gz" | |
308 | fi | |
c84bdaf6 LC |
309 | |
310 | html_split() | |
311 | { | |
af07e104 | 312 | opt="--split=$1 --node-files $commonarg $htmlarg" |
c84bdaf6 | 313 | cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $opt \"$srcfile\"" |
af07e104 | 314 | printf "\nGenerating html by $1... ($cmd)\n" |
c84bdaf6 LC |
315 | eval "$cmd" |
316 | split_html_dir=$PACKAGE.html | |
317 | ( | |
318 | cd ${split_html_dir} || exit 1 | |
319 | ln -sf ${PACKAGE}.html index.html | |
0f00f2c3 | 320 | tar -czf "$abs_outdir/${PACKAGE}.html_$1.tar.gz" -- *.html |
c84bdaf6 | 321 | ) |
0f00f2c3 LC |
322 | eval html_$1_tgz_size=`calcsize "$outdir/${PACKAGE}.html_$1.tar.gz"` |
323 | rm -f "$outdir"/html_$1/*.html | |
324 | mkdir -p "$outdir/html_$1/" | |
325 | mv ${split_html_dir}/*.html "$outdir/html_$1/" | |
c84bdaf6 LC |
326 | rmdir ${split_html_dir} |
327 | } | |
328 | ||
329 | if test -z "$use_texi2html"; then | |
7ae4e75a | 330 | opt="--no-split --html -o $PACKAGE.html $commonarg $htmlarg" |
c84bdaf6 | 331 | cmd="$SETLANG $MAKEINFO $opt \"$srcfile\"" |
af07e104 | 332 | printf "\nGenerating monolithic html... ($cmd)\n" |
c84bdaf6 LC |
333 | rm -rf $PACKAGE.html # in case a directory is left over |
334 | eval "$cmd" | |
335 | html_mono_size=`calcsize $PACKAGE.html` | |
0f00f2c3 LC |
336 | gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz" |
337 | html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"` | |
7ae4e75a | 338 | copy_images "$outdir/" $PACKAGE.html |
0f00f2c3 | 339 | mv $PACKAGE.html "$outdir/" |
af07e104 | 340 | ls -l "$outdir/$PACKAGE.html" "$outdir/$PACKAGE.html.gz" |
c84bdaf6 | 341 | |
af07e104 | 342 | opt="--html -o $PACKAGE.html --split=$split $commonarg $htmlarg" |
7ae4e75a | 343 | cmd="$SETLANG $MAKEINFO $opt \"$srcfile\"" |
af07e104 | 344 | printf "\nGenerating html by $split... ($cmd)\n" |
c84bdaf6 LC |
345 | eval "$cmd" |
346 | split_html_dir=$PACKAGE.html | |
7ae4e75a | 347 | copy_images $split_html_dir/ $split_html_dir/*.html |
c84bdaf6 | 348 | ( |
7ae4e75a | 349 | cd $split_html_dir || exit 1 |
af07e104 | 350 | tar -czf "$abs_outdir/$PACKAGE.html_$split.tar.gz" -- * |
c84bdaf6 | 351 | ) |
af07e104 AW |
352 | eval \ |
353 | html_${split}_tgz_size=`calcsize "$outdir/$PACKAGE.html_$split.tar.gz"` | |
354 | rm -rf "$outdir/html_$split/" | |
355 | mv $split_html_dir "$outdir/html_$split/" | |
356 | du -s "$outdir/html_$split/" | |
357 | ls -l "$outdir/$PACKAGE.html_$split.tar.gz" | |
358 | ||
359 | else # use texi2html: | |
7ae4e75a LC |
360 | opt="--output $PACKAGE.html $commonarg $htmlarg" |
361 | cmd="$SETLANG $TEXI2HTML $opt \"$srcfile\"" | |
af07e104 | 362 | printf "\nGenerating monolithic html with texi2html... ($cmd)\n" |
c84bdaf6 LC |
363 | rm -rf $PACKAGE.html # in case a directory is left over |
364 | eval "$cmd" | |
365 | html_mono_size=`calcsize $PACKAGE.html` | |
0f00f2c3 LC |
366 | gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz" |
367 | html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"` | |
368 | mv $PACKAGE.html "$outdir/" | |
c84bdaf6 LC |
369 | |
370 | html_split node | |
371 | html_split chapter | |
372 | html_split section | |
373 | fi | |
374 | ||
af07e104 | 375 | printf "\nMaking .tar.gz for sources...\n" |
dde9c5a4 | 376 | d=`dirname $srcfile` |
0f00f2c3 LC |
377 | ( |
378 | cd "$d" | |
af07e104 AW |
379 | srcfiles=`ls -d *.texinfo *.texi *.txi *.eps $source_extra 2>/dev/null` || true |
380 | tar czfh "$abs_outdir/$PACKAGE.texi.tar.gz" $srcfiles | |
381 | ls -l "$abs_outdir/$PACKAGE.texi.tar.gz" | |
0f00f2c3 LC |
382 | ) |
383 | texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"` | |
c84bdaf6 LC |
384 | |
385 | if test -n "$docbook"; then | |
7ae4e75a LC |
386 | opt="-o - --docbook $commonarg" |
387 | cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml" | |
af07e104 | 388 | printf "\nGenerating docbook XML... ($cmd)\n" |
c84bdaf6 LC |
389 | eval "$cmd" |
390 | docbook_xml_size=`calcsize $PACKAGE-db.xml` | |
0f00f2c3 LC |
391 | gzip -f -9 -c $PACKAGE-db.xml >"$outdir/$PACKAGE-db.xml.gz" |
392 | docbook_xml_gz_size=`calcsize "$outdir/$PACKAGE-db.xml.gz"` | |
393 | mv $PACKAGE-db.xml "$outdir/" | |
c84bdaf6 | 394 | |
dd7d0148 | 395 | split_html_db_dir=html_node_db |
7ae4e75a LC |
396 | opt="$commonarg -o $split_html_db_dir" |
397 | cmd="$DOCBOOK2HTML $opt \"${outdir}/$PACKAGE-db.xml\"" | |
af07e104 | 398 | printf "\nGenerating docbook HTML... ($cmd)\n" |
c84bdaf6 | 399 | eval "$cmd" |
c84bdaf6 LC |
400 | ( |
401 | cd ${split_html_db_dir} || exit 1 | |
0f00f2c3 | 402 | tar -czf "$abs_outdir/${PACKAGE}.html_node_db.tar.gz" -- *.html |
c84bdaf6 | 403 | ) |
0f00f2c3 LC |
404 | html_node_db_tgz_size=`calcsize "$outdir/${PACKAGE}.html_node_db.tar.gz"` |
405 | rm -f "$outdir"/html_node_db/*.html | |
406 | mkdir -p "$outdir/html_node_db" | |
407 | mv ${split_html_db_dir}/*.html "$outdir/html_node_db/" | |
c84bdaf6 LC |
408 | rmdir ${split_html_db_dir} |
409 | ||
7ae4e75a | 410 | cmd="$DOCBOOK2TXT \"${outdir}/$PACKAGE-db.xml\"" |
af07e104 | 411 | printf "\nGenerating docbook ASCII... ($cmd)\n" |
c84bdaf6 LC |
412 | eval "$cmd" |
413 | docbook_ascii_size=`calcsize $PACKAGE-db.txt` | |
0f00f2c3 | 414 | mv $PACKAGE-db.txt "$outdir/" |
c84bdaf6 | 415 | |
7ae4e75a | 416 | cmd="$DOCBOOK2PDF \"${outdir}/$PACKAGE-db.xml\"" |
af07e104 | 417 | printf "\nGenerating docbook PDF... ($cmd)\n" |
c84bdaf6 LC |
418 | eval "$cmd" |
419 | docbook_pdf_size=`calcsize $PACKAGE-db.pdf` | |
0f00f2c3 | 420 | mv $PACKAGE-db.pdf "$outdir/" |
c84bdaf6 LC |
421 | fi |
422 | ||
af07e104 | 423 | printf "\nMaking index file...\n" |
c84bdaf6 | 424 | if test -z "$use_texi2html"; then |
af07e104 AW |
425 | CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\ |
426 | /%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d" | |
c84bdaf6 | 427 | else |
af07e104 AW |
428 | # should take account of --split here. |
429 | CONDS="/%%ENDIF.*%%/d;/%%IF *HTML_SECTION%%/d;/%%IF *HTML_CHAPTER%%/d" | |
c84bdaf6 | 430 | fi |
7ae4e75a | 431 | |
c84bdaf6 LC |
432 | curdate=`$SETLANG date '+%B %d, %Y'` |
433 | sed \ | |
434 | -e "s!%%TITLE%%!$MANUAL_TITLE!g" \ | |
435 | -e "s!%%EMAIL%%!$EMAIL!g" \ | |
436 | -e "s!%%PACKAGE%%!$PACKAGE!g" \ | |
437 | -e "s!%%DATE%%!$curdate!g" \ | |
438 | -e "s!%%HTML_MONO_SIZE%%!$html_mono_size!g" \ | |
439 | -e "s!%%HTML_MONO_GZ_SIZE%%!$html_mono_gz_size!g" \ | |
440 | -e "s!%%HTML_NODE_TGZ_SIZE%%!$html_node_tgz_size!g" \ | |
441 | -e "s!%%HTML_SECTION_TGZ_SIZE%%!$html_section_tgz_size!g" \ | |
442 | -e "s!%%HTML_CHAPTER_TGZ_SIZE%%!$html_chapter_tgz_size!g" \ | |
443 | -e "s!%%INFO_TGZ_SIZE%%!$info_tgz_size!g" \ | |
444 | -e "s!%%DVI_GZ_SIZE%%!$dvi_gz_size!g" \ | |
445 | -e "s!%%PDF_SIZE%%!$pdf_size!g" \ | |
c84bdaf6 LC |
446 | -e "s!%%ASCII_SIZE%%!$ascii_size!g" \ |
447 | -e "s!%%ASCII_GZ_SIZE%%!$ascii_gz_size!g" \ | |
448 | -e "s!%%TEXI_TGZ_SIZE%%!$texi_tgz_size!g" \ | |
449 | -e "s!%%DOCBOOK_HTML_NODE_TGZ_SIZE%%!$html_node_db_tgz_size!g" \ | |
450 | -e "s!%%DOCBOOK_ASCII_SIZE%%!$docbook_ascii_size!g" \ | |
c84bdaf6 LC |
451 | -e "s!%%DOCBOOK_PDF_SIZE%%!$docbook_pdf_size!g" \ |
452 | -e "s!%%DOCBOOK_XML_SIZE%%!$docbook_xml_size!g" \ | |
453 | -e "s!%%DOCBOOK_XML_GZ_SIZE%%!$docbook_xml_gz_size!g" \ | |
454 | -e "s,%%SCRIPTURL%%,$scripturl,g" \ | |
455 | -e "s!%%SCRIPTNAME%%!$prog!g" \ | |
456 | -e "$CONDS" \ | |
0f00f2c3 | 457 | $GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html" |
c84bdaf6 LC |
458 | |
459 | echo "Done, see $outdir/ subdirectory for new files." | |
460 | ||
461 | # Local variables: | |
462 | # eval: (add-hook 'write-file-hooks 'time-stamp) | |
463 | # time-stamp-start: "scriptversion=" | |
464 | # time-stamp-format: "%:y-%02m-%02d.%02H" | |
465 | # time-stamp-end: "$" | |
466 | # End: |