views:

55

answers:

3

I need to install two Perl modules on a web host. Let's call them A::B and X::Y. X::Y depends on A::B (needs A::B to run). Both of them use Module::Install. I have successfully installed A::B into a non-system location using

perl Makefile.PL PREFIX=/non/system/location
make; make test; make install

Now I want to install X::Y, so I try the same thing

perl Makefile.PL PREFIX=/non/system/location

The output is

$ perl Makefile.PL PREFIX=/non/system/location/
Cannot determine perl version info from lib/X/Y.pm
*** Module::AutoInstall version 1.03
*** Checking for Perl dependencies...
[Core Features]
- Test::More          ...loaded. (0.94)
- ExtUtils::MakeMaker ...loaded. (6.54 >= 6.11)
- File::ShareDir      ...loaded. (1.00)
- A::B                ...missing.
==> Auto-install the 1 mandatory module(s) from CPAN? [y] 

It can't seem to find A::B in the system, although it is installed, and when it tries to auto-install the module from CPAN, it tries to write it into the system directory (ignoring PREFIX). I have tried using variables like PERL_LIB and LIB on the command line, after PREFIX=..., but nothing I have done seems to work.

I can do make and make install successfully, but I can't do make test because of this problem. Any suggestions?

I found some advice at http://servers.digitaldaze.com/extensions/perl/modules.html to use an environment variable PERL5LIB, but this also doesn't seem to work:

export PERL5LIB=/non/system/location/lib/perl5/

didn't solve the problem.

A: 

OK, the following prescription did it:

perl Makefile.PL --skipdeps --no-manpages PREFIX=/non/system/location INSTALLSITELIB=/non/system/location/lib INSTALLSITEBIN=/non/system/location/bin INSTALLMAN1DIR=/non/system/location/man/man1 INSTALLMAN3DIR=/non/system/location/man/man3

This is just "monkey see monkey do" but now make test works.

  • The --skipdeps option here suppresses a convenient feature/exasperating problem with Module::Install where it tries to use CPAN.pm to download missing modules.
  • The --no-manpages is supposed to stop it installing man pages but it doesn't work.
Kinopiko
+1  A: 

The answer is local::lib, but you probably already know that :)

zoul
`local::lib` looks like a good solution here, but it involves another dependency, and it's not installed on the web host.
Kinopiko
You can bootstrap local::lib into itself, if you can't install more libs to the standard location.
Ether
A: 

Another monkey see monkey do answer, but I always include LIB as well as PREFIX

perl Makefile.PL PREFIX=/non/system/location/ LIB=/non/standard/location
mobrule
As far as I could tell, this doesn't work; it was one of many things I tried.
Kinopiko