-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBuild.PL
148 lines (113 loc) · 4.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
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
#
# Build-File
# This file describes all Build-Time-Depencencies, test configuration etc.
#
# run as:
# perl ./Build.PL
#
use 5.014;
use strict;
use warnings FATAL => 'all';
eval " use Module::Build 0.36; return 1; "
or die "Please install perl module Module::Build 0.36 or newer for installation. Stopped.\n";
# The socketdir, which is used by Test::PostgreSQL::Starter
my $socketdir = ( $ENV{POSTGRES_TEST_DIR} // "/tmp/_test-postgresql-starter" ) . "/sockets";
my $class = Module::Build->subclass( class => "Module::Build::Posemo", code => <<'CODE');
BEGIN
{
eval 'use Module::Build::Debian; return 1;' or warn "Can't build Debian packages, missing Module::Build::Debian\n";
}
CODE
my $builder = $class->new(
module_name => 'Posemo',
license => 'open_source', # PostgreSQL license not known by Module::Buid
dist_author => q{Alvar C.H. Freude <alvar@a-blast.org>},
dist_version_from => 'lib/PostgreSQL/SecureMonitoring.pm',
dist_abstract => 'PostgreSQL Secure Monitoring -- flexible and secure Postgres monitoring',
test_file_exts => [qw(.t .pg)],
release_status => 'testing',
tap_harness_args => {
sources => {
Perl => undef,
pgTAP => {
dbname => '_posemo_tests',
username => '_posemo_tests', # no superuser -- switch manuelly, when pgTAP needs it!
# superuser => '_posemo_superuser',
host => $socketdir,
suffix => '.pg',
port => 15432,
},
},
},
configure_requires => { 'Module::Build' => 0.36, },
build_requires => {
'Test::More' => 0,
'Test::Exception' => 0.25,
'TAP::Parser::SourceHandler::pgTAP' => 3.25,
'Test::Differences' => 0.64,
'Config::Tiny' => 2.20,
# 'Test::MockObject' => 1.20140408,
# 'Test::File' => 1.41,
},
# TODO:
# Check minimal required versions!
# this versions are set to my installed versions at writing time ...
# usually it should work with older versions of this modules, but this
# is not tested.
requires => {
'DBI' => 1.631,
'DBD::Pg' => '3.5.1',
'Moose' => 2.0401,
'MooseX::Getopt' => 0.37,
'MooseX::Types::Path::Tiny' => 0.011, # missing(??) dependency in MooseX::ConfigFromFile
'MooseX::SimpleConfig' => 0.11,
'MooseX::ConfigFromFile' => 0.04,
'Log::Log4perl' => 1.29,
'Config::General' => 2.50,
'Readonly' => 1.03,
'IO::All' => 0.84,
'File::HomeDir' => 1.00, # used by Config::FindFile
'File::ShareDir' => 1.102, # used by Config::FindFile
'JSON' => 2.90,
},
recommends => {
'App::Daemon' => 0.22,
},
# install default configs (e.g. logging.properties!) in share_dir
share_dir => {
dist => [qw(conf frontend_connectors)],
# module => {
# 'PostgreSQL::SecureMonitoring' => [ 'conf', ],
# },
},
add_to_cleanup => ['Posemo-*'],
create_makefile_pl => 'traditional',
);
# TODO:
# How to install the files in pod directory?
# Add them manually, via rscan_dir? Hmmm.
$builder->create_build_script();
=begin install Ubuntu dependencies
#
apt-get install libdbd-pg-perl \
libmoosex-simpleconfig-perl \
libmoosex-configfromfile-perl \
liblog-log4perl-perl \
libconfig-general-perl \
libreadonly-perl \
libio-all-perl \
libfile-homedir-perl \
libfile-sharedir-perl \
libconfig-tiny-perl \
libjson-perl \
libjson-xs-perl \
libapp-daemon-perl \
libmodule-build-perl
# Test Dependencies:
apt-get install libtap-parser-sourcehandler-pgtap-perl libtest-differences-perl libtest-exception-perl libtext-diff-perl libtest-deep-perl
# packaging test:
apt-get install libmodule-build-perl
cpan Module::Build::Debian
# (PROXY!)
=end
=cut