Integrated SF patch #539487 by Matthias Klose:
This patch adds Milan Zamazal's conversion script and
modifies the mkinfo script to build the info doc files
from the LaTeX sources.  Currently, the mac, doc and
inst TeX files are not handled.
Explicitly checks for GNU Emacs 21.
diff --git a/Doc/tools/mkinfo b/Doc/tools/mkinfo
index edba1db..64fb86e 100755
--- a/Doc/tools/mkinfo
+++ b/Doc/tools/mkinfo
@@ -17,7 +17,12 @@
 FILENAME="$1"
 DOCDIR=`dirname "$FILENAME"`
 DOCFILE=`basename "$FILENAME"`
-DOCNAME=`basename "$FILENAME" .html`
+DOCNAME=`basename "$FILENAME" .tex`
+if [ $# -gt 1 ]; then
+    INFONAME="$2"
+else
+    INFONAME="python-$DOCNAME.info"
+fi
 
 # Now build the real directory names, and locate our support stuff:
 WORKDIR=`pwd`
@@ -31,18 +36,20 @@
 run() {
     # show what we're doing, like make does:
     echo "$*"
-    $* || exit $?
+    "$@" || exit $?
 }
 
 
 # generate the Texinfo file:
 
-run $PERL -I$TOOLSDIR $TOOLSDIR/html2texi.pl $DOCDIR/$DOCFILE
-run $EMACS -batch -l $TOOLSDIR/fixinfo.el $DOCNAME.texi
-rm -f $DOCNAME.texi~
+run $EMACS -batch -q --no-site-file -l $TOOLSDIR/py2texi.el \
+    --eval "(setq py2texi-dirs '(\"./\" \"../texinputs/\" \"$DOCDIR\"))" \
+    --eval "(py2texi \"$DOCDIR/$DOCFILE\")" \
+    -f kill-emacs
+echo Done
 
 
 # generate the .info files:
 
 run $MAKEINFO --footnote-style end --fill-column 72 \
-	      --paragraph-indent 0 $DOCNAME.texi
+	      --paragraph-indent 0 --output=$INFONAME $DOCNAME.texi