对于Makefile.PL,local :: lib和notest

时间:2011-05-11 11:40:42

标签: perl makefile

我有一个Makefile.PL,我想用“notest”标志安装依赖项并使用我的local :: lib home目录,但是我无法掌握Makefile.PL选项。

我的Makefile.PL看起来像这样:

use inc::Module::Install;

name 'MyApp';
all_from 'lib/MyApp.pm';

requires 'Moose';
requires 'Catalyst::Runtime';
install_script glob('script/*.pl');
auto_install;
WriteAll;

我注意到,将local::lib(已安装)放入我的bash会话中会打开一些标志,这些标志可能会将依赖项安装到local :: lib中,但我不确定并且我已经尚未测试过:

$ 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";

但我不确定这会改变Makefile.PL deps的行为。

1 个答案:

答案 0 :(得分:3)

您应该永久应用eval咒语中的设置,例如将其添加到.bashrc

是的,设置PERL_MM_OPT变量会改变ExtUtils :: MakeMaker的行为,这是Module :: Install的基础。请参阅INSTALL_BASE in ExtUtils::MakeMaker

您无需更改Makefile.PL中的任何内容。


PERL_CPANM_OPT=-n cpanm …
cpanp -i --skiptest …

通常,跳过测试不在您的手中,而在于用户的。 cpan client甚至不允许这样做,只是在测试步骤失败后强制安装。如果用户手动安装依赖项,则他可以完全控制每个步骤,并且您无法阻止他完全运行测试步骤。

我认为您现在需要通过禁止测试来解释您想要实现的目标。

相关问题