~ubuntu-branches/ubuntu/maverick/libclass-accessor-grouped-perl/maverick

« back to all changes in this revision

Viewing changes to inc/Module/Install/MakeMaker.pm

  • Committer: Bazaar Package Importer
  • Author(s): gregor herrmann
  • Date: 2007-07-14 21:51:56 UTC
  • Revision ID: james.westby@ubuntu.com-20070714215156-l0iazyikbi21rpu8
Tags: upstream-0.07000
ImportĀ upstreamĀ versionĀ 0.07000

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.67';
 
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 installdirs)) {
 
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;