Discussion:
CPAN cannot install modules locally
(too old to reply)
Alok
2011-07-23 12:56:33 UTC
Permalink
Hi

I am trying to install MediaWiki::Bot module locally on my server (I am
not the admin).
I am trying to use cpan command line interface for this.

I used following options before beginning installation:
o conf makepl_args "LIBS=-L/home/foo/local/lib
INC=-I/home/foo/local/include PREFIX=/home/foo/local/"
o conf commit

It turned out that MediaWiki::Bot requires bunch of other modules that
cpan tries to install. But I see that many of them fail test cases
because they cannot detect each other. For example,

# Failed test at t/warnings_exist.t line 36.
# got: 'Base class package "Tree::DAG_Node" is empty.'

Or they are getting incorrect version (possibly the one thats installed
in /usr/lib/perl)

#.HTML::Entities version 3.28 required--this is only version 1.35 at
/home/foo/.cpan/build/MediaWiki-Bot-3.4.0-X3wY3E/blib/lib/MediaWiki/Bot.pm
line 7.

And due to failed test cases cpan does not install anything.

How do I ensure that cpan uses the modules from /home/foo/local ?
Essentially, I want to override the library preference order. I thought
I was doing that using the o conf makepl_args option. But apparently it
is not working.

Any help will be greatly appreciated.

Thanks,
Alok
Jonathan Yu
2011-07-23 13:33:12 UTC
Permalink
Hi,

Have you looked at the local::lib distribution? It was designed for
this purpose and can be bootstrapped outside of the CPAN shell (so
that you can just download the tarball and install it).

See: http://search.cpan.org/dist/local-lib/

Cheers,

Jonathan
Hi
I am trying to install MediaWiki::Bot module locally on my server (I am not
the admin).
I am trying to use cpan command line interface for this.
o conf makepl_args "LIBS=-L/home/foo/local/lib INC=-I/home/foo/local/include
PREFIX=/home/foo/local/"
o conf commit
It turned out that MediaWiki::Bot requires bunch of other modules that cpan
tries to install. But I see that many  of them fail test cases because they
cannot detect each other. For example,
#   Failed test at t/warnings_exist.t line 36.
#          got: 'Base class package "Tree::DAG_Node" is empty.'
Or they are getting incorrect version (possibly the one thats installed in
/usr/lib/perl)
#.HTML::Entities version 3.28 required--this is only version 1.35 at
/home/foo/.cpan/build/MediaWiki-Bot-3.4.0-X3wY3E/blib/lib/MediaWiki/Bot.pm
line 7.
And due to failed test cases cpan does not install anything.
How do I ensure that cpan uses the modules from /home/foo/local ?
Essentially, I want to override the library preference order. I thought I
was doing that using the o conf makepl_args option. But apparently it is not
working.
Any help will be greatly appreciated.
Thanks,
Alok
Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯
2011-07-23 15:02:29 UTC
Permalink
Post by Alok
How do I ensure that cpan uses the modules from /home/foo/local
The same way you use additional modules for any Perl program, see
<http://faq.perl.org/perlfaq8.html#How_do_I_add_a_direc>.
Post by Alok
o conf makepl_args [
] PREFIX=/home/foo/local/
It's `makepl_arg`, not `makepl_args`.

PREFIX is almost always a mistake, see
<http://p3rl.org/ExtUtils::MakeMaker#INSTALL_BASE> for the details. Where'd
you get the idea? Tell us so we can improve it.

Once you change `makepl_arg`, you also need to change `mbuildpl_arg` because
Makefiles are not the only build system in use.


I want to second Jonathan's recommendation for local::lib. It provides the
required environment variables for maintaining modules in e.g. one's home
directory, no need to mess with Perl-specific configuration files.
brian d foy
2011-07-24 00:22:08 UTC
Permalink
Post by Alok
o conf makepl_args "LIBS=-L/home/foo/local/lib
INC=-I/home/foo/local/include PREFIX=/home/foo/local/"
o conf commit
You're missing some stuff there. See the entry in perlfaq8 (How do I
keep my own module/library directory?):


http://faq.perl.org/perlfaq8.html#How_do_I_keep_my_own

Loading...