* Introduce absurddir, which is where the absurdities will go
* Substitute the absurddir into the dgit script during make all
* Install the substituted scripts rather than the originals in make install
* Provide a default in dgit, based on $0
* Clean the substitutions up in make clean
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/*.log
debian/debhelper-build-stamp
dgit-maint-merge.7
debian/*.log
debian/debhelper-build-stamp
dgit-maint-merge.7
man7dir=$(mandir)/man7
infraexamplesdir=$(prefix)/share/doc/dgit-infrastructure/examples
txtdocdir=$(prefix)/share/doc/dgit
man7dir=$(mandir)/man7
infraexamplesdir=$(prefix)/share/doc/dgit-infrastructure/examples
txtdocdir=$(prefix)/share/doc/dgit
+absurddir=$(prefix)/share/dgit/absurd
PROGRAMS=dgit
MAN1PAGES=dgit.1
PROGRAMS=dgit
MAN1PAGES=dgit.1
Debian/Dgit/Infra.pm \
Debian/Dgit/Policy/Debian.pm
Debian/Dgit/Infra.pm \
Debian/Dgit/Policy/Debian.pm
+all: $(MAN7PAGES) $(addprefix substituted/,$(PROGRAMS))
-install: installdirs $(MAN7PAGES)
- $(INSTALL_PROGRAM) $(PROGRAMS) $(DESTDIR)$(bindir)
+substituted/%: %
+ mkdir -p substituted
+ perl -pe 's{\bundef\b}{'\''$(absurddir)'\''} if m/###substituted###/' \
+ <$< >$@
+
+install: installdirs all
+ $(INSTALL_PROGRAM) $(addprefix substituted/,$(PROGRAMS)) \
+ $(DESTDIR)$(bindir)
$(INSTALL_DATA) $(MAN1PAGES) $(DESTDIR)$(man1dir)
$(INSTALL_DATA) $(MAN7PAGES) $(DESTDIR)$(man7dir)
$(INSTALL_DATA) $(TXTDOCS) $(DESTDIR)$(txtdocdir)
$(INSTALL_DATA) $(MAN1PAGES) $(DESTDIR)$(man1dir)
$(INSTALL_DATA) $(MAN7PAGES) $(DESTDIR)$(man7dir)
$(INSTALL_DATA) $(TXTDOCS) $(DESTDIR)$(txtdocdir)
installdirs:
$(INSTALL_DIR) $(DESTDIR)$(bindir) \
$(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir) \
installdirs:
$(INSTALL_DIR) $(DESTDIR)$(bindir) \
$(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir) \
- $(DESTDIR)$(txtdocdir) \
+ $(DESTDIR)$(txtdocdir) $(DESTDIR)$(absurddir) \
$(addprefix $(DESTDIR)$(perldir)/, $(dir $(PERLMODULES)))
install-infra: installdirs-infra
$(addprefix $(DESTDIR)$(perldir)/, $(dir $(PERLMODULES)))
install-infra: installdirs-infra
check installcheck:
clean distclean mostlyclean maintainer-clean:
check installcheck:
clean distclean mostlyclean maintainer-clean:
+ rm -rf tests/tmp substituted
set -e; for m in $(MAN7PAGES); do \
test -e $$m.pod && rm -f $$m; \
done
set -e; for m in $(MAN7PAGES); do \
test -e $$m.pod && rm -f $$m; \
done
use Debian::Dgit;
our $our_version = 'UNRELEASED'; ###substituted###
use Debian::Dgit;
our $our_version = 'UNRELEASED'; ###substituted###
+our $absurdity = undef; ###substituted###
our @rpushprotovsn_support = qw(4 3 2); # 4 is new tag format
our $protovsn;
our @rpushprotovsn_support = qw(4 3 2); # 4 is new tag format
our $protovsn;
our $csuite;
our $instead_distro;
our $csuite;
our $instead_distro;
+if (!defined $absurdity) {
+ $absurdity = $0;
+ $absurdity =~ s{/[^/]+$}{/absurd} or die;
+}
+
sub debiantag ($$) {
my ($v,$distro) = @_;
return $tagformatfn->($v, $distro);
sub debiantag ($$) {
my ($v,$distro) = @_;
return $tagformatfn->($v, $distro);