Fred Drake | c58f346 | 1999-01-08 15:27:17 +0000 | [diff] [blame^] | 1 | #! /bin/sh |
| 2 | # -*- Ksh -*- |
| 3 | |
| 4 | |
| 5 | PERL=${PERL:-perl} |
| 6 | EMACS=${EMACS:-emacs} |
| 7 | MAKEINFO=${MAKEINFO:-makeinfo} |
| 8 | |
| 9 | |
| 10 | # Normalize file name since something called by html2texi.pl seems to |
| 11 | # screw up with relative path names. |
| 12 | FILENAME="$1" |
| 13 | DOCDIR=`dirname "$FILENAME"` |
| 14 | DOCFILE=`basename "$FILENAME"` |
| 15 | DOCNAME=`basename "$FILENAME" .html` |
| 16 | |
| 17 | WORKDIR=`pwd` |
| 18 | cd `dirname $0` |
| 19 | TOOLSDIR=`pwd` |
| 20 | cd $DOCDIR |
| 21 | DOCDIR=`pwd` |
| 22 | cd $WORKDIR |
| 23 | |
| 24 | |
| 25 | run() { |
| 26 | echo "$@" |
| 27 | $* || exit $? |
| 28 | } |
| 29 | |
| 30 | |
| 31 | # generate the Texinfo file: |
| 32 | |
| 33 | run $PERL -I$TOOLSDIR $TOOLSDIR/html2texi.pl $DOCDIR/$DOCFILE |
| 34 | run $EMACS -batch -l $TOOLSDIR/fixinfo.el $DOCNAME.texi |
| 35 | rm -f $DOCNAME.texi~ |
| 36 | |
| 37 | |
| 38 | # generate the .info files: |
| 39 | |
| 40 | run $MAKEINFO --footnote-style end --fill-column 72 \ |
| 41 | --paragraph-indent 0 $DOCNAME.texi |