--- /dev/null
+Return-Path: <tomi.ollila@iki.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 151C3431FBF\r
+ for <notmuch@notmuchmail.org>; Mon, 10 Mar 2014 15:41:05 -0700 (PDT)\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 nLxKSpB9EqdO for <notmuch@notmuchmail.org>;\r
+ Mon, 10 Mar 2014 15:41:01 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 6EE9E431FBD\r
+ for <notmuch@notmuchmail.org>; Mon, 10 Mar 2014 15:41:01 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id F139810008C;\r
+ Tue, 11 Mar 2014 00:40:56 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Jani Nikula <jani@nikula.org>, David Bremner <david@tethera.net>,\r
+ notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] doc: build man pages at build time, not install\r
+In-Reply-To: <87y50ij7y4.fsf@nikula.org>\r
+References: <1394449633-14737-1-git-send-email-david@tethera.net>\r
+ <87y50ij7y4.fsf@nikula.org>\r
+User-Agent: Notmuch/0.17+112~g4e0c1d5 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Tue, 11 Mar 2014 00:40:56 +0200\r
+Message-ID: <m2y50hisnb.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Mon, 10 Mar 2014 22:41:05 -0000\r
+\r
+On Mon, Mar 10 2014, Jani Nikula <jani@nikula.org> wrote:\r
+\r
+>\r
+> Because build-man is a .PHONY target, it'll get done also on\r
+> install-man, and one still ends up with root owned files on 'sudo make\r
+> install'. The improvement to previous is that doc/_build/man directory\r
+> is now created in the build phase and the files can be removed by the\r
+> regular user.\r
+>\r
+> An actual non-phony dependency chain from .gz to man page to rst would\r
+> be awesome, but I don't know how hard it would be with the\r
+> sphinx/rst2man targets.\r
+\r
+instead of having the targets as .PHONY those should depend on all source\r
+files...\r
+\r
+... perhaps better alternative is to have those still as .PHONY so those\r
+can be neat make targets, but greate new *.stamp targets that depend on\r
+the source files (and these *.stamp targets have the recipes)\r
+\r
+(actually, after I added the stuff below, sphinx-man doesn't need to be\r
+PHONY anymore).\r
+\r
+something like:\r
+\r
+sphinx-man: $(DOCBUILDDIR)/man.stamp\r
+\r
+$(DOCBUILDDIR)/man.stamp: $(MAN_SRC_FILES)\r
+ifeq($(HAVE_SPHINX), 1)\r
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(DOCBUILDDIR)/man\r
+ touch $@\r
+else\r
+ifeq($(HAVE_RST2HTML), 1)\r
+ $(prerst2man) $(DOCBUILDDIR)/.. $(DOCBUILDDIR)/man\r
+ touch $@\r
+endif\r
+endif\r
+\r
+\r
+mkdocdeps.py could create $(MAN_SRC_FILES) and friends pretty easily.\r
+\r
+(sphinx-man could be changed to just 'man', and if anyone wanted to\r
+make manual pages from command line using rst2man that could\r
+work as `make man HAVE_SPHINX=0 HAVE_RST2HTML=1')\r
+\r
+\r
+> BR,\r
+> Jani.\r
+\r
+\r
+Tomi\r