forked from libwww-perl/URI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.PL
138 lines (121 loc) · 4.67 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
use strict;
use warnings;
require 5.008001;
use utf8;
use ExtUtils::MakeMaker;
my $developer = -f '.gitignore';
ExtUtils::MakeMaker->VERSION(6.98) if $developer;
my %WriteMakefileArgs = (
NAME => 'URI',
VERSION_FROM => 'lib/URI.pm',
ABSTRACT_FROM => 'lib/URI.pm',
AUTHOR => 'Gisle Aas <[email protected]>',
LICENSE => 'perl_5',
META_MERGE => {
'meta-spec' => { version => 2 },
dynamic_config => 0,
resources => {
repository => {
url => 'https://github.com/libwww-perl/uri.git',
web => 'https://github.com/libwww-perl/uri',
type => 'git',
},
bugtracker => {
mailto => '[email protected]',
web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=URI',
},
x_MailingList => 'mailto:[email protected]',
x_IRC => 'irc://irc.perl.org/#lwp',
},
x_authority => 'cpan:GAAS',
x_contributors => [ # manually added, from git shortlog -e -s -n
'Gisle Aas <[email protected]>',
'Karen Etheridge <[email protected]>',
'Ville Skyttä <[email protected]>',
'Mark Stosberg <[email protected]>',
'Michael G. Schwern <[email protected]>',
'Olaf Alders <[email protected]>',
'Slaven Rezic <[email protected]>',
'Matt Lawrence <[email protected]>',
'Peter Rabbitson <[email protected]>',
'Piotr Roszatycki <[email protected]>',
'Salvatore Bonaccorso <[email protected]>',
'Tatsuhiko Miyagawa <[email protected]>',
'Torsten Förtsch <[email protected]>',
'Adam Herzog <[email protected]>',
'gerard <[email protected]>',
'Alex Kapranoff <[email protected]>',
'Brendan Byrd <[email protected]>',
'David Schmidt <[email protected]>',
'Jan Dubois <[email protected]>',
'John Miller <[email protected]>',
'Kenichi Ishigaki <[email protected]>',
'Kent Fredric <[email protected]>',
'Masahiro Honma <[email protected]>',
],
},
META_ADD => {
prereqs => {
configure => {
requires => {
'ExtUtils::MakeMaker' => '0',
},
},
runtime => {
requires => {
'MIME::Base64' => '2',
'parent' => '0',
'Exporter' => '5.57',
'utf8' => '0',
'Scalar::Util' => '0',
'perl' => '5.008001',
},
recommends => {
'Business::ISBN' => '0',
},
},
test => {
requires => {
'Test::More' => '0.96',
'File::Temp' => '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.
$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);
# pod2text is in https://metacpan.org/release/podlators
system("pod2text $WriteMakefileArgs{VERSION_FROM} > README")
if $developer
and (not -e 'README' or (stat('README'))[9] < (stat($WriteMakefileArgs{VERSION_FROM}))[9]);