On 11/16/17, Matthias Klose <[email protected]> wrote: > > sure, I can fix the description. I don't have any intent to work on > providing the info docs. Feel free to send a patch for the python3.7 > packages.
Here is a patch to do that. There are a few minor changes beyond simply enabling texinfo output: The version number is added to the name of the info file as well as to the dir entry, so that multiple versions can be installed simultaneously. The images are moved to a subdirectory /usr/share/info/python3.7/, where the individual files are symbolic links to /usr/share/doc/python3.7/html/_images/ (assuming that all of the images referenced by the info document are installed in that location, which seems to be the case.) (I'm not at all familiar with sphinx - it may be possible to change these things through sphinx's configuration rather than editing the generated .texi file.) Trailing whitespace is also removed (it's a minor annoyance if, like me, you have show-trailing-whitespace turned on in emacs by default.) This should probably be fixed in sphinx or in makeinfo, but it's easy enough to fix here. At first I tried simply making /usr/share/info/python3.7 a link to /usr/share/doc/python3.7/html/_images, but lintian doesn't like that. (Arguably a bug in lintian.) This is probably cleaner anyway.
diff -uNr python3.7-3.7.0~a2.orig/debian/PVER-doc.info.in python3.7-3.7.0~a2/debian/PVER-doc.info.in --- python3.7-3.7.0~a2.orig/debian/PVER-doc.info.in 1969-12-31 19:00:00.000000000 -0500 +++ python3.7-3.7.0~a2/debian/PVER-doc.info.in 2017-11-27 16:59:32.075212677 -0500 @@ -0,0 +1 @@ +Doc/build/texinfo/@[email protected] diff -uNr python3.7-3.7.0~a2.orig/debian/control python3.7-3.7.0~a2/debian/control --- python3.7-3.7.0~a2.orig/debian/control 2017-09-20 10:09:55.000000000 -0400 +++ python3.7-3.7.0~a2/debian/control 2017-11-27 16:30:16.930304108 -0500 @@ -16,7 +16,7 @@ libgpm2 [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], mime-support, netbase, bzip2, time, python3:any, net-tools, xvfb, xauth -Build-Depends-Indep: python3-sphinx +Build-Depends-Indep: python3-sphinx, texinfo Standards-Version: 4.1.0 Vcs-Browser: https://code.launchpad.net/~doko/python/pkg3.7-debian Vcs-Bzr: http://bazaar.launchpad.net/~doko/python/pkg3.7-debian diff -uNr python3.7-3.7.0~a2.orig/debian/control.in python3.7-3.7.0~a2/debian/control.in --- python3.7-3.7.0~a2.orig/debian/control.in 2017-09-20 10:09:09.000000000 -0400 +++ python3.7-3.7.0~a2/debian/control.in 2017-11-27 16:29:50.030044673 -0500 @@ -16,7 +16,7 @@ libgpm2 [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], mime-support, netbase, bzip2, time, python3@bd_qual@, net-tools, xvfb, xauth -Build-Depends-Indep: python3-sphinx +Build-Depends-Indep: python3-sphinx, texinfo Standards-Version: 4.1.0 Vcs-Browser: https://code.launchpad.net/~doko/python/pkg@VER@-debian Vcs-Bzr: http://bazaar.launchpad.net/~doko/python/pkg@VER@-debian diff -uNr python3.7-3.7.0~a2.orig/debian/patches/doc-build-texinfo.patch python3.7-3.7.0~a2/debian/patches/doc-build-texinfo.patch --- python3.7-3.7.0~a2.orig/debian/patches/doc-build-texinfo.patch 1969-12-31 19:00:00.000000000 -0500 +++ python3.7-3.7.0~a2/debian/patches/doc-build-texinfo.patch 2017-11-27 16:24:09.058754270 -0500 @@ -0,0 +1,27 @@ +Description: Add the option to build Texinfo-format documentation. +Author: Benjamin Moody <[email protected]> +Bug-Debian: https://bugs.debian.org/881959 +Last-Update: 2017-11-27 + +--- python3.7-3.7.0~a2.orig/Doc/Makefile ++++ python3.7-3.7.0~a2/Doc/Makefile +@@ -27,6 +27,7 @@ help: + @echo " htmlview to open the index page built by the html target in your browser" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" ++ @echo " texinfo to make Texinfo files" + @echo " text to make plain text files" + @echo " epub to make EPUB files" + @echo " changes to make an overview over all changed/added/deprecated items" +@@ -72,6 +73,11 @@ latex: build + @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ + "run these through (pdf)latex." + ++texinfo: BUILDER = texinfo ++texinfo: build ++ @echo "Build finished; the Texinfo files are in build/texinfo." ++ @echo "Run \`make\' in that directory to run these through makeinfo." ++ + text: BUILDER = text + text: build + @echo "Build finished; the text files are in build/text." diff -uNr python3.7-3.7.0~a2.orig/debian/patches/series python3.7-3.7.0~a2/debian/patches/series --- python3.7-3.7.0~a2.orig/debian/patches/series 2017-09-20 09:40:37.000000000 -0400 +++ python3.7-3.7.0~a2/debian/patches/series 2017-11-27 16:23:32.730403419 -0500 @@ -32,3 +32,4 @@ pydoc-use-pager.diff pyhash.diff temporary-changes.diff +doc-build-texinfo.patch diff -uNr python3.7-3.7.0~a2.orig/debian/rules python3.7-3.7.0~a2/debian/rules --- python3.7-3.7.0~a2.orig/debian/rules 2017-09-22 07:11:53.000000000 -0400 +++ python3.7-3.7.0~a2/debian/rules 2017-11-27 18:19:42.869037450 -0500 @@ -643,8 +643,31 @@ @mkdir -p stamps touch stamps/stamp-doc-html +stamps/stamp-doc-info: + dh_testdir + rm -rf Doc/build/texinfo + $(MAKE) -C Doc texinfo +# - Change name of info file (@setfilename) to include the version. +# - Change the directory entry to include the version and point to the +# correct filename. +# - Change image links (@image) to point to a subdirectory. +# - Remove trailing whitespace. + sed -e 's/^@setfilename .*/@setfilename $(PVER).info/' \ + -e '/^@direntry/,/^@/s/^\*[^:]*: ([^)]*)/* Python $(VER): ($(PVER))/' \ + -e 's,@image{,@image{$(PVER)/,g' \ + -e 's/ *$$//' \ + < Doc/build/texinfo/python.texi \ + > Doc/build/texinfo/$(PVER).texi + rm -f Doc/build/texinfo/python.texi +# - Create a symbolic link so that makeinfo will be able to find the +# image files. + ln -s . Doc/build/texinfo/$(PVER) + $(MAKE) -C Doc/build/texinfo + @mkdir -p stamps + touch stamps/stamp-doc-info + build-doc: stamps/stamp-patch stamps/stamp-build-doc -stamps/stamp-build-doc: stamps/stamp-doc-html +stamps/stamp-build-doc: stamps/stamp-doc-html stamps/stamp-doc-info @mkdir -p stamps touch stamps/stamp-build-doc @@ -1288,6 +1311,11 @@ /usr/share/doc/$(p_base)/html /usr/share/doc/$(p_doc)/html \ /usr/share/javascript/jquery/jquery.js /usr/share/doc/$(p_base)/html/_static/jquery.js \ /usr/share/javascript/underscore/underscore.js /usr/share/doc/$(p_base)/html/_static/underscore.js + dh_installinfo -p$(p_doc) + for f in $(d_doc)/usr/share/doc/$(p_base)/html/_images/*.png; do \ + b=$$(basename $$f); \ + dh_link -p$(p_doc) /usr/share/doc/$(p_base)/html/_images/$$b /usr/share/info/$(PVER)/$$b; \ + done : # devhelp docs cd $(buildd_static) && ./python ../debian/pyhtml2devhelp.py \

