Debian Codegraph @

pubmed/inc/Module/Install/MakeMaker.pm

raw
1 #line 1
2 package Module::Install::MakeMaker;
3
4 use strict;
5 use Module::Install::Base;
6 use ExtUtils::MakeMaker ();
7
8 use vars qw{$VERSION $ISCORE @ISA};
9 BEGIN {
10 $VERSION = '0.63';
11 $ISCORE = 1;
12 @ISA = qw{Module::Install::Base};
13 }
14
15 my $makefile;
16 sub WriteMakefile {
17 my ($self, %args) = @_;
18 $makefile = $self->load('Makefile');
19
20 # mapping between MakeMaker and META.yml keys
21 $args{MODULE_NAME} = $args{NAME};
22 unless ($args{NAME} = $args{DISTNAME} or !$args{MODULE_NAME}) {
23 $args{NAME} = $args{MODULE_NAME};
24 $args{NAME} =~ s/::/-/g;
25 }
26
27 foreach my $key (qw(name module_name version version_from abstract author)) {
28 my $value = delete($args{uc($key)}) or next;
29 $self->$key($value);
30 }
31
32 if (my $prereq = delete($args{PREREQ_PM})) {
33 while (my($k,$v) = each %$prereq) {
34 $self->requires($k,$v);
35 }
36 }
37
38 # put the remaining args to makemaker_args
39 $self->makemaker_args(%args);
40 }
41
42 END {
43 if ( $makefile ) {
44 $makefile->write;
45 $makefile->Meta->write;
46 }
47 }
48
49 1;