chiark / gitweb /
Makefile: add dgit-maint-debrebase.7 to MAN7PAGES
[dgit.git] / Makefile
1 # dgit
2 # Integration between git and Debian-style archives
3 #
4 # Copyright (C)2013-2016 Ian Jackson
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 INSTALL=install
20 INSTALL_DIR=$(INSTALL) -d
21 INSTALL_PROGRAM=$(INSTALL) -m 755
22 INSTALL_DATA=$(INSTALL) -m 644
23
24 prefix?=/usr/local
25
26 bindir=$(prefix)/bin
27 mandir=$(prefix)/share/man
28 perldir=$(prefix)/share/perl5
29 man1dir=$(mandir)/man1
30 man7dir=$(mandir)/man7
31 infraexamplesdir=$(prefix)/share/doc/dgit-infrastructure/examples
32 txtdocdir=$(prefix)/share/doc/dgit
33 absurddir=$(prefix)/share/dgit/absurd
34
35 PROGRAMS=dgit dgit-badcommit-fixup
36 MAN1PAGES=dgit.1
37
38 MAN7PAGES=dgit.7                                \
39         dgit-user.7 dgit-nmu-simple.7           \
40         dgit-maint-native.7                     \
41         dgit-maint-merge.7 dgit-maint-gbp.7     \
42         dgit-maint-debrebase.7                  \
43         dgit-sponsorship.7
44
45 TXTDOCS=README.dsc-import
46 PERLMODULES=Debian/Dgit.pm
47 ABSURDITIES=git
48
49 INFRA_PROGRAMS=dgit-repos-server dgit-ssh-dispatch \
50         dgit-repos-policy-debian dgit-repos-admin-debian \
51         dgit-repos-policy-trusting dgit-mirror-rsync
52 INFRA_EXAMPLES=get-dm-txt ssh-wrap drs-cron-wrap get-suites
53 INFRA_PERLMODULES= \
54         Debian/Dgit.pm \
55         Debian/Dgit/Infra.pm \
56         Debian/Dgit/Policy/Debian.pm
57
58 all:    $(MAN7PAGES) $(addprefix substituted/,$(PROGRAMS))
59
60 substituted/%:  %
61         mkdir -p substituted
62         perl -pe 's{\bundef\b}{'\''$(absurddir)'\''} if m/###substituted###/' \
63                 <$< >$@
64
65 install:        installdirs all
66         $(INSTALL_PROGRAM) $(addprefix substituted/,$(PROGRAMS)) \
67                 $(DESTDIR)$(bindir)
68         $(INSTALL_PROGRAM) $(addprefix absurd/,$(ABSURDITIES)) \
69                 $(DESTDIR)$(absurddir)
70         $(INSTALL_DATA) $(MAN1PAGES) $(DESTDIR)$(man1dir)
71         $(INSTALL_DATA) $(MAN7PAGES) $(DESTDIR)$(man7dir)
72         $(INSTALL_DATA) $(TXTDOCS) $(DESTDIR)$(txtdocdir)
73         set -e; for m in $(PERLMODULES); do \
74                 $(INSTALL_DATA) $$m $(DESTDIR)$(perldir)/$${m%/*}; \
75         done
76
77 installdirs:
78         $(INSTALL_DIR) $(DESTDIR)$(bindir) \
79                 $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir) \
80                 $(DESTDIR)$(txtdocdir) $(DESTDIR)$(absurddir) \
81                 $(addprefix $(DESTDIR)$(perldir)/, $(dir $(PERLMODULES)))
82
83 install-infra:  installdirs-infra
84         $(INSTALL_PROGRAM) $(addprefix infra/, $(INFRA_PROGRAMS)) \
85                 $(DESTDIR)$(bindir)
86         $(INSTALL_PROGRAM) $(addprefix infra/, $(INFRA_EXAMPLES)) \
87                 $(DESTDIR)$(infraexamplesdir)
88         set -e; for m in $(INFRA_PERLMODULES); do \
89                 $(INSTALL_DATA) $$m $(DESTDIR)$(perldir)/$${m%/*}; \
90         done
91
92 installdirs-infra:
93         $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(infraexamplesdir) \
94                 $(addprefix $(DESTDIR)$(perldir)/, $(dir $(INFRA_PERLMODULES)))
95
96 check installcheck:
97
98 clean distclean mostlyclean maintainer-clean:
99         rm -rf tests/tmp substituted
100         set -e; for m in $(MAN7PAGES); do \
101                 test -e $$m.pod && rm -f $$m; \
102         done
103
104 %.7: %.7.pod
105         pod2man --section=7 --date="Debian Project" --center="dgit" \
106                 --name=$(subst .7,,$@) \
107                 $^ $@
108
109 %.view: %
110         man -l $*