On Tue, Nov 10, 2009 at 2:06 PM, smanzer
<sman...@chemistry.ohio-state.edu> wrote:
> I want the module to install to a
> "~/lib/" subfolder of my home directory. I have the following .modulebuildrc
> file set up to do this:
>
> install --install_base /Users/smanzer/
>
> This installation method works if I run the scripts from the shell:
>
> Is there a way to do get these built in methods to read my .modulebuildrc
> and act accordingly?

This is a subtle issue.  The .modulebuildrc is checked when the
Module::Build object is created.  In your example, when you create the
Build object and then immediately dispatch to it, you never actually
set the "install" action on the command line (i.e. "Build install")
and thus that parameter in the .modulebuildrc doesn't get applied.  I
suspect if you made it a wildcard, it would work.

However, if you're doing *everything* programmatically, you can just
add "install_base" directly to your object constructor:

> my $build = Module::Build->new(
>        module_name => $mod_name,
>        license => 'perl',
>        install_base => '/Users/smanzer/'
> );
> $build->create_build_script;
> $build->dispatch('build');
> $build->dispatch('test', verbose => 1);
> $build->dispatch('install');

Hope that helps,

David

Reply via email to