Domanda

I want to convert a project from use of ExtUtils::MakeMaker to Module::Build. As the Makefile.PL is mostly default and Module::Build::Convert did not work for me (see below) I want to convert it manually but did not find the equivalent of INST_SCRIPT to place the executables in Perl's bin/ directory.

My WriteMakefile looks like this.

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-*' },
);

I tried to use Module::Build::Convert but make2build throws errors i could not resolve:

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 version:

perl -v

This is perl 5, version 12, subversion 3 (v5.12.3) built for x86_64-linux
È stato utile?

Soluzione

If that's what your Makefile.PL looks like, leave it like that. Don't switch to Module::Build, which appears to be an abandoneed build system. No one maintains Module::Build anymore, and until Leon Timmermans comes out with the next thing, unless there's some feature in Module::Build you absolutely must have, there's no reason to convert to it.

Having said that though, I create the list of script files and use it as the value for script_files. It's not as nice. See my Build.PL for Unicode::Tussle.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top