打包所有Perl模块依赖项吗? [英] Package all Perl module dependencies?

查看:138
本文介绍了打包所有Perl模块依赖项吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现自己在CentOS上没有超级用户访问权限,并且拥有非常la脚的Perl,甚至没有ExtUtils :: MakeMaker.

I've found myself on CentOS without root access, and with a very lame Perl that doesn't even have ExtUtils::MakeMaker.

是否存在可以生成模块依赖项存档的东西,以便我将其解包到可以放入@INC的目录中?

Does there exist something that could produce an archive of a module's dependencies, for my to unwrap into a directory that I could put into @INC?

推荐答案

使用 App :: cpanminus

cd ~/bin
curl -LO http://xrl.us/cpanm
chmod +x cpanm

export ROOT=/some/directory
export PERL5LIB=${ROOT}/lib/perl5

然后,安装ExtUtils::MakeMakerModule::CoreList.您无法进行简单的安装,因为cpanm使用了这些模块,并且它们没有在解压缩的源目录中查找.因此,获取cpanm来下载它们,并进行半手动安装.它实际上安装了三个发行版(上面的两个和ExtUtils::Install),这就是为什么您要调用构建方法三遍的原因:

Then, install ExtUtils::MakeMaker and Module::CoreList. You can't do a simple installation because these modules are used by cpanm, and it doesn't look in the unpacked source directory for them. So, get cpanm to download them, and do a semi-manual install. It actually installs three distributions (the above two and ExtUtils::Install), which is why you get to invoke the build mantra three times:

PERL_MM_OPT=INSTALLBASE=$ROOT ./cpanm -L $ROOT --look ExtUtils::MakeMaker Module::CoreList
perl Makefile.PL
make && make install
exit
perl Makefile.PL
make && make install
exit
perl Makefile.PL
make && make install
exit

它依次解压和cd到每个发行版的目录中.至少在我刚好闲逛的CentOS 6裸机上会发生这种情况.

It unpacks and cds into each distribution's directory successively. At least that's what happens on a bare-bones CentOS 6 install I just happen to have lying around.

在那之后,您应该能够通过以下方式安装模块及其依赖项

After that, you should be able to install your module and its dependencies via

./cpanm -L $ROOT <module name, or url, or tarball goes here>

查看cpanm文档以获取更多信息.

Look at the cpanm docs for more info.

这篇关于打包所有Perl模块依赖项吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆