通过CPAN安装需要自定义选项的Perl模块 [英] Install Perl modules that require customized options via CPAN

查看:50
本文介绍了通过CPAN安装需要自定义选项的Perl模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几次,我遇到了在安装时需要自定义标志的模块。例如,现在我停留在Net :: ZooKeeper上,它需要设置--zookeeper-include和--zookeeper-lib。有什么方法可以在cpan shell中进行设置吗?还是我只需要手动构建?

a few times I've come across modules that require custom flags when installing. For example, now I'm stuck at Net::ZooKeeper which requires --zookeeper-include and --zookeeper-lib set. Is there a way I can set these within the cpan shell? Or do I just need to build manually?

推荐答案

有一种简单的方法可以手动构建,但仍然让CPAN处理找到最新版本,下载和解压缩-在cpan shell上执行 look Net :: ZooKeeper ,或者在cpanminus上执行 cpanm --look Net :: ZooKeeper ,然后将其提取并解压缩,然后在解压缩后的目录中会得到一个shell,这时您可以执行通常的 perl Makefile.PL;使;使用所需的任何选项进行安装跳舞,然后退出。这很简单,并且可能是最快的事情,如果您只需要很少这样做。

There's an easy way to "build manually" but still let CPAN handle finding the latest release, downloading, and unpacking for you -- at the cpan shell do look Net::ZooKeeper, or with cpanminus do cpanm --look Net::ZooKeeper, and it'll be fetched and unpacked and then you'll get a shell in the directory it was unpacked into, at which point you can do the usual perl Makefile.PL; make; make install dance with whatever options you like, and then exit. It's pretty simple and probably the fastest possible thing if this is something you only need to do very rarely.

另一方面,如果这是自动化或重复的过程,然后继续遵循eugene y的建议,为需要自定义配置的模块创建一个distroprefs文件,然后将其部署到需要的位置,然后在安装了这些模块的任何位置都将对其进行正确配置,并且不会使构建失败:)

On the other hand, if this is an automated or repetitive process, then go ahead and follow eugene y's advice and create a distroprefs file for the modules that need custom configuration, and deploy it wherever it's needed, and then however and wherever those modules are installed they'll be configured properly and not fail the build :)

这篇关于通过CPAN安装需要自定义选项的Perl模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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