This repository has been archived by the owner on Apr 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBuild.PL
82 lines (70 loc) · 2.34 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
use strict;
use warnings;
use Module::Build;
use Module::Load;
use File::Basename;
use File::Spec::Functions;
my $rh_requires;
BEGIN {
$rh_requires = {
'perl' => '5.010',
'Geo::Distance::XS' => '0.08',
'HTTP::Request' => '5.827',
'List::MoreUtils' => '0.22',
'List::Util::WeightedRoundRobin' => '0.4',
'List::Util' => '1.23',
'Net::Ping' => '2.33',
'Time::HiRes' => '1.9711',
'Sort::Versions' => '1.5',
};
my @geocoder_many_plugins = (
'Bing',
'Google',
'Googlev3',
'Mapquest',
'OpenCage',
'OSM',
'Ovi',
'PlaceFinder',
);
# Hack for conditional dependencies. The geocoder plugins are optional,
# but if they are installed, we do care that they are a recent version.
# This detects the modules, and adds version dependencies for any that are
# present.
for my $geocoder (@geocoder_many_plugins) {
my $module_name = 'Geo::Coder::' . $geocoder;
my $plugin_name = 'Geo::Coder::Many::' . $geocoder;
eval ( "use $module_name" );
# If it's installed
unless ($@) {
# Load the plugin
local @INC = (@INC, catdir(dirname(__FILE__), 'lib'));
load($plugin_name);
# If it requires a minimum version, add a dependency
if ($plugin_name->can("_MIN_MODULE_VERSION")) {
$rh_requires->{$module_name} = $plugin_name->_MIN_MODULE_VERSION;
}
}
}
}
my $builder = Module::Build->new(
module_name => 'Geo::Coder::Many',
license => 'perl',
dist_author => q{Ed Freyfogle <[email protected]>},
dist_version_from => 'lib/Geo/Coder/Many.pm',
requires => $rh_requires,
build_requires => {
'Test::Exception' => 0,
'Test::MockObject' => 0,
'Test::Pod::Coverage' => 0,
'Test::Simple' => 0,
},
add_to_cleanup => [ 'Geo-Coder-Many-*' ],
create_makefile_pl => 'traditional',
meta_merge => {
resources => {
repository => 'https://github.com/lokku/Geo-Coder-Many'
},
},
);
$builder->create_build_script();