1 Return-Path: <bremner@tethera.net>
\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 C365A431FD0
\r
6 for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 05:06:27 -0700 (PDT)
\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 zaegCz0F77+Y for <notmuch@notmuchmail.org>;
\r
16 Tue, 11 Mar 2014 05:06:25 -0700 (PDT)
\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 97A3A431FD2
\r
21 for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 05:06:13 -0700 (PDT)
\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)
\r
23 (envelope-from <bremner@tethera.net>)
\r
24 id 1WNLRl-0007Jt-9G; Tue, 11 Mar 2014 09:06:13 -0300
\r
25 Received: (nullmailer pid 28627 invoked by uid 1000); Tue, 11 Mar 2014
\r
27 From: David Bremner <david@tethera.net>
\r
28 To: notmuch@notmuchmail.org
\r
29 Subject: [Patch v2 3/3] doc: configure detection of sphinx and rst2man
\r
30 Date: Tue, 11 Mar 2014 09:05:55 -0300
\r
31 Message-Id: <1394539555-28334-4-git-send-email-david@tethera.net>
\r
32 X-Mailer: git-send-email 1.8.5.3
\r
33 In-Reply-To: <1394539555-28334-1-git-send-email-david@tethera.net>
\r
34 References: <1394539555-28334-1-git-send-email-david@tethera.net>
\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: Tue, 11 Mar 2014 12:06:28 -0000
\r
49 Because sphinx-build does not provide a convenient way of listing
\r
50 which builders exist, and some people actually have pre 1.0 sphinx, we
\r
51 try loading a relevant python module.
\r
53 Currently the assumption is that no python in path -> no sphinx-build
\r
56 configure | 27 +++++++++++++++++++++++++++
\r
57 doc/Makefile.local | 24 +++++++++++++++---------
\r
58 2 files changed, 42 insertions(+), 9 deletions(-)
\r
60 diff --git a/configure b/configure
\r
61 index 2eaed4a..4aaecc6 100755
\r
64 @@ -393,6 +393,27 @@ else
\r
68 +printf "Checking if sphinx is available and supports nroff output... "
\r
69 +if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev/null 2>&1 ; then
\r
74 + printf "No (falling back to rst2man).\n"
\r
77 + printf "Checking if rst2man is available... "
\r
78 + if rst2man -V > /dev/null 2>&1; then
\r
82 + printf "No (so will not install man pages).\n"
\r
89 libdir_in_ldconfig=0
\r
91 printf "Checking which platform we are on... "
\r
92 @@ -759,6 +780,12 @@ emacsetcdir=${EMACSETCDIR}
\r
93 # Whether there's an emacs binary available for byte-compiling
\r
94 HAVE_EMACS = ${have_emacs}
\r
96 +# Whether there's a sphinx-build binary available for building documentation
\r
97 +HAVE_SPHINX=${have_sphinx}
\r
99 +# Whether there's a rst2man binary available for building documentation
\r
100 +HAVE_RST2MAN=${have_rst2man}
\r
102 # The directory to which desktop files should be installed
\r
103 desktop_dir = \$(prefix)/share/applications
\r
105 diff --git a/doc/Makefile.local b/doc/Makefile.local
\r
106 index 23f4095..4883c4a 100644
\r
107 --- a/doc/Makefile.local
\r
108 +++ b/doc/Makefile.local
\r
109 @@ -33,21 +33,26 @@ sphinx-info: sphinx-texinfo
\r
111 MAN_GZIP_FILES := $(addsuffix .gz,${MAN_ROFF_FILES})
\r
113 -build-man: ${MAN_GZIP_FILES}
\r
115 -${MAN_ROFF_FILES}: ${dir}/man.stamp
\r
117 -$(dir)/man.stamp: ${MAN_RST_FILES}
\r
118 +# Use the man page converter that is available. We should never depend
\r
119 +# on MAN_ROFF_FILES if a converter is not available.
\r
120 +${MAN_ROFF_FILES}: ${MAN_RST_FILES}
\r
121 ifeq ($(HAVE_SPHINX),1)
\r
122 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(DOCBUILDDIR)/man
\r
124 else ifeq ($(HAVE_RST2MAN),1)
\r
125 $(prerst2man) $(DOCBUILDDIR)/.. $(DOCBUILDDIR)/man
\r
128 - @echo "No sphinx or rst2man, will not install man pages."
\r
129 + @echo "Fatal: build dependency fail."
\r
133 +# Do not try to build or install man pages if a man page converter is
\r
135 +ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00)
\r
138 + @echo "No sphinx or rst2man, will not install man pages."
\r
140 +build-man: ${MAN_GZIP_FILES}
\r
141 install-man: ${MAN_GZIP_FILES}
\r
142 mkdir -p "$(DESTDIR)$(mandir)/man1"
\r
143 mkdir -p "$(DESTDIR)$(mandir)/man5"
\r
144 @@ -56,9 +61,10 @@ install-man: ${MAN_GZIP_FILES}
\r
145 install -m0644 $(DOCBUILDDIR)/man/*.5.gz $(DESTDIR)/$(mandir)/man5
\r
146 install -m0644 $(DOCBUILDDIR)/man/*.7.gz $(DESTDIR)/$(mandir)/man7
\r
147 cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz
\r
150 $(dir)/docdeps.mk: $(dir)/conf.py $(dir)/mkdocdeps.py
\r
151 $(mkdocdeps) $< $(DOCBUILDDIR) $@
\r
153 -CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk $(dir)/man.stamp
\r
154 +CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk
\r
155 CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES)
\r