diff options
author | Russ Allbery <eagle@eyrie.org> | 2014-07-16 12:39:06 -0700 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2014-07-16 13:35:37 -0700 |
commit | 74924cb23845f60b81f26b87516baafe0e1fae5b (patch) | |
tree | c5e94bff1f323465d773f11caeda1b72628add6d | |
parent | 38323e67f70cab4dce0aef0db3775cbd62e865de (diff) |
Work around Automake distcheck process
Automake insists on not using DESTDIR for distcheck and instead
relying on prefix, but we don't want Perl module installation to
follow prefix since that may result in a module install directory that
isn't in Perl's search path. So, if and only if we're running under
distcheck, we pass the prefix in as --install_base.
When copying the Test::RRA Perl modules into the perl/t/lib tree,
use separate mkdir and $(INSTALL_DATA) instead of cp -R. The latter
copies the read-only permissions, and then distclean cannot remove
the files.
Change-Id: Ic1879defad993c76384f7c207cd04cb67889a7ac
Reviewed-on: https://gerrit.stanford.edu/1568
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
-rw-r--r-- | Makefile.am | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index 16c0289..4461fcb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -205,12 +205,28 @@ perl/blib/lib/Wallet/Config.pm: $(srcdir)/perl/lib/Wallet/Config.pm cp "$(srcdir)/$$f" "$(builddir)/$$f" ; \ done ; \ fi - cp -R $(srcdir)/tests/tap/perl/* perl/t/lib/ + mkdir perl/t/lib/Test + $(INSTALL_DATA) $(srcdir)/tests/tap/perl/Test/RRA.pm perl/t/lib/Test/ + mkdir perl/t/lib/Test/RRA + $(INSTALL_DATA) $(srcdir)/tests/tap/perl/Test/RRA/Config.pm \ + perl/t/lib/Test/RRA/ cd perl && perl Build.PL $(WALLET_PERL_FLAGS) cd perl && ./Build +# This is a really ugly hack to only honor prefix when running make install +# under Automake's distcheck. +# +# Automake insists on not using DESTDIR for distcheck and instead relying on +# prefix, but we don't want Perl module installation to follow prefix since +# that may result in a module install directory that isn't in Perl's search +# path. So, if and only if we're running under distcheck, we pass the +# prefix in as --install_base. install-data-local: - cd perl && ./Build install --destdir '$(DESTDIR)' + set -e; flags= ; \ + case "$(prefix)" in \ + */_inst) flags="--install_base $(prefix)" ;; \ + esac ; \ + cd perl && ./Build install $$flags --destdir '$(DESTDIR)' # ExtUtils::MakeMaker really likes moving the Makefile aside. clean-local: |