-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile.PL
144 lines (126 loc) · 5.19 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
use strict;
use warnings;
require 5.008001;
use ExtUtils::MakeMaker;
my $developer = -f '.gitignore';
ExtUtils::MakeMaker->VERSION(6.98) if $developer;
my %WriteMakefileArgs = (
NAME => 'Test::Class',
VERSION_FROM => 'lib/Test/Class.pm',
ABSTRACT_FROM => 'lib/Test/Class.pm',
AUTHOR => 'Adrian Howard <[email protected]>, Curtis "Ovid" Poe, <ovid at cpan.org>, Mark Morgan <[email protected]>',
LICENSE => 'perl_5',
META_MERGE => {
'meta-spec' => { version => 2 },
dynamic_config => 1,
resources => {
repository => {
url => 'https://github.com/mjgardner/test-class.git',
web => 'https://github.com/mjgardner/test-class',
type => 'git',
},
bugtracker => {
web => 'https://github.com/mjgardner/test-class/issues',
},
},
x_contributors => [ # manually added, from git shortlog -e -s -n
'Adrian Howard <[email protected]>',
'Karen Etheridge <[email protected]>',
'Curtis Poe <[email protected]>',
'makk384 <[email protected]>',
'Ricardo Signes <[email protected]>',
'Alexandr Ciornii <[email protected]>',
'Tim Vroom <[email protected]>',
'Matthew Horsfall <[email protected]>',
'Michael G. Schwern <[email protected]>',
'Chad Granum <[email protected]>',
'Peter Sergeant <[email protected]>',
'Sam Kington <[email protected]>',
'Klaus S. Madsen <[email protected]>',
'Zefram <[email protected]>',
'Kent Fredric <[email protected]>',
],
x_MailingList => 'http://lists.perl.org/list/perl-qa.html',
x_IRC => 'irc://irc.perl.org/#perl-qa',
},
META_ADD => {
'meta-spec' => { version => 2 },
prereqs => {
configure => {
requires => {
'ExtUtils::MakeMaker' => '0',
},
},
runtime => {
requires => {
'perl' => '5.008001',
'Attribute::Handlers' => '0.77',
'MRO::Compat' => '0.11',
'Storable' => '2.04',
'Test::Simple' => '0.78',
'Test::Builder' => '0.78',
'Test::Builder::Tester' => '1.02',
'Carp' => '0',
'File::Find' => '0',
'File::Spec' => '0',
'constant' => '0',
'strict' => '0',
'warnings' => '0',
'Try::Tiny' => '0',
'Module::Runtime' => '0',
},
},
test => {
requires => {
'Test::Exception' => '0.25',
'IO::File' => '1.09',
'Test::More' => '0.78',
'Fcntl' => '0',
'Test' => '0',
'base' => '0',
'overload' => '0',
'Capture::Tiny' => '0',
},
},
},
},
);
my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
for (qw(configure build test runtime)) {
my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
next unless exists $WriteMakefileArgs{META_ADD}{prereqs}{$_}
or exists $WriteMakefileArgs{$key};
my $r = $WriteMakefileArgs{$key} = {
%{$WriteMakefileArgs{META_ADD}{prereqs}{$_}{requires} || {}},
%{delete $WriteMakefileArgs{$key} || {}},
};
defined $r->{$_} or delete $r->{$_} for keys %$r;
}
# dynamic prereqs get added here.
# 0.99 broke test_out with qr//
$WriteMakefileArgs{PREREQ_PM}{'Test::Builder'} = '1.001002'
if eval { require Test::Builder; Test::Builder->VERSION eq '0.99' };
$WriteMakefileArgs{MIN_PERL_VERSION} = delete $WriteMakefileArgs{PREREQ_PM}{perl} || 0;
die 'attention developer: you need to do a sane meta merge here!'
if keys %{$WriteMakefileArgs{BUILD_REQUIRES}};
$WriteMakefileArgs{BUILD_REQUIRES} = {
%{$WriteMakefileArgs{BUILD_REQUIRES} || {}},
%{delete $WriteMakefileArgs{TEST_REQUIRES}}
} if $eumm_version < 6.63_03;
$WriteMakefileArgs{PREREQ_PM} = {
%{$WriteMakefileArgs{PREREQ_PM}},
%{delete $WriteMakefileArgs{BUILD_REQUIRES}}
} if $eumm_version < 6.55_01;
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
if $eumm_version < 6.51_03;
delete $WriteMakefileArgs{MIN_PERL_VERSION}
if $eumm_version < 6.48;
delete @WriteMakefileArgs{qw(META_ADD META_MERGE)}
if $eumm_version < 6.46;
delete $WriteMakefileArgs{LICENSE}
if $eumm_version < 6.31;
WriteMakefile(%WriteMakefileArgs);
use Config;
system("$Config{bin}/pod2text $WriteMakefileArgs{VERSION_FROM} > README")
if $developer
and (not -e 'README' or (stat('README'))[9] < (stat($WriteMakefileArgs{VERSION_FROM}))[9]);