blob: edba1db8e70445686aed245e5629e3df8a457043 [file] [log] [blame]
Fred Drakec58f3461999-01-08 15:27:17 +00001#! /bin/sh
2# -*- Ksh -*-
3
Fred Drakec4e92631999-01-08 15:32:27 +00004# Script to drive the HTML-info conversion process.
5# Pass in a single parameter: the name of the top-level HTML file
6# generated by LaTeX2HTML.
7#
8# Written by Fred L. Drake, Jr. <fdrake@acm.org>
Fred Drakec58f3461999-01-08 15:27:17 +00009
10PERL=${PERL:-perl}
11EMACS=${EMACS:-emacs}
12MAKEINFO=${MAKEINFO:-makeinfo}
13
14
15# Normalize file name since something called by html2texi.pl seems to
16# screw up with relative path names.
17FILENAME="$1"
18DOCDIR=`dirname "$FILENAME"`
19DOCFILE=`basename "$FILENAME"`
20DOCNAME=`basename "$FILENAME" .html`
21
Fred Drakec4e92631999-01-08 15:32:27 +000022# Now build the real directory names, and locate our support stuff:
Fred Drakec58f3461999-01-08 15:27:17 +000023WORKDIR=`pwd`
24cd `dirname $0`
25TOOLSDIR=`pwd`
26cd $DOCDIR
27DOCDIR=`pwd`
28cd $WORKDIR
29
30
31run() {
Fred Drakec4e92631999-01-08 15:32:27 +000032 # show what we're doing, like make does:
33 echo "$*"
Fred Drakec58f3461999-01-08 15:27:17 +000034 $* || exit $?
35}
36
37
38# generate the Texinfo file:
39
40run $PERL -I$TOOLSDIR $TOOLSDIR/html2texi.pl $DOCDIR/$DOCFILE
41run $EMACS -batch -l $TOOLSDIR/fixinfo.el $DOCNAME.texi
42rm -f $DOCNAME.texi~
43
44
45# generate the .info files:
46
47run $MAKEINFO --footnote-style end --fill-column 72 \
48 --paragraph-indent 0 $DOCNAME.texi