Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
The company I work for has perl and all it's libraries/modules/etc on a server that the rest of us mount from our local machines. Unfortunately, we don't have write access. So if we want to install perl modules that aren't already there, we have to put them in a different directory on our local machines. So in theory I should do something like set my PERL5LIB environmental variable to /my/perl/dir and then do:
perl Makefile.PL PREFIX=/my/perl/dir
make
make test
make install
Unfortunately, when I do that, it still tries to install to the mounted directory on the server! If I look at Makefile after doing "perl Makefile.PL PREFIX=/my/perl/dir", I see that PREFIX is set properly, but INSTALLPRIVLIB, INSTALLARCHLIB, INSTALLSITELIB, INSTALLSITEARCH, INSTALLBIN, and INSTALLSCRIPT are still pointing to directories on the server. Can anyone help? Just for the record, I did "echo $PERL5LIB" before doing all this just to make sure that the environmental variable did indeed get set. The modules I'm dealing with currently are GD and GDGraph.
Re: Perl Modules In My Own Directory
by physi (Friar) on Apr 16, 2003 at 12:45 UTC
|
perl Makefile.PL LIB=/my/perl/dir
as described in
perldoc ExtUtils::MakeMaker
-----------------------------------
--the good, the bad and the physi--
-----------------------------------
| [reply] [d/l] [select] |
|
| [reply] [d/l] |
Re: Perl Modules In My Own Directory
by Helter (Chaplain) on Apr 16, 2003 at 12:47 UTC
|
I too have to install modules locally. I have never had a problem (besides dependancies...oh how I hate dependancies :) ). For all of the packages there is some sort of README file that has information on doing a local build.
It usually comes down to opening the Makefile.PL in your favorite editor, and looking for all the path variables that are set to something you don't like and changing them.
Good luck! | [reply] |
Re: Perl Modules In My Own Directory (details/debug)
by tye (Sage) on Apr 16, 2003 at 17:13 UTC
|
You give a good description but I think the key lies in some of the details that you have (reasonably) omitted. If I ran into this problem, I'd use
% perl -d Makefile.PL PREFIX=/my/perl/dir
DB<1> require ExtUtils::MM_Unix
DB<2> b ExtUtils::MM_Unix::init_main
DB<3> c
and then step through that subroutine in rather large chunks, watching how $self->{INSTALLPRIVLIB} (for example) gets manipulated as it goes along, figuring out why $self->{PREFIX} does not end up affecting it.
The code that does this is complex enough that I didn't see any hope of me spotting the problem without concrete details about your Config.pm file settings, etc.
- tye | [reply] [d/l] [select] |
Re: Perl Modules In My Own Directory
by RollyGuy (Chaplain) on Apr 16, 2003 at 14:39 UTC
|
I think that you might need to type:
make install PREFIX=/my/perl/dir
This would override the PREFIX directive in the makefile and use your directory as the install directory. Look in the makefile for other clues as to what "variables" to set.
Also, you could just do the steps up until the make install. At that point you will have a directory named ".blib". This directory contains all of the files that would've been copied by the install script. You can simply copy them yourself.
Hope this helps. | [reply] |
Re: Perl Modules In My Own Directory
by thejoker101 (Initiate) on Apr 16, 2003 at 18:41 UTC
|
You seem to be having the same troubles I was. I didn't have permissions to the Perl library directory, which is where - when I did a 'make install' - the module was attempting to install itself.
Here's your solution I belive: You said that INSTALLPRIVLIB, INSTALLARCHLIB, INSTALLSITELIB, INSTALLSITEARCH, INSTALLBIN, and INSTALLSCRIPT where all set incorrectly. To correct that, just do what you did with PREFIX. Any of those variables can be overridden. As in:
perl Makefile.PL INSTALLPRIVLIB=/my/dir INSTALLARCHLIB=/my/dir etc.
That's worked for me. | [reply] |
|
Also then do a 'make pure_perl_install'
| [reply] |
|
|