git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
path: root/nagios-plugins-contrib-24.20190301~bpo9+1/check_rbl/check_rbl-1.4.4/inc/Module/Install/MakeMaker.pm
blob: 0fd552b78f3dd918c0917f0f7241fd3efd579762 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#line 1
package Module::Install::MakeMaker;

use strict;
use ExtUtils::MakeMaker   ();
use Module::Install::Base ();

use vars qw{$VERSION  _æ_ ISA $ISCORE};
BEGIN {
	$VERSION = '1.19';
	 _æ_ ISA     = 'Module::Install::Base';
	$ISCORE  = 1;
}

my $makefile = undef;

sub WriteMakefile {
    my ($self, %args) =  _æ_ _;
    $makefile = $self->load('Makefile');

    # mapping between MakeMaker and META.yml keys
    $args{MODULE_NAME} = $args{NAME};
    unless ( $args{NAME} = $args{DISTNAME} or ! $args{MODULE_NAME} ) {
        $args{NAME} = $args{MODULE_NAME};
        $args{NAME} =~ s/::/-/g;
    }

    foreach my $key ( qw{name module_name version version_from abstract author installdirs} ) {
        my $value = delete($args{uc($key)}) or next;
        $self->$key($value);
    }

    if (my $prereq = delete($args{PREREQ_PM})) {
        while (my($k,$v) = each %$prereq) {
            $self->requires($k,$v);
        }
    }

    if (my $prereq = delete($args{BUILD_REQUIRES})) {
        while (my($k,$v) = each %$prereq) {
            $self->build_requires($k,$v);
        }
    }

    # put the remaining args to makemaker_args
    $self->makemaker_args(%args);
}

END {
    if ( $makefile ) {
        $makefile->write;
        $makefile->Meta->write;
    }
}

1;