chiark / gitweb /
dgit: Dgit parsing: Refactor into parse_dsc_field
[dgit.git] / Makefile
index c90e4200e1dd27c7f1a0a4a4889f1fc4874860ac..2b5a5dca288f32053864bbfe7802171c8cd511b8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 # dgit
 # Integration between git and Debian-style archives
 #
-# Copyright (C)2013-2015 Ian Jackson
+# Copyright (C)2013-2016 Ian Jackson
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -30,23 +30,42 @@ man1dir=$(mandir)/man1
 man7dir=$(mandir)/man7
 infraexamplesdir=$(prefix)/share/doc/dgit-infrastructure/examples
 txtdocdir=$(prefix)/share/doc/dgit
+absurddir=$(prefix)/share/dgit/absurd
 
-PROGRAMS=dgit
+PROGRAMS=dgit dgit-badcommit-fixup
 MAN1PAGES=dgit.1
-MAN7PAGES=dgit.7
+
+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
+
 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 \
        dgit-repos-policy-trusting dgit-mirror-rsync
 INFRA_EXAMPLES=get-dm-txt ssh-wrap drs-cron-wrap get-suites
-INFRA_PERLMODULES=Debian/Dgit/Policy/Debian.pm
+INFRA_PERLMODULES= \
+       Debian/Dgit.pm \
+       Debian/Dgit/Infra.pm \
+       Debian/Dgit/Policy/Debian.pm
+
+all:   $(MAN7PAGES) $(addprefix substituted/,$(PROGRAMS))
 
-all:
+substituted/%: %
+       mkdir -p substituted
+       perl -pe 's{\bundef\b}{'\''$(absurddir)'\''} if m/###substituted###/' \
+               <$< >$@
 
-install:       installdirs
-       $(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) $(MAN7PAGES) $(DESTDIR)$(man7dir)
        $(INSTALL_DATA) $(TXTDOCS) $(DESTDIR)$(txtdocdir)
@@ -57,7 +76,7 @@ install:      installdirs
 installdirs:
        $(INSTALL_DIR) $(DESTDIR)$(bindir) \
                $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir) \
-               $(DESTDIR)$(txtdocdir) \
+               $(DESTDIR)$(txtdocdir) $(DESTDIR)$(absurddir) \
                $(addprefix $(DESTDIR)$(perldir)/, $(dir $(PERLMODULES)))
 
 install-infra: installdirs-infra
@@ -76,4 +95,12 @@ installdirs-infra:
 check installcheck:
 
 clean distclean mostlyclean maintainer-clean:
-       rm -rf tests/tmp
+       rm -rf tests/tmp substituted
+       set -e; for m in $(MAN7PAGES); do \
+               test -e $$m.pod && rm -f $$m; \
+       done
+
+%.7: %.7.pod
+       pod2man --section=7 --date="Debian Project" --center="dgit" \
+               --name=$(subst .7,,$@) \
+               $^ $@