App-EUMM-Migrate

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

eumm-migrate is a tool to migrate from ExtUtils::MakeMaker to Module::Build.
It executes Makefile.PL with fake ExtUtils::MakeMaker and rewrites all parameters for
WriteMakefile into corresponding params of Module::Build->new. Calls to 'prompt' are also
intercepted and corresponding 'prompt' is written to Build.PL. All other info should be ported
manually.

Just run eumm-migrate.pl in directory with Makefile.PL. If you use Github, Internet connection
is recommended.

eumm-migrate tries to automatically detect some properties like license, minimum Perl version
required and repository used.

Copyright 2009-2021 Alexandr Ciornii.

eumm-migrate.pl  view on Meta::CPAN

use warnings;

#License: GPL (may change in the future)
#Perl tool to migrate from ExtUtils::MakeMaker to Module::Build
=pod

App::EUMM::Migrate

eumm-migrate is a tool to migrate from ExtUtils::MakeMaker to Module::Build.
It executes Makefile.PL with fake ExtUtils::MakeMaker and rewrites all parameters for
WriteMakefile into corresponding params of Module::Build->new. Calls to 'prompt' are also
intercepted and corresponding 'prompt' is written to Build.PL. All other info should be ported
manually.

Just run eumm-migrate.pl in directory with Makefile.PL. If you use Github, Internet connection
is recommended.

eumm-migrate tries to automatically detect some properties like license, minimum Perl version
required and repository used.

(c) Alexandr Ciornii
=cut

$INC{'ExtUtils/MakeMaker.pm'}=1;

package #hide from PAUSE
 ExtUtils::MakeMaker;
our $VERSION=6.56;
use Exporter;
our @ISA=qw/Exporter/;
our @EXPORT=qw/prompt WriteMakefile/;
#our @EXPORT_OK=qw/prompt WriteMakefile/;

use Data::Dumper;
use File::Slurp;
use Perl::Meta;

my @prompts;
sub prompt ($;$) {  ## no critic
    my($mess, $def) = @_;
    push @prompts,[$mess, $def];
}


#our $writefile_data;
sub WriteMakefile {
  my %params=@_;
  die "EXTRA_META is deprecated" if exists $params{EXTRA_META};
  #print "License not specified\n" if not exists $params{LICENSE};
  if (exists $params{VERSION_FROM} and exists $params{ABSTRACT_FROM} and
   $params{VERSION_FROM} ne $params{ABSTRACT_FROM}) {

eumm-migrate.pl  view on Meta::CPAN

  if (! exists($result{requires}{perl})) {
    my $makefilepl_content=eval { read_file('Makefile.PL') };
    my $version=Perl::Meta::extract_perl_version($makefilepl_content);
    if ($version) {
      $result{requires}{perl}=$version;
    }
  }
  $result{auto_configure_requires}=0;

  open my $out,'>','Build.PL';
  my $prompts_str='';
  if (@prompts) {
    $prompts_str.="die 'please write prompt handling code';\n";
    foreach my $p (@prompts) {
      my($mess, $def) = @$p;
      $prompts_str.="Module::Build->prompt(q{$mess},q{$def});\n";
    }
    $prompts_str.="\n";
  }
  my $str;
  { local $Data::Dumper::Indent=1;local $Data::Dumper::Terse=1;
    $str=Data::Dumper->Dump([\%result], []);
    $str=~s/^\{[\x0A\x0D]+//s;
    $str=~s/\}[\x0A\x0D]+\s*$//s;
  }
  print $out <<'EOT';
use strict;
use Module::Build;
#created by eumm-migrate.pl

EOT
print $out $prompts_str;
  print $out <<'EOT';
my $build = Module::Build->new(
EOT
  print $out $str;
  print $out <<'EOT';
);

$build->create_build_script();
EOT

lib/App/EUMM/Migrate.pm  view on Meta::CPAN


=cut

our $VERSION = '0.12';


=head1 SYNOPSIS

eumm-migrate is a tool to migrate from ExtUtils::MakeMaker to Module::Build.
It executes Makefile.PL with fake ExtUtils::MakeMaker and rewrites all parameters for
WriteMakefile into corresponding params of Module::Build->new. Calls to 'prompt' are also
intercepted and corresponding 'prompt' is written to Build.PL. All other info should be ported
manually.

Just run eumm-migrate.pl in directory with Makefile.PL. If you use Github, Internet connection
is recommended.

eumm-migrate tries to automatically detect some properties like license, minimum Perl version
required and repository used.

=cut



( run in 2.633 seconds using v1.01-cache-2.11-cpan-6aa56a78535 )