-
Notifications
You must be signed in to change notification settings - Fork 7
/
Build.PL
139 lines (133 loc) · 3.7 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
use Module::Build;
use strict;
use warnings;
my $class = Module::Build->subclass(
class => 'My::Builder',
code => q{
use File::Find;
my $have_p2m = eval "require Pod::Markdown; 1";
sub ACTION_author_tasks {
my $self = shift;
my ($action, $subaction) = @ARGV;
if ($subaction && ($subaction eq 'readme')) {
unless ($have_p2m) {
print "Don't have Pod::Markdown\n";
return;
}
# write POD as <Module>.md in relevant lib/ subdirs
find (
sub {
return unless $_ =~ /^(.*)\.pm$/;
my ($name) = $1;
die unless defined $name;
my $mdstr = '';
my $p2m = Pod::Markdown->new();
$p2m->local_module_url_prefix('github::');
$p2m->local_module_re(qr/^REST::Neo4p/);
$p2m->output_string(\$mdstr);
$p2m->parse_file($_);
$mdstr =~ s/%3A%3A/::/g;
$mdstr =~ s{(\][(]github::[^)]*[)])}
{
$_ = $1;
s|github::|/lib/|;
s|::|/|g;
s|[)]$|.md)|;
$_
}eg;
if (length $mdstr > 1) {
open my $mdf, '>', "$name.md" or die $!;
print $mdf $mdstr;
close $mdf;
}
},
File::Spec->catdir($self->base_dir,'lib')
);
}
else {
print STDERR "Valid author tasks are:\n\treadme\n";
exit 1;
}
# use the dist-version-from .pm's .md as README.md
if ($self->dist_version_from) {
my $mdf = $self->dist_version_from;
$mdf =~ s/\.pm/\.md/;
$self->copy_if_modified( from => $mdf, to => 'README.md' );
}
}
});
my $build = $class->new
( dist_name => 'REST-Neo4p',
dist_abstract => 'Perl bindings for a Neo4j graph database',
dist_version_from => 'lib/REST/Neo4p.pm',
dist_author => 'Mark A. Jensen',
license => 'perl',
requires => {
'JSON' => 2.0,
'JSON::XS' => 2.0,
'JSON::ize' => 0.202,
'HOP::Stream' => 0,
'URI::Escape' => 3.3,
'LWP::UserAgent' => 6.04,
'LWP::Protocol::https' => 6.06,
'Exception::Class' => 1.3,
'Tie::IxHash' => 0,
'experimental' => 0,
'MIME::Base64' => 0,
perl => 5.010001,
'Neo4j::Driver' => '0.26', # ServerInfo->agent
},
recommends => {
'Mojo::UserAgent' => 0,
'HTTP::Thin' => 0,
},
configure_requires => {
'Module::Build' => 0
},
build_requires => {
'Module::Build' => 0,
'Test::More' => 0,
'Test::Exception' => 0,
'Test::Warn' => 0,
'Test::NoWarnings' => 0,
'Mock::Quick' => 0,
'List::MoreUtils' => 0,
'Mojo::Exception' => 0,
'Neo4j::Driver' => '0.26', # cypher_params v2
experimental => 0,
'IPC::Run' => 0,
'IO::Pty' => 0,
},
build_recommends => {
'Test::Pod' => 1.0,
'Mojo::UserAgent' => 0,
'HTTP::Thin' => 0,
},
meta_merge => {
resources => {
bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=REST-Neo4p',
repository => 'http://github.com/majensen/rest-neo4p.git',
},
x_contributors => [
'Mark A. Jensen <[email protected]>',
'Arne Johannessen <[email protected]>',
'Keith Broughton <@keithbro>',
'Christiaan Kras <@Htbaa>',
'denixx'
]
},
perl => 5.010
);
if ($ENV{REST_NEO4P_BUILD_NONINTERACTIVE}) {
$build->notes( test_server => $ENV{REST_NEO4P_TEST_SERVER});
$build->notes( user => $ENV{REST_NEO4P_TEST_USER});
$build->notes( pass => $ENV{REST_NEO4P_TEST_PASS} );
$build->notes( agent_mod => $ENV{REST_NEO4P_AGENT_MODULE} );
}
else {
$build->notes( test_server => $build->prompt("Server for live tests:", $ENV{REST_NEO4P_TEST_SERVER} // "http://127.0.0.1:7474"));
$build->notes( user => $build->prompt("Username:", $ENV{REST_NEO4P_TEST_USER} // "") );
$build->notes( pass => $build->prompt("Pass:", $ENV{REST_NEO4P_TEST_PASS} // "") );
$build->notes( agent_mod => $build->prompt("Agent module:", $ENV{REST_NEO4P_AGENT_MODULE} // "LWP::UserAgent") );
}
$build->create_build_script;