1 Return-Path: <bremner@tesseract.cs.unb.ca>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 6C485431FBC
\r
6 for <notmuch@notmuchmail.org>; Sat, 3 Jan 2015 07:49:43 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id TD83hV5NKkEp for <notmuch@notmuchmail.org>;
\r
16 Sat, 3 Jan 2015 07:49:40 -0800 (PST)
\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])
\r
18 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id B9A6B431FB6
\r
21 for <notmuch@notmuchmail.org>; Sat, 3 Jan 2015 07:49:40 -0800 (PST)
\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)
\r
23 (envelope-from <bremner@tesseract.cs.unb.ca>)
\r
24 id 1Y7QxQ-0007cd-0e; Sat, 03 Jan 2015 11:49:40 -0400
\r
25 Received: (nullmailer pid 5255 invoked by uid 1000); Sat, 03 Jan 2015
\r
27 From: David Bremner <david@tethera.net>
\r
28 To: notmuch@notmuchmail.org
\r
29 Subject: [PATCH] doc: Allow rst2man.py as an alternative to rst2man
\r
30 Date: Sat, 3 Jan 2015 16:49:27 +0100
\r
31 Message-Id: <1420300167-5060-1-git-send-email-david@tethera.net>
\r
32 X-Mailer: git-send-email 2.1.3
\r
33 In-Reply-To: <1420294479-27224-1-git-send-email-tomi.ollila@iki.fi>
\r
34 References: <1420294479-27224-1-git-send-email-tomi.ollila@iki.fi>
\r
35 X-BeenThere: notmuch@notmuchmail.org
\r
36 X-Mailman-Version: 2.1.13
\r
38 List-Id: "Use and development of the notmuch mail system."
\r
39 <notmuch.notmuchmail.org>
\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
43 List-Post: <mailto:notmuch@notmuchmail.org>
\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
47 X-List-Received-Date: Sat, 03 Jan 2015 15:49:43 -0000
\r
49 From: "W. Trevor King" <wking@tremily.us>
\r
51 Gentoo's dev-python/docutils-0.10 installs Docutils scripts with a
\r
52 *.py extension, so I have /usr/bin/rst2man.py and no rst2man script.
\r
53 This patch supports users with both types of systems by checking for
\r
54 rst2man, falling back on rst2man.py, and giving up only if neither is
\r
55 found. Users can also set the new RST2MAN path variable explicitly
\r
56 when they call Make:
\r
58 make RST2MAN=/my/custom/rst_to_man_converter build-man
\r
60 We pass the configured RST2MAN path through to prerst2man.py to use in
\r
63 We can use a non-empty RST2MAN to check for the availability of an
\r
64 rst2man program, so there's no need for a separate HAVE_RST2MAN.
\r
65 However, we keep the existing HAVE_RST2MAN for consistency with
\r
69 At the risk of bike-shedding, rewrite the configure check to be more
\r
70 "obvious". This is pretty subjective, but in particular I'm not a big
\r
71 fan of resetting RST2MAN at the bottom of every iteration of the for
\r
72 loop. Also conform a bit more to the convention of using a lower case variable in configure and assigning it in Makefile.
\r
74 For some reason it bugs me a bit to pass RST2MAN as an extra command line argument, but I guess taking some arguments by command line and some by environment variables would also be icky.
\r
76 configure | 23 ++++++++++++++++-------
\r
77 doc/Makefile.local | 2 +-
\r
78 doc/prerst2man.py | 9 +++++----
\r
79 3 files changed, 22 insertions(+), 12 deletions(-)
\r
81 diff --git a/configure b/configure
\r
82 index 137acea..fdf5bad 100755
\r
85 @@ -444,21 +444,27 @@ else
\r
88 printf "Checking if sphinx is available and supports nroff output... "
\r
92 if hash sphinx-build > /dev/null 2>&1 && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then
\r
97 printf "No (falling back to rst2man).\n"
\r
101 printf "Checking if rst2man is available... "
\r
102 - if rst2man -V > /dev/null 2>&1; then
\r
106 + for name in rst2man rst2man.py; do
\r
107 + if "${name}" -V > /dev/null 2>&1; then
\r
108 + printf "Yes (${name}).\n"
\r
114 + if [ $have_rst2man -eq 0 ]; then
\r
115 printf "No (so will not install man pages).\n"
\r
120 @@ -854,6 +860,9 @@ HAVE_RST2MAN=${have_rst2man}
\r
121 # Whether there's a doxygen binary available for building api documentation
\r
122 HAVE_DOXYGEN=${have_doxygen}
\r
124 +# The path to the rst2man program for building documentation.
\r
125 +RST2MAN = ${rst2man}
\r
127 # The directory to which desktop files should be installed
\r
128 desktop_dir = \$(prefix)/share/applications
\r
130 diff --git a/doc/Makefile.local b/doc/Makefile.local
\r
131 index e7d0bac..a13cb37 100644
\r
132 --- a/doc/Makefile.local
\r
133 +++ b/doc/Makefile.local
\r
134 @@ -51,7 +51,7 @@ ifeq ($(HAVE_SPHINX),1)
\r
135 mv $(DOCBUILDDIR)/man/*.$${section} $(DOCBUILDDIR)/man/man$${section}; \
\r
137 else ifeq ($(HAVE_RST2MAN),1)
\r
138 - $(prerst2man) $(srcdir)/doc $(DOCBUILDDIR)/man
\r
139 + $(prerst2man) "$(RST2MAN)" $(srcdir)/doc $(DOCBUILDDIR)/man
\r
141 @echo "Fatal: build dependency fail."
\r
143 diff --git a/doc/prerst2man.py b/doc/prerst2man.py
\r
144 index 968722a..2e87976 100644
\r
145 --- a/doc/prerst2man.py
\r
146 +++ b/doc/prerst2man.py
\r
147 @@ -4,8 +4,9 @@ from os.path import dirname, isdir
\r
148 from os import makedirs, system
\r
151 -sourcedir = argv[1]
\r
154 +sourcedir = argv[2]
\r
157 if not isdir(outdir):
\r
158 makedirs(outdir, 0o755)
\r
159 @@ -60,5 +61,5 @@ for page in man_pages:
\r
160 outfile.write("".join(lines))
\r
163 - system('set -x; rst2man {0} {1}/{2}.{3}'
\r
164 - .format(filename, outdir, page[0], page[4]))
\r
165 + system('set -x; {0} {1} {2}/{3}.{4}'
\r
166 + .format(rst2man, filename, outdir, page[0], page[4]))
\r