1 # Copyright (C) 2013-2015 all contributors <meta@public-inbox.org>
2 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
6 RSYNC_DEST = public-inbox.org:/srv/public-inbox/
7 docs := README COPYING INSTALL TODO HACKING
8 docs += $(shell git ls-files 'Documentation/*.txt')
11 PODMAN_OPTS = -v --stderr -d 1993-10-02 -c 'public-inbox user manual'
12 PODMAN_OPTS += -r public-inbox.git
13 podman = $(PODMAN) $(PODMAN_OPTS)
15 PODTEXT_OPTS = --stderr
16 podtext = $(PODTEXT) $(PODTEXT_OPTS)
19 m1 += public-inbox-mda
23 man1 := $(addsuffix .1, $(m1))
24 man5 := $(addsuffix .5, $(m5))
25 man7 := $(addsuffix .7, $(m7))
29 man: $(man1) $(man5) $(man7)
32 mandir ?= $(prefix)/share/man
33 man1dir = $(mandir)/man1
34 man5dir = $(mandir)/man5
35 man7dir = $(mandir)/man7
38 test -z "$(man1)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
39 test -z "$(man5)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
40 test -z "$(man7)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
41 test -z "$(man1)" || $(INSTALL) -m 644 $(man1) $(DESTDIR)$(man1dir)
42 test -z "$(man5)" || $(INSTALL) -m 644 $(man5) $(DESTDIR)$(man5dir)
43 test -z "$(man7)" || $(INSTALL) -m 644 $(man7) $(DESTDIR)$(man7dir)
45 %.1 %.5 %.7 %.8 : Documentation/%.pod
46 $(podman) -s $(subst .,,$(suffix $@)) $< $@+ && mv $@+ $@
48 mantxt = $(addprefix Documentation/, $(addsuffix .txt, $(m1)))
53 Documentation/%.txt : Documentation/%.pod
54 $(podtext) $< $@+ && mv $@+ $@
56 txt2pre = $(PERL) -I lib ./Documentation/txt2pre <$< >$@+ && \
57 touch -r $< $@+ && mv $@+ $@
58 txt := INSTALL README COPYING TODO
59 dtxt := design_notes.txt design_www.txt dc-dlvr-spam-flow.txt
60 dtxt := $(addprefix Documentation/, $(dtxt)) $(mantxt)
63 TITLE="$(basename $(<F))" $(txt2pre)
67 docs_html := $(addsuffix .html, $(subst .txt,,$(dtxt)) $(txt))
69 gz_docs := $(addsuffix .gz, $(docs) $(docs_html))
70 rsync_docs := $(gz_docs) $(docs) $(txt) $(docs_html)
72 gzip -9 --rsyncable <$< >$@+
78 git set-file-times $(docs) $(txt)
80 $(RSYNC) --chmod=Fugo=r -av $(rsync_docs) $(RSYNC_DEST)
82 $(RM) $(man1) $(man5) $(man7) $(gz_docs) $(docs_html) $(mantxt)