Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Non-root Module Install problems

by fireartist (Chaplain)
on Feb 20, 2002 at 10:58 UTC ( [id://146548]=perlquestion: print w/replies, xml ) Need Help??

fireartist has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I can't find the solution to my particular problem in the tutorial/modules section, or on cpan FAQ.
Also, the particular modules' docs don't provide the needed info.

I wish to install modules to my folder '~/lib', but I also want to tell MakeMaker to check that same folder to satisfy dependencies.

Example:
If I try to MakeMaker the HTML::Template module, it fails, saying it needs File::Spec.
O.k., so I make and install File::Spec using
perl Makefile.PL LIB=~/lib INSTALLMAN1DIR=~/lib/man/man1 INSTALLMAN3D +IR=~/lib/man/man3 make make test make install
At this point, it fails to install properly, so I just copy the created files and folders to my '~/lib' directory. Then running a perl script with -
use lib '/home/actualre/lib'; use File::Spec
- in it succeeds.

O.k., so now I try to install HTML::Template.
perl Makefile.PL LIB=~/lib INSTALLMAN1DIR=~/lib/man/man1 INSTALLMAN3D +IR=~/lib/man/man3 make make test make install
It now fails, still saying it needs File::Spec. So again, my question is, how do I tell it 'install in my lib dir and ALSO check my lib dir to satisfy dependencies?'.

(Side Note)
I asked my hosts if they could install the Perl module HTML::Template, and they said

"Since we do not support this, you may upload the program to your cgi-bin or the directory where your scripts are uploaded. "

Sounds like they think I was asking them to install a script.
Do their tech-support not know what a Perl module is? :)

Thanks for any help.
fireartist

Replies are listed 'Best First'.
Re: Non-root Module Install problems
by Kanji (Parson) on Feb 20, 2002 at 11:43 UTC

    You want to set PERL5LIB as an environmental variable ...

    # Assumes you use (ba)sh PERL5LIB=/path/to/your/lib:/path/to/your/lib/i386-freebsd INC="-I/path/to/your/lib -I/path/to/your/lib/i386-freebsd" export PERL5LIB INC perl Makefile.PL LIB=/path/to/your/lib \ INSTALLMAN1DIR=/path/to/your/lib/man/man1 \ INSTALLMAN3DIR=/path/to/your/lib/man/man3 make make test make install

    Note the inclusion of lib/$ARCHNAME (well, i386-freesbsd in the above) in addition to lib, as Perl sometimes has the habit of stuffing Platform dependant modules/bits in that directory rather than lib proper.

    IIRC, you should be able to work out what $ARCHNAME should be on your platform by running ...

    perl -MConfig -le 'print $Config{q(archname)}'

    Update: Setting INC, too (example above updated) should help with make test. :)

        --k.

      Thanks,
      I tried it and it (appears) to have worked.

      When I came to the 'make test' stage, it failed with the error:
      Can't locate Test.pm in @INC (@INC contains: /usr/lib/perl5/i386-linux +/5.00404 /usr/lib/perl5 /usr/lib/perl5/site_perl/i386-linux /usr/lib/ +perl5/site_perl .) at test.pl line 5. BEGIN failed--compilation aborted at test.pl line 5.
      Which I think is just because I had changed the PERL5LIB variable.

      Anyway, I continued with 'make install', which succeeded.
      I then wrote a little cgi that created a new HTML::Template object from a file, and filled it with a single variable.
      So this (very basic) test suggests that it is fine.

      Thank you.
      fireartist
(cLive ;-) Re: Non-root Module Install problems
by cLive ;-) (Prior) on Feb 20, 2002 at 19:33 UTC

    Sounds like they think I was asking them to install a script.
    Do their tech-support not know what a Perl module is? :)

    Sounds like they have a policy of keeping their servers running. Just because a script is on CPAN, it doesn't automatically mean it's bulletproof. What if there's a vulnerability that can be abused?

    Erring on the side of caution shows a sound business sense (or perhaps you're right, they have no idea what a module is :)

    .02

    cLive ;-)

    --
    seek(JOB,$$LA,0);

Re: Non-root Module Install problems
by trs80 (Priest) on Feb 21, 2002 at 02:36 UTC
    I posted some information about this at one point. I am not sure if it is relevant to what you needed to know, but perhaps it will be to people that find this node in the future if it isn't.
      I certainly found the article very interesting.
      While I have the problem solved for now, I'm sure it will save me much time when installing more modules in the future.
      :)

      fireartist

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://146548]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2024-04-19 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found