我想将项目从使用ExtUtils::MakeMaker转换为Module::Build。由于 Makefile.PL 大部分是默认的,并且Module::Build::Convert对我不起作用(见下文),我想手动转换它,但没有找到相当于 INST_SCRIPT 将可执行文件放在 Perl 的 bin/ 目录中。
我的 WriteMakefile 看起来像这样。
WriteMakefile(
NAME => 'Project',
AUTHOR => q{Mugen Kenichi <mugen.kenichi@uninets.eu>},
VERSION_FROM => 'lib/Project.pm',
INST_SCRIPT => 'script/',
($ExtUtils::MakeMaker::VERSION >= 6.3002
? ('LICENSE'=> 'perl')
: ()),
PL_FILES => {},
PREREQ_PM => {
'JSON' => 0,
'Log::Log4perl' => 0,
'Proc::Daemon' => 0,
'Term::ANSIColor' => 0,
'MooseX::Declare' => 0.34,
'MooseX::Log::Log4perl' => 0,
'Moose::Util::TypeConstraints' => 0,
'MooseX::Templated::Role' => 0,
'Template' => 0,
# for testing
'Test::More' => 0,
'MooseX::Params::Validate' => 0,
'File::Temp' => 0,
'Sub::Exporter::ForMethods' => 0,
'Data::Section' => 0,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Project-*' },
);
我尝试使用Module::Build::Convert但 make2build 抛出我无法解决的错误:
Variable "$regex" will not stay shared at (re_eval 32) line 1.
Use of uninitialized value $lines[0] in pattern match (m//) at /home/mak/perl5/lib/perl5/Module/Build/Convert.pm line 1305, <DATA> line 1.
perl 版本:
perl -v
This is perl 5, version 12, subversion 3 (v5.12.3) built for x86_64-linux