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 46DF7431FCB
\r
6 for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 05:06:11 -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 yWjS9HyH4NHo for <notmuch@notmuchmail.org>;
\r
16 Tue, 11 Mar 2014 05:06:07 -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 3385A431FBF
\r
21 for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 05:06:07 -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 1WNLRe-0007JZ-HH; Tue, 11 Mar 2014 09:06:06 -0300
\r
25 Received: (nullmailer pid 28623 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 2/3] doc: build man pages at build time; introduce
\r
30 HAVE_SPHINX, HAVE_RST2MAN
\r
31 Date: Tue, 11 Mar 2014 09:05:54 -0300
\r
32 Message-Id: <1394539555-28334-3-git-send-email-david@tethera.net>
\r
33 X-Mailer: git-send-email 1.8.5.3
\r
34 In-Reply-To: <1394539555-28334-1-git-send-email-david@tethera.net>
\r
35 References: <1394539555-28334-1-git-send-email-david@tethera.net>
\r
36 X-BeenThere: notmuch@notmuchmail.org
\r
37 X-Mailman-Version: 2.1.13
\r
39 List-Id: "Use and development of the notmuch mail system."
\r
40 <notmuch.notmuchmail.org>
\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
44 List-Post: <mailto:notmuch@notmuchmail.org>
\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
48 X-List-Received-Date: Tue, 11 Mar 2014 12:06:11 -0000
\r
50 This helps avoid build artifacts (namely, nroff and gzipped-nroff man
\r
51 pages) owned by root.
\r
53 The variables allow choosing which generator to use for the man page.
\r
54 These will be hooked to configure in a following commit.
\r
56 Makefile.local | 2 +-
\r
57 doc/Makefile.local | 31 ++++++++++++++++++-------------
\r
58 doc/mkdocdeps.py | 3 +++
\r
59 3 files changed, 22 insertions(+), 14 deletions(-)
\r
61 diff --git a/Makefile.local b/Makefile.local
\r
62 index 5f797ad..cb7b106 100644
\r
63 --- a/Makefile.local
\r
64 +++ b/Makefile.local
\r
65 @@ -53,7 +53,7 @@ endif
\r
66 FINAL_LIBNOTMUCH_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(CONFIGURE_LDFLAGS)
\r
69 -all: notmuch notmuch-shared
\r
70 +all: notmuch notmuch-shared build-man
\r
71 ifeq ($(MAKECMDGOALS),)
\r
72 ifeq ($(shell cat .first-build-message 2>/dev/null),)
\r
73 @NOTMUCH_FIRST_BUILD=1 $(MAKE) --no-print-directory all
\r
74 diff --git a/doc/Makefile.local b/doc/Makefile.local
\r
75 index fd64f70..23f4095 100644
\r
76 --- a/doc/Makefile.local
\r
77 +++ b/doc/Makefile.local
\r
78 @@ -13,10 +13,9 @@ mkdocdeps := python $(dir)/mkdocdeps.py
\r
79 # Internal variables.
\r
80 ALLSPHINXOPTS := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(dir)
\r
82 -.PHONY: sphinx-html sphinx-man sphinx-texinfo sphinx-info
\r
84 +.PHONY: sphinx-html sphinx-texinfo sphinx-info
\r
86 -.PHONY: install-man
\r
87 +.PHONY: install-man build-man
\r
90 rm -f $@ && gzip --stdout $^ > $@
\r
91 @@ -24,24 +23,30 @@ ALLSPHINXOPTS := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(dir)
\r
93 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCBUILDDIR)/html
\r
96 - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(DOCBUILDDIR)/man
\r
99 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(DOCBUILDDIR)/texinfo
\r
101 sphinx-info: sphinx-texinfo
\r
102 make -C $(DOCBUILDDIR)/texinfo info
\r
104 -# fallback target in case sphinx not installed
\r
106 - $(prerst2man) $(DOCBUILDDIR)/.. $(DOCBUILDDIR)/man
\r
108 -include $(dir)/docdeps.mk
\r
110 MAN_GZIP_FILES := $(addsuffix .gz,${MAN_ROFF_FILES})
\r
112 -${MAN_ROFF_FILES} : sphinx-man
\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 +ifeq ($(HAVE_SPHINX),1)
\r
119 + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(DOCBUILDDIR)/man
\r
121 +else ifeq ($(HAVE_RST2MAN),1)
\r
122 + $(prerst2man) $(DOCBUILDDIR)/.. $(DOCBUILDDIR)/man
\r
125 + @echo "No sphinx or rst2man, will not install man pages."
\r
128 install-man: ${MAN_GZIP_FILES}
\r
129 mkdir -p "$(DESTDIR)$(mandir)/man1"
\r
130 @@ -52,8 +57,8 @@ install-man: ${MAN_GZIP_FILES}
\r
131 install -m0644 $(DOCBUILDDIR)/man/*.7.gz $(DESTDIR)/$(mandir)/man7
\r
132 cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz
\r
135 $(dir)/docdeps.mk: $(dir)/conf.py $(dir)/mkdocdeps.py
\r
136 $(mkdocdeps) $< $(DOCBUILDDIR) $@
\r
138 -CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk
\r
139 +CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk $(dir)/man.stamp
\r
140 +CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES)
\r
141 diff --git a/doc/mkdocdeps.py b/doc/mkdocdeps.py
\r
142 index 2f4a959..e61bea6 100644
\r
143 --- a/doc/mkdocdeps.py
\r
144 +++ b/doc/mkdocdeps.py
\r
145 @@ -6,8 +6,11 @@ outfile = argv[3]
\r
150 out=open(outfile,'w')
\r
151 for page in man_pages:
\r
152 + rst_files = rst_files + ["doc/{0:s}.rst".format(page[0])]
\r
153 roff_files = roff_files + ["{0:s}/man/{1:s}.{2:d}".format(builddir,page[1],page[4])]
\r
155 out.write ('MAN_ROFF_FILES := ' + ' \\\n\t'.join(roff_files)+'\n')
\r
156 +out.write ('MAN_RST_FILES := ' + ' \\\n\t'.join(rst_files)+'\n')
\r