forked from roa/pabbix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.PL
70 lines (61 loc) · 1.65 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
#!/usr/bin/perl
use 5.010;
use feature 'say';
use warnings;
use lib 'lib';
use Module::Build;
use Getopt::Long qw(:config pass_through);
my $install = 0;
my $dist = 0;
my $v = '0.02';
my @script_files = grep { -f and !-d } glob 'bin/main.pl';
say for @script_files;
GetOptions(
'install' => \$install,
'dist' => \$dist,
);
my $builder = Module::Build->new(
module_name => 'Pabbix',
license => 'perl',
dist_abstract => 'blah',
dist_author => q{roa},
dist_version_from => 'lib/Pabbix.pm',
build_requires => { 'Test::More' => 0, },
configure_requires => { 'Module::Build' => 0.38, },
requires => {
'perl' => 0,
'LWP::UserAgent' => 0,
'JSON::XS' => 0,
'Data::Dumper' => 0,
'Array::Diff' => 0,
'Moo' => 0,
},
add_to_cleanup => ['Build _build MYMETA.*'],
create_makefile_pl => 'traditional',
meta_add => {
no_index => { directory => ['t'], },
version => $v,
release_status => 'unstable',
},
script_files => [@script_files],
meta_merge => {
provides => {
'Pabbix' => {
file => 'lib/Pabbix.pm',
version => $v,
},
},
},
);
if ($dist) {
$builder->dispatch('build');
$builder->dispatch('test');
$builder->dispatch('distmeta');
$builder->dispatch('dist');
}
if ($install) {
$builder->dispatch('build');
$builder->dispatch( 'test', verbose => 1 );
$builder->dispatch('install');
}
$builder->create_build_script();