1 # Copyright (C) 2013-2021 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
6 RSYNC_DEST = public-inbox.org:/srv/public-inbox/
11 # this is "xml" on FreeBSD and maybe some other distros:
12 XMLSTARLET = xmlstarlet
14 # libgraph-easy-perl from Debian, Graph::Easy from CPAN
15 GRAPH_EASY = graph-easy
22 PODMAN_OPTS = -v --stderr -d 1993-10-02 -c 'public-inbox user manual'
23 PODMAN_OPTS += -r public-inbox.git
24 podman = $(PODMAN) $(PODMAN_OPTS)
26 PODTEXT_OPTS = --stderr
27 podtext = $(PODTEXT) $(PODTEXT_OPTS)
31 manpages = $(man1) $(man5) $(man7) $(man8)
37 mandir ?= $(INSTALLMAN1DIR)/..
38 man5dir = $(mandir)/man5
39 man7dir = $(mandir)/man7
40 man8dir = $(mandir)/man8
43 $(INSTALL) -d -m 755 $(DESTDIR)$(INSTALLMAN1DIR)
44 $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
45 $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
46 $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
47 $(INSTALL) -m 644 $(man1) $(DESTDIR)$(INSTALLMAN1DIR)
48 $(INSTALL) -m 644 $(man5) $(DESTDIR)$(man5dir)
49 $(INSTALL) -m 644 $(man7) $(DESTDIR)$(man7dir)
50 $(INSTALL) -m 644 $(man8) $(DESTDIR)$(man8dir)
52 doc_install :: install-man
56 '{gsub(/\b./,"")}$$0 !~ /\.onion/&&length>80{print;e=1}END{exit(e)}' \
59 check-man :: $(check_80)
61 check-lexgrog :: $(check_lexgrog)
65 txt2pre = $(PERL) -I lib ./Documentation/txt2pre >$@
67 Documentation/standards.txt : Documentation/standards.perl
68 $(PERL) -w Documentation/standards.perl >$@+
69 touch -r Documentation/standards.perl $@+
72 # flow.txt is checked into git since Graph::Easy isn't in many distros
73 Documentation/flow.txt : Documentation/flow.ge
74 (sed -ne '1,/^$$/p' <Documentation/flow.ge; \
75 $(GRAPH_EASY) Documentation/flow.ge || \
76 cat Documentation/flow.txt; \
78 sed -ne '/^# Copyright/,$$p' <Documentation/flow.ge \
80 touch -r Documentation/flow.ge $@+
83 NEWS NEWS.atom NEWS.html : $(news_deps)
84 $(PERL) -I lib -w Documentation/mknews.perl $@ $(RELEASES)
86 # check for internal API changes:
87 check :: NEWS .NEWS.atom.check NEWS.html
89 .NEWS.atom.check: NEWS.atom
90 $(XMLSTARLET) val NEWS.atom || \
91 { e=$$?; test $$e -eq 0 || test $$e -eq 127; }
99 gzip -9 --rsyncable <$< >$@+
107 rsync-doc: NEWS.atom.gz
108 # /usr/share/doc/rsync/scripts/git-set-file-times{.gz} on Debian systems
109 # It is also at: https://yhbt.net/git-set-file-times
110 -git set-file-times $(docs) $(txt)
111 $(MAKE) gz-doc gz-xdoc
112 $(RSYNC) --chmod=Fugo=r -av $(rsync_docs) $(rsync_xdocs) $(RSYNC_DEST)
115 $(RM_F) $(man1) $(man5) $(man7) $(man8) $(gz_docs) $(docs_html) \
116 $(mantxt) $(rsync_xdocs) \
117 NEWS NEWS.atom NEWS.html Documentation/standards.txt \
118 Documentation/flow.html Documentation/flow.html.gz \
119 Documentation/flow.txt.gz
123 # No camel-cased tarballs or pathnames which MakeMaker creates,
124 # this may not always be a Perl project. This should match what
125 # cgit generate, since git maintainers ensure git-archive has
127 DIST_TREE = HEAD^{tree}
130 ver=$$(git describe $(DIST_VER) | sed -ne s/v//p); \
131 pkgpfx=public-inbox-$$ver; \
132 git archive --prefix=$$pkgpfx/ --format=tar $(DIST_TREE) \
133 | gzip -n >$$pkgpfx.tar.gz; \
134 echo $$pkgpfx.tar.gz created