--- /dev/null
+Return-Path: <too@guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 5F9FB431FBC\r
+ for <notmuch@notmuchmail.org>; Sat, 3 Jan 2015 06:15:13 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id qAPltWXU8o8D for <notmuch@notmuchmail.org>;\r
+ Sat, 3 Jan 2015 06:15:10 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 0F430431FB6\r
+ for <notmuch@notmuchmail.org>; Sat, 3 Jan 2015 06:15:10 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id E5A0D1000F4; Sat, 3 Jan 2015 16:14:42 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org,\r
+ wking@tremily.us\r
+Subject: [PATCH] doc: Allow rst2man.py as an alternative to rst2man\r
+Date: Sat, 3 Jan 2015 16:14:39 +0200\r
+Message-Id: <1420294479-27224-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 2.0.0\r
+Cc: tomi.ollila@iki.fi\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 03 Jan 2015 14:15:13 -0000\r
+\r
+From: W. Trevor King <wking@tremily.us>\r
+\r
+Gentoo's dev-python/docutils-0.10 installs Docutils scripts with a\r
+*.py extension, so I have /usr/bin/rst2man.py and no rst2man script.\r
+This patch supports users with both types of systems by checking for\r
+rst2man, falling back on rst2man.py, and giving up only if neither is\r
+found. Users can also set the new RST2MAN path variable explicitly\r
+when they call Make:\r
+\r
+ make RST2MAN=/my/custom/rst_to_man_converter build-man\r
+\r
+We pass the configured RST2MAN path through to prerst2man.py to use in\r
+its system call.\r
+\r
+We can use a non-empty RST2MAN to check for the availability of an\r
+rst2man program, so there's no need for a separate HAVE_RST2MAN.\r
+However, we keep the existing HAVE_RST2MAN for consistency with\r
+HAVE_SPHINX.\r
+---\r
+\r
+rebased original\r
+id:2621721db05068dffb65b88cd50d2a5b49e967f5.1405220724.git.wking@tremily.us\r
+\r
+rebased by simply doing patch -p1 < patchfile and then creating commit.\r
+\r
+\r
+ configure | 20 +++++++++++++++-----\r
+ doc/Makefile.local | 2 +-\r
+ doc/prerst2man.py | 9 +++++----\r
+ 3 files changed, 21 insertions(+), 10 deletions(-)\r
+\r
+diff --git a/configure b/configure\r
+index 9c98040c4531..8a4305f8bde3 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -455,17 +455,23 @@ if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev\r
+ printf "Yes.\n"\r
+ have_sphinx=1\r
+ have_rst2man=0\r
++ RST2MAN=\r
+ else\r
+ printf "No (falling back to rst2man).\n"\r
+ have_sphinx=0\r
+ \r
+ printf "Checking if rst2man is available... "\r
+- if rst2man -V > /dev/null 2>&1; then\r
+- printf "Yes.\n"\r
+- have_rst2man=1\r
+- else\r
+- printf "No (so will not install man pages).\n"\r
++ for RST2MAN in rst2man rst2man.py; do\r
++ if "${RST2MAN}" -V > /dev/null 2>&1; then\r
++ have_rst2man=1\r
++ printf "Yes (${RST2MAN}).\n"\r
++ break\r
++ fi\r
++ RST2MAN=\r
++ done\r
++ if [ -z "${RST2MAN}" ]; then\r
+ have_rst2man=0\r
++ printf "No (so will not install man pages).\n"\r
+ fi\r
+ fi\r
+ \r
+@@ -861,6 +867,10 @@ HAVE_RST2MAN=${have_rst2man}\r
+ # Whether there's a doxygen binary available for building api documentation\r
+ HAVE_DOXYGEN=${have_doxygen}\r
+ \r
++# The path to the rst2man program for building documentation. Set to\r
++# an empty string if no such program is available.\r
++RST2MAN=${RST2MAN}\r
++\r
+ # The directory to which desktop files should be installed\r
+ desktop_dir = \$(prefix)/share/applications\r
+ \r
+diff --git a/doc/Makefile.local b/doc/Makefile.local\r
+index e7d0bac8f3fb..a13cb3731664 100644\r
+--- a/doc/Makefile.local\r
++++ b/doc/Makefile.local\r
+@@ -51,7 +51,7 @@ ifeq ($(HAVE_SPHINX),1)\r
+ mv $(DOCBUILDDIR)/man/*.$${section} $(DOCBUILDDIR)/man/man$${section}; \\r
+ done\r
+ else ifeq ($(HAVE_RST2MAN),1)\r
+- $(prerst2man) $(srcdir)/doc $(DOCBUILDDIR)/man\r
++ $(prerst2man) "$(RST2MAN)" $(srcdir)/doc $(DOCBUILDDIR)/man\r
+ else\r
+ @echo "Fatal: build dependency fail."\r
+ @false\r
+diff --git a/doc/prerst2man.py b/doc/prerst2man.py\r
+index 968722a1c750..2e87976c5d96 100644\r
+--- a/doc/prerst2man.py\r
++++ b/doc/prerst2man.py\r
+@@ -4,8 +4,9 @@ from os.path import dirname, isdir\r
+ from os import makedirs, system\r
+ import re\r
+ \r
+-sourcedir = argv[1]\r
+-outdir = argv[2]\r
++rst2man = argv[1]\r
++sourcedir = argv[2]\r
++outdir = argv[3]\r
+ \r
+ if not isdir(outdir):\r
+ makedirs(outdir, 0o755)\r
+@@ -60,5 +61,5 @@ for page in man_pages:\r
+ outfile.write("".join(lines))\r
+ outfile.close()\r
+ \r
+- system('set -x; rst2man {0} {1}/{2}.{3}'\r
+- .format(filename, outdir, page[0], page[4]))\r
++ system('set -x; {0} {1} {2}/{3}.{4}'\r
++ .format(rst2man, filename, outdir, page[0], page[4]))\r
+-- \r
+2.0.0\r
+\r