没有lib/*.pm的Perl CPAN样式的包装 [英] Perl CPAN-style Packaging with no lib/*.pm

查看:69
本文介绍了没有lib/*.pm的Perl CPAN样式的包装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Perl脚本集合和几个XML数据文件,它们取决于我要分发的文件.当前,我有一个shell脚本,该脚本将bin/*和share/*复制到目标安装树.似乎有点笨拙,所以我想使用打包Perl的标准CPAN方式.

I've got a collection of Perl scripts and a couple XML data files that they depend on which I'd like to distribute. Currently, I've got a shell script which copies bin/* and share/* to a target installation tree. It seems a little clunky, so I'd like to go with something like the standard CPAN way of packaging Perl.

将我的CPAN样式的软件包中的内容捆绑在一起有意义吗?我怀疑它没有什么问题,但是我看过的每个教程都认为lib/Blah.pm是任何程序包中必不可少的文件-我什至没有lib/目录,更不用说任何.pm文件了.

Does is make sense to bundle what I've got in a CPAN-style package? I suspect there is nothing wrong with it, but every tutorial I've looked at thinks that lib/Blah.pm is an essential file in any package - I don't even have a lib/ directory, let alone any .pm files.

是否存在用于打包Perl脚本以及一些数据在share/目录中的标准解决方案?

Is there a standard solution for packaging a collection of Perl scripts, along with some data in a share/ directory?

推荐答案

发行版不关心模块.大多数情况下,大多数工具都默认设置为处理模块,因为这是常见的情况,但是只要提供告诉构建文件如何处理提供的文件的逻辑,您就可以分发任何东西.

Distributions don't care about modules. Most of the tools are set up to handle modules by default because that's the common case, but you can really distribute anything as long as you provide the logic to tell the build files what to do with whatever files that you provide.

ExtUtils :: Makemaker很难用于这种事情,但是Module :: Build(尽管有"Module"一词)使它变得更加容易.但是,您必须对自定义Module :: Build类有所了解,以便可以覆盖不需要的默认行为.

ExtUtils::Makemaker is difficult to use for this sort of thing, but Module::Build (despite the word "Module") makes it much easier. However, you have to know a bit about custom Module::Build classes so you can override the default behavior that you don't want.

如果您谈论的是独立脚本,则可以查看我的 scriptdist 发行版,或者博士.我写过的多布斯文章.它不会为您处理 share/部分,但是添加起来并不难.

If you are talking about standalone scripts, you can look at my scriptdist distribution, or the Dr. Dobbs article I wrote about it. It won't handle the share/ portion for you, but it's not too hard to add.

这篇关于没有lib/*.pm的Perl CPAN样式的包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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