views:

61

answers:

2

I am trying to setup a directory that contains Perl modules that should be set aside to not interfere with a production system.

This works OK, with modules that use Module::Install. I just specify a "lib" option and all is well. Now I tried and tried and I simply cannot make this happen with Module::Build. For instance, this command:

./Build install --lib /foo

Will install the module in "/foo/share/perl/5.10.0".

How can I get rid off the "share/perl/5.10.0" part?

PS: Yes, I have taken a long look at the documentation and found some promising sections, but I simply must admit that I seem to be too stupid to grok them.

A: 

I think your best chance is with install_base. From the doc:

install_base

You can also set the whole bunch of installation paths by supplying the install_base parameter to point to a directory on your system. For instance, if you set install_base to "/home/ken" on a Linux system, you'll install as follows:

  lib     => /home/ken/lib/perl5
  arch    => /home/ken/lib/perl5/i386-linux
  script  => /home/ken/bin
  bin     => /home/ken/bin
  bindoc  => /home/ken/man/man1
  libdoc  => /home/ken/man/man3
  binhtml => /home/ken/html
  libhtml => /home/ken/html
Ölbaum
Yes, but this is exactly what I **not** want. No "lib/perl5" for me, please.
innaM
You should change what you want, then. Distributions may install other things too, so there might be a bin directory, etc.
brian d foy
+3  A: 

See install_path. It looks like (I haven't tried) you can either put in .modulebuildrc or specify on the command line all of the path options:

./Build install --install_base $CUSTOMPERLSTUFF \
                --install_path lib=$CUSTOMPERLSTUFF/lib \
                --install_path arch=$CUSTOMPERLSTUFF/lib 
Sinan Ünür
That did the trick! I really needed to provide all three arguments and I'm still not sure how you were able to distill that out of the documentation. But it works! Thank you.
innaM