如何使用 Makefile.PL 和 ExtUtils::MakeMaker 复制文件?
我正在用 perl 开发一个库和脚本。对于分发,我使用 ExtUtils::MakeMaker
,分发路径中名为 data
的目录中有一些配置和数据文件,例如配置文件是 data/config.ini
和数据文件,例如:data/inv01.stb
。 Makefile.PL
代码的一部分如下:
use ExtUtils::MakeMaker;
my $inifile = 'data/config.ini';
my @data = <data/*.stb>;
WriteMakefile(
NAME => 'Mymodule',
VERSION_FROM => 'lib/Mymodule.pm',
PREREQ_PM => {
'Time::HiRes' => 0,
'Storable' => 0,
'File::Path', => 0,
'File::Copy', => 0,
'Digest::CRC', => 0,
'Digest::MD5', => 0,
'Archive::Tar', => 0,
},
EXE_FILES => [ qw(scripts/check_requests.pl scripts/proc_requests.pl scripts/send_requests.pl) ],
'clean' => {FILES => clean_files()},
);
# Delete *~ files
sub clean_files {
return join(" ", "*.out", "*~", "data/test/*");
}
如何配置 Makefile.PL
以复制非标准目录中的这些文件。
感谢您的帮助
I am developing a library and scripts in perl. For distribution I am using ExtUtils::MakeMaker
, I have some configuration and data files in a directory called data
in the distribution path, for example the config file is data/config.ini
and data files like: data/inv01.stb
. A part of the Makefile.PL
code follows:
use ExtUtils::MakeMaker;
my $inifile = 'data/config.ini';
my @data = <data/*.stb>;
WriteMakefile(
NAME => 'Mymodule',
VERSION_FROM => 'lib/Mymodule.pm',
PREREQ_PM => {
'Time::HiRes' => 0,
'Storable' => 0,
'File::Path', => 0,
'File::Copy', => 0,
'Digest::CRC', => 0,
'Digest::MD5', => 0,
'Archive::Tar', => 0,
},
EXE_FILES => [ qw(scripts/check_requests.pl scripts/proc_requests.pl scripts/send_requests.pl) ],
'clean' => {FILES => clean_files()},
);
# Delete *~ files
sub clean_files {
return join(" ", "*.out", "*~", "data/test/*");
}
How can I configure the Makefile.PL
to copy those files in non standard directory.
thanks for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不使用 EXE_FILES?毕竟,不会检查它们的运行性能。
Why not use EXE_FILES? After all, they are not going to be checked for runability.