-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.PL
84 lines (66 loc) · 1.98 KB
/
Makefile.PL
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
use strict;
use warnings;
use lib qw{ inc };
use ExtUtils::MakeMaker;
use My::Module::Meta;
(my $mmv = ExtUtils::MakeMaker->VERSION) =~ s/_//g;
my $meta = My::Module::Meta->new();
my %args = (
ABSTRACT => $meta->abstract(),
AUTHOR => $meta->author(),
DISTNAME => $meta->dist_name(),
EXE_FILES => $meta->script_files(),
NAME => $meta->module_name(),
PREREQ_PM => $meta->requires(),
PL_FILES => {}, # Prevent old MakeMaker from running Build.PL
realclean => {
FILES => join( ' ', @{ $meta->add_to_cleanup() } ),
},
VERSION_FROM => $meta->version_from(),
);
$mmv >= 6.31
and $args{LICENSE} = $meta->license();
if ( $mmv >= 6.4501 ) {
$args{META_ADD} = {
no_index => $meta->no_index(),
$meta->provides(),
};
$args{META_MERGE} = $meta->meta_merge();
}
$mmv >= 6.4701
and $args{MIN_PERL_VERSION} = $meta->requires_perl();
if ( $mmv >= 6.52 ) {
$args{BUILD_REQUIRES} = $meta->build_requires();
$args{CONFIGURE_REQUIRES} = $meta->configure_requires();
} elsif ( $mmv >= 6.5501 ) {
$args{BUILD_REQUIRES} = $meta->build_requires();
$args{META_MERGE}{configure_requires} = $meta->configure_requires();
} elsif ( $mmv >= 6.4501 ) {
$args{META_MERGE}{build_requires} = $meta->build_requires();
$args{META_MERGE}{configure_requires} = $meta->configure_requires();
} else {
foreach my $method ( qw{ configure_requires build_requires } ) {
my $req = $meta->$method();
foreach my $key ( keys %{ $req } ) {
exists $args{PREREQ_PM}{$key}
or $args{PREREQ_PM}{$key} = $req->{$key};
}
}
}
WriteMakefile( %args );
sub MY::postamble {
my ( $self, @args ) = @_;
my $authortest = $self->test_via_harness(
'$(FULLPERLRUN)', '$(AUTHORTEST_FILES)' );
$authortest =~ s/ \s+ \z //smx;
$authortest =~ s/ \A \s+ //smx;
chomp $authortest;
return <<"EOD";
AUTHORTEST_FILES = t/*.t xt/author/*.t
authortest :: pure_all
AUTHOR_TESTING=1 $authortest
testcover :: pure_all
cover -test
EOD
}
# ex: set textwidth=72 :