chiark / gitweb /
git-debrebase: Improve/fix handling of $prose
[dgit.git] / Makefile
index 27347d9..2e47c0b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -27,15 +27,27 @@ bindir=$(prefix)/bin
 mandir=$(prefix)/share/man
 perldir=$(prefix)/share/perl5
 man1dir=$(mandir)/man1
+man5dir=$(mandir)/man5
 man7dir=$(mandir)/man7
 infraexamplesdir=$(prefix)/share/doc/dgit-infrastructure/examples
 txtdocdir=$(prefix)/share/doc/dgit
+absurddir=$(prefix)/share/dgit/absurd
+
+PROGRAMS=dgit dgit-badcommit-fixup git-debrebase
+MAN1PAGES=dgit.1                               \
+       git-debrebase.1
+
+MAN5PAGES=git-debrebase.5
+
+MAN7PAGES=dgit.7                               \
+       dgit-user.7 dgit-nmu-simple.7           \
+       dgit-maint-native.7                     \
+       dgit-maint-merge.7 dgit-maint-gbp.7     \
+       dgit-sponsorship.7
 
-PROGRAMS=dgit
-MAN1PAGES=dgit.1
-MAN7PAGES=dgit.7
 TXTDOCS=README.dsc-import
 PERLMODULES=Debian/Dgit.pm
+ABSURDITIES=git
 
 INFRA_PROGRAMS=dgit-repos-server dgit-ssh-dispatch \
        dgit-repos-policy-debian dgit-repos-admin-debian \
@@ -46,11 +58,22 @@ INFRA_PERLMODULES= \
        Debian/Dgit/Infra.pm \
        Debian/Dgit/Policy/Debian.pm
 
-all:   $(MAN7PAGES)
+MANPAGES=$(MAN1PAGES) $(MAN5PAGES) $(MAN7PAGES)
+
+all:   $(MANPAGES) $(addprefix substituted/,$(PROGRAMS))
+
+substituted/%: %
+       mkdir -p substituted
+       perl -pe 's{\bundef\b}{'\''$(absurddir)'\''} if m/###substituted###/' \
+               <$< >$@
 
-install:       installdirs $(MAN7PAGES)
-       $(INSTALL_PROGRAM) $(PROGRAMS) $(DESTDIR)$(bindir)
+install:       installdirs all
+       $(INSTALL_PROGRAM) $(addprefix substituted/,$(PROGRAMS)) \
+               $(DESTDIR)$(bindir)
+       $(INSTALL_PROGRAM) $(addprefix absurd/,$(ABSURDITIES)) \
+               $(DESTDIR)$(absurddir)
        $(INSTALL_DATA) $(MAN1PAGES) $(DESTDIR)$(man1dir)
+       $(INSTALL_DATA) $(MAN5PAGES) $(DESTDIR)$(man5dir)
        $(INSTALL_DATA) $(MAN7PAGES) $(DESTDIR)$(man7dir)
        $(INSTALL_DATA) $(TXTDOCS) $(DESTDIR)$(txtdocdir)
        set -e; for m in $(PERLMODULES); do \
@@ -59,8 +82,9 @@ install:      installdirs $(MAN7PAGES)
 
 installdirs:
        $(INSTALL_DIR) $(DESTDIR)$(bindir) \
-               $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir) \
-               $(DESTDIR)$(txtdocdir) \
+               $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir) \
+               $(DESTDIR)$(man7dir) \
+               $(DESTDIR)$(txtdocdir) $(DESTDIR)$(absurddir) \
                $(addprefix $(DESTDIR)$(perldir)/, $(dir $(PERLMODULES)))
 
 install-infra: installdirs-infra
@@ -79,8 +103,8 @@ installdirs-infra:
 check installcheck:
 
 clean distclean mostlyclean maintainer-clean:
-       rm -rf tests/tmp
-       set -e; for m in $(MAN7PAGES); do \
+       rm -rf tests/tmp substituted
+       set -e; for m in $(MANPAGES); do \
                test -e $$m.pod && rm -f $$m; \
        done
 
@@ -88,3 +112,11 @@ clean distclean mostlyclean maintainer-clean:
        pod2man --section=7 --date="Debian Project" --center="dgit" \
                --name=$(subst .7,,$@) \
                $^ $@
+
+git-debrebase.%: git-debrebase.%.pod
+       pod2man --section=$* --date="Debian Project" --center="git-debrebase" \
+               --name=$(subst .$*,,$@) \
+               $^ $@
+
+%.view:        %
+       man -l $*