1 Return-Path: <wking@tremily.us>
\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 16E28431FC2
\r
6 for <notmuch@notmuchmail.org>; Sat, 10 May 2014 10:10:40 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=0 tagged_above=-999 required=5
\r
13 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id rMU4pZ1g1PV0 for <notmuch@notmuchmail.org>;
\r
18 Sat, 10 May 2014 10:10:32 -0700 (PDT)
\r
19 Received: from qmta08.westchester.pa.mail.comcast.net
\r
20 (qmta08.westchester.pa.mail.comcast.net [76.96.62.80])
\r
21 by olra.theworths.org (Postfix) with ESMTP id 4EB40431FBF
\r
22 for <notmuch@notmuchmail.org>; Sat, 10 May 2014 10:10:32 -0700 (PDT)
\r
23 Received: from omta16.westchester.pa.mail.comcast.net ([76.96.62.88])
\r
24 by qmta08.westchester.pa.mail.comcast.net with comcast
\r
25 id 0H3j1o0051uE5Es58HAWug; Sat, 10 May 2014 17:10:30 +0000
\r
26 Received: from odin.tremily.us ([24.18.63.50])
\r
27 by omta16.westchester.pa.mail.comcast.net with comcast
\r
28 id 0HAU1o00d152l3L3cHAVGX; Sat, 10 May 2014 17:10:30 +0000
\r
29 Received: from mjolnir.tremily.us (unknown [192.168.0.140])
\r
30 by odin.tremily.us (Postfix) with ESMTPS id 0FA7E11969A4;
\r
31 Sat, 10 May 2014 10:04:16 -0700 (PDT)
\r
32 Received: (nullmailer pid 24529 invoked by uid 1000);
\r
33 Sat, 10 May 2014 17:03:44 -0000
\r
34 From: "W. Trevor King" <wking@tremily.us>
\r
35 To: notmuch@notmuchmail.org
\r
36 Subject: [PATCH v2 1/5] doc: Allow rst2man.py as an alternative to rst2man
\r
37 Date: Sat, 10 May 2014 10:03:32 -0700
\r
39 <c8b019cf95243e4b47780a19d0bfca5b65c79ecb.1399740604.git.wking@tremily.us>
\r
40 X-Mailer: git-send-email 1.9.1.353.gc66d89d
\r
41 In-Reply-To: <cover.1399740604.git.wking@tremily.us>
\r
42 References: <cover.1399740604.git.wking@tremily.us>
\r
43 In-Reply-To: <cover.1399740604.git.wking@tremily.us>
\r
44 References: <cover.1399740604.git.wking@tremily.us>
\r
45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
\r
46 s=q20140121; t=1399741830;
\r
47 bh=XPKzTxLHxzG8cJUIytCGfqNSFtxO0FOYNOfGC92Jpec=;
\r
48 h=Received:Received:Received:Received:From:To:Subject:Date:
\r
50 b=l7xGVWN71+7OENd8SiKZB+w8i9pdBrzBF8lpCiANrPdZCTX3v1G42YEEmCUZihloB
\r
51 pZBnZvXHl095yaM8a5dMVRyzPL8TqZf5gvhgNf8agA6lk853sBoxV6lwR786CbOcQ8
\r
52 XEeXzzE5ZfKt2J40T1zVjPSkzffzC7/VcVG5wL1QUunb0/lo1uJFSEkNrUU5Yewnvt
\r
53 eVk9cjV4f6ywjrtmcXoZaY8i6B+PwAX2Xs8v5/RSpja4ksQt1KhcHjuCNgLJSy8EYZ
\r
54 K/JbareZCMLSnPhZ5e5TZEgMzJq7x3c3Ke9RP+Sl9Qy/4QsbQShVTflXQov1ENmQvk
\r
56 Cc: Tomi Ollila <tomi.ollila@iki.fi>
\r
57 X-BeenThere: notmuch@notmuchmail.org
\r
58 X-Mailman-Version: 2.1.13
\r
60 List-Id: "Use and development of the notmuch mail system."
\r
61 <notmuch.notmuchmail.org>
\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
65 List-Post: <mailto:notmuch@notmuchmail.org>
\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
68 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
69 X-List-Received-Date: Sat, 10 May 2014 17:10:40 -0000
\r
71 Gentoo's dev-python/docutils-0.10 installs Docutils scripts with a
\r
72 *.py extension, so I have /usr/bin/rst2man.py and no rst2man script.
\r
73 This patch supports users with both types of systems by checking for
\r
74 rst2man, falling back on rst2man.py, and giving up only if neither is
\r
75 found. Users can also set the new RST2MAN path variable explicitly
\r
76 when they call Make:
\r
78 make RST2MAN=/my/custom/rst_to_man_converter build-man
\r
80 I use POSIX's 'command -v' [1] to find the path to rst2man or
\r
81 rst2man.py, and save that as RST2MAN in Makefile.config. Then pass
\r
82 the configured RST2MAN path through to prerst2man.py to use in its
\r
85 We can use a non-empty RST2MAN to check for the availability of an
\r
86 rst2man program, so there's no need for a separate HAVE_RST2MAN.
\r
87 However, we keep the existing HAVE_RST2MAN for consistency with
\r
90 [1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
\r
92 configure | 15 +++++++++++++--
\r
93 doc/Makefile.local | 2 +-
\r
94 doc/prerst2man.py | 9 +++++----
\r
95 3 files changed, 19 insertions(+), 7 deletions(-)
\r
97 diff --git a/configure b/configure
\r
98 index 9bde2eb..f017af8 100755
\r
101 @@ -413,17 +413,24 @@ if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev
\r
107 printf "No (falling back to rst2man).\n"
\r
110 printf "Checking if rst2man is available... "
\r
111 if rst2man -V > /dev/null 2>&1; then
\r
114 + RST2MAN=$(command -v rst2man)
\r
115 + printf "Yes (${RST2MAN}).\n"
\r
116 + elif rst2man.py -V > /dev/null 2>&1; then
\r
118 + RST2MAN=$(command -v rst2man.py)
\r
119 + printf "Yes (${RST2MAN}).\n"
\r
121 - printf "No (so will not install man pages).\n"
\r
124 + printf "No (so will not install man pages).\n"
\r
128 @@ -820,6 +827,10 @@ HAVE_SPHINX=${have_sphinx}
\r
129 # Whether there's a rst2man binary available for building documentation
\r
130 HAVE_RST2MAN=${have_rst2man}
\r
132 +# The path to the rst2man program for building documentation. Set to
\r
133 +# an empty string if no such program is available.
\r
134 +RST2MAN=${RST2MAN}
\r
136 # The directory to which desktop files should be installed
\r
137 desktop_dir = \$(prefix)/share/applications
\r
139 diff --git a/doc/Makefile.local b/doc/Makefile.local
\r
140 index bbd4610..d96cdd5 100644
\r
141 --- a/doc/Makefile.local
\r
142 +++ b/doc/Makefile.local
\r
143 @@ -49,7 +49,7 @@ ifeq ($(HAVE_SPHINX),1)
\r
144 mv $(DOCBUILDDIR)/man/*.$${section} $(DOCBUILDDIR)/man/man$${section}; \
\r
146 else ifeq ($(HAVE_RST2MAN),1)
\r
147 - $(prerst2man) $(srcdir)/doc $(DOCBUILDDIR)/man
\r
148 + $(prerst2man) "$(RST2MAN)" $(srcdir)/doc $(DOCBUILDDIR)/man
\r
150 @echo "Fatal: build dependency fail."
\r
152 diff --git a/doc/prerst2man.py b/doc/prerst2man.py
\r
153 index 437dea9..81ce817 100644
\r
154 --- a/doc/prerst2man.py
\r
155 +++ b/doc/prerst2man.py
\r
156 @@ -4,8 +4,9 @@ from os.path import dirname, isdir
\r
157 from os import makedirs, system
\r
160 -sourcedir = argv[1]
\r
163 +sourcedir = argv[2]
\r
166 if not isdir(outdir):
\r
167 makedirs(outdir, 0o755)
\r
168 @@ -59,5 +60,5 @@ for page in man_pages:
\r
169 outfile.write("".join(lines))
\r
172 - system('set -x; rst2man {0} {1}/{2}.{3}'
\r
173 - .format(filename, outdir, page[0], page[4]))
\r
174 + system('set -x; {0} {1} {2}/{3}.{4}'
\r
175 + .format(rst2man, filename, outdir, page[0], page[4]))
\r