Subject: | Feature request: New "distinstall" target |
Hi there-
My team develops and maintains several Perl modules in CPAN-style
distributions, and we absolutely love Module::Build. In the typical
development cycle, it is pretty common to run "./Build install" from the
checkout directory.
But this has become problematic. We use the new share_dir option to
manage our non-code resources, which tends to clutter the blib/
directory with .svn files and other junk. And when you run "./Build
install" from the checkout directory, all that junk gets installed in
/usr/local/lib/perl5 (or wherever).
But if we run "./Build install" in the distdir, then everything works
beautifully, because the MANIFEST.SKIP makes sure that distdir doesn't
contain any of those junk files.
So, I propose that Module::Build should have a "distinstall" action,
which basically performs an installation from within the distdir.
Granted, you can do the same thing with a couple extra shell commands.
But putting this feature directly into Module::Build avoids the hassle
of figuring out what the actual name of the distdir is. And that is
particularly useful for continuous integration systems and automated builds.
For example, we use a subclass of Module::Build that looks like this:
sub ACTION_distinstall {
my ($self, @args) = @_;
$self->depends_on('distdir');
$self->_do_in_dir ( $self->dist_dir,
sub {
$self->run_perl_script('Build.PL')
or die "Error executing 'Build.PL' in dist directory: $!";
$self->run_perl_script('Build')
or die "Error executing 'Build' in dist directory: $!";
$self->run_perl_script('Build', [], ['install'])
or die "Error executing 'Build install' in dist directory";
});
}
But _do_in_dir() is not a public method. So I'd much rather see
ACTION_distinstall become part of the official API.
Perhaps this what is what you intended for the pure_install target? But
that seems to just be an alias for install.
Thanks for your consideration.
-Jeff