-
Notifications
You must be signed in to change notification settings - Fork 57
/
Build.PL
181 lines (151 loc) · 5.5 KB
/
Build.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# mt-aws-glacier - Amazon Glacier sync client
# Copyright (C) 2012-2014 Victor Efimov
# http://mt-aws.com (also http://vs-dev.com) [email protected]
# License: GPLv3
#
# This file is part of "mt-aws-glacier"
#
# mt-aws-glacier is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# mt-aws-glacier is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# APP-MTAWS-ROOT-DIR (marker for scripts to check root dir)
use 5.008008; # minumum perl version is 5.8.8, ancient cpan clients will ignore 'requires/perl' below
use strict;
use warnings;
use Config;
use Module::Build;
use lib qw(lib);
die "OS unsupported\n" if ($^O eq 'MSWin32');
our $MB_VERSION = '0.36';
#https://github.com/Perl-Toolchain-Gang/Module-Build/issues/40
our $MB_BROKEN_RECOMMENDS = ($Module::Build::VERSION ge '0.42') && ($Module::Build::VERSION lt '0.4203');
sub test_jobs
{
return 2 if $^O eq 'openbsd'; # openBSD has low default ulimits.
return 2 if $Config{archname} =~ /arm/i; # ARM systems have small memory
return 2 if $Config{osvers} =~ /qnap/i; # NAS. small memory amount
return 4 if $Config{longsize} < 8; # 32bit system. not too much memory
return 8; # default 8;
}
my $build = Module::Build->new(
module_name => 'App::MtAws',
author => 'Victor Efimov <[email protected]>',
dist_author => 'Victor Efimov <[email protected]>',
dynamic_config => 1,
recursive_test_files=>1,
dist_abstract=>'mt-aws/glacier - Perl Multithreaded Multipart sync to Amazon Glacier',
license =>'gpl3',
# this is a special version of 'mtglacier' script with different shebang and without FindBin
# http://blogs.perl.org/users/randy_stauner/2011/09/shebangs-with-perlbrew-aliases-and-eumm-and-without-locallib.html
script_files => ['bin/mtglacier'], # script_files directive since M::B 0.18
meta_merge => {
resources => {
repository => 'https://github.com/vsespb/mt-aws-glacier',
bugtracker => 'https://github.com/vsespb/mt-aws-glacier/issues',
homepage => 'http://mt-aws.com/'
},
},
requires => {
'perl' => 5.008008, # 5.8.8
'Config' => 0,
'LWP' => '5.803', # ancient CentOS 5.x version
'URI' => '1.10', # even ancient LWP versions require at least 1.10, so we use it too
'HTTP::Request' => 0, # either shipped with LWP, or prereq by LWP, does not contain correct version, sometimes
'JSON::XS' => '1',
# core modules for Perl > 5.8.x
'Digest::SHA' => 0,
#
# CORE MODULES OR DUAL-LIFE MODULES
#
'Carp' => 0,
'Encode' => 0,
'Exporter' => '5.58', # min. tested version
'File::Basename' => 0,
'File::Find' => 0,
'File::Path' => 0,
# for EXLOCK need 0.19
# for compatibility with forking 0.19
# perl 5.8.8 ships 0.16, 5.8.9 ships 0.20, but 5.9.0 ships 0.14
# use 0.16 as we have workarounds for above problems
'File::Temp' => '0.16',
'File::Spec' => '3.12',
'Cwd' => 0,
'File::stat' => 0,
'Getopt::Long' => '2.24',
# distribution 'IO' v 1.22 released with perl 5.8.8, however it does contains IO::{Hnadle|Pipe|Select} versions lower than 1.22
'IO::Handle' => 0,
'IO::Pipe' => 0,
'IO::Select' => 0,
'List::Util' => '1.11', # needed for Test::Spec, however 1.19 is released with perl 5.8.9 and 1.13 with perl 5.9
'POSIX' => 0,
'PerlIO::encoding' => 0,
'I18N::Langinfo' => 0,
'Time::Local' => 0,
'Time::localtime' => 0,
'bytes' => 0,
'constant' => 0,
'lib' => 0,
'strict' => 0,
'integer' => 0,
'utf8' => 0,
'warnings' => 0,
'FindBin' => 0,
#
# / CORE MODULES OR DUAL-LIFE MODULES
#
},
build_requires => {
$ENV{MT_NO_HARNESS} ? () : ('TAP::Harness' => 0),
# Test::Deep
# Does not work with 0.090, 0.091 (due to bug in Test::Deep)
# issue fixed here fixed https://metacpan.org/diff/release/FDALY/Test-Deep-0.091/FDALY/Test-Deep-0.092
#
# However I cannot specify version as '!= 0.090, != 0.091' because some CPAN testers (yet) failed to recognize it
# http://www.cpantesters.org/cpan/report/75a8f356-e307-11e2-bb8b-c8f40b763136
# http://www.cpantesters.org/cpan/report/de15b36c-e301-11e2-86e0-d3fada4a5016
# http://www.cpantesters.org/cpan/report/fc48c53e-e2fe-11e2-9ee6-a6098e6b5bd1
#
# so, specifying as '0.092'
'Test::Deep' => '0.092',
# Test::Simple, Test::More, Test::Builder are part of Test-Simple disto, minimum version 0.88 required as it used by Test::Spec
# (and Test::Spec failed to declare minimim version)
'Test::Simple' => '0.88',
'Test::More' => '0.88',
'Test::MockModule' => 0,
'DateTime' => 0,
'Test::Spec' => 0,
'HTTP::Daemon' => '1.36',
$ENV{MT_DEB_BUILD} ? () : ('Test::Tabs' => '0.003'),
# CORE MODULES OR DUAL-LIFE MODULES
'B' => 0, # test that some scalar IV only to save memory
'Data::Dumper' => 0,
'Time::HiRes' => 0,
'open' => 0,
'Scalar::Util' => '1.11',
# Specify Module::Build twice
'Module::Build' => $MB_VERSION,
},
configure_requires => {
'Module::Build' => $MB_VERSION,
},
$MB_BROKEN_RECOMMENDS ? () :
(
recommends => {
'LWP::Protocol::https' => 6,
}
),
$ENV{MT_NO_HARNESS} ?
() :
(use_tap_harness => 1, tap_harness_args => { jobs => test_jobs() }),
);
$build->create_build_script();
__END__