I have a Makefile.PL for which I want to install dependencies with a "notest" flag and using my local::lib home dir, but I can't get a grasp on the Makefile.PL options.
My Makefile.PL looks li开发者_开发问答ke this:
use inc::Module::Install;
name 'MyApp';
all_from 'lib/MyApp.pm';
requires 'Moose';
requires 'Catalyst::Runtime';
install_script glob('script/*.pl');
auto_install;
WriteAll;
I've noticed that evalling local::lib
(which is already installed) into my bash session turns on some flags which will probably make dependencies install into local::lib, but I'm not sure and I've haven't tested it yet:
$ eval $(perl -Mlocal::lib)
$ perl -Mlocal::lib
export PERL_LOCAL_LIB_ROOT="$PERL_LOCAL_LIB_ROOT:/home/user/perl5";
export PERL_MB_OPT="--install_base /home/user/perl5";
export PERL_MM_OPT="INSTALL_BASE=/home/user/perl5";
export PERL5LIB="/home/user/perl5/lib/perl5/i686-linux:/home/user/perl5/lib/perl5:$PERL5LIB";
export PATH="/home/user/perl5/bin:$PATH";
But I'm not sure this will change the Makefile.PL deps behavior.
You are supposed to permanently apply the settings from the eval
incantation, e.g. adding it to the .bashrc
.
Yes, setting the PERL_MM_OPT
variables changes the behaviour of ExtUtils::MakeMaker which is the foundation of Module::Install. See INSTALL_BASE in ExtUtils::MakeMaker.
You need not change anything in your Makefile.PL
.
PERL_CPANM_OPT=-n cpanm …
cpanp -i --skiptest …
Generally, skipping tests is not in your hand, but the user's. The cpan client does not even allow this, only forcing an installation after a failed test step. If a user installs dependencies manually, he has the full control over each step and you cannot prevent him from running the test step at all.
I think you now need to explain what you want to achieve by wanting to prohibit testing.
精彩评论