forked from duncs/clusterssh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.PL
129 lines (115 loc) · 4 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
use strict;
use warnings;
use Cwd;
use Module::Build;
my %project_info = (
tracker => 'https://github.com/duncs/clusterssh/issues',
repository => 'http://github.com/duncs/clusterssh',
homepage => 'http://github.com/duncs/clusterssh/wiki',
ci => 'https://travis-ci.org/duncs/clusterssh',
);
my $class = Module::Build->subclass(
class => "Module::Build::Custom",
code => qq{
my \%project_info = (
tracker => '$project_info{tracker}',
homepage => '$project_info{homepage}',
repository => '$project_info{repository}',
ci => '$project_info{ci}',
);
} . q{
# don't check for errors; 'build_requires' should get this sorted
eval {
require File::Slurp;
require CPAN::Changes;
};
sub ACTION_email {
my ($self, @args) = @_;
# Make sure all tests pass first
$self->depends_on("test");
print "Use '--changes <N>' to define how many to output. Default: 1", $/;
my $change_count = $self->args('changes') || 1;
my @changes = CPAN::Changes->load( 'Changes' )->releases;
if($changes[-1]->date =~ m/^0000/) {
die '#' x 40, $/, ' ' x 3, "FATAL: 'Changes' date not updated",$/,'#' x 40, $/;
}
print $/;
print 'Subject: ClusterSSH ', $self->dist_version, ' release', $/;
print $/;
foreach my $change ( 1 .. $change_count ) {
print $changes[ 0 - $change]->serialize;
}
my $v=$self->dist_version;
print <<"EOF";
==========
Home page: $project_info{homepage},
Bug Reports and Issues: $project_info{tracker}
Project Repository: $project_info{repository}
Automated Testing: $project_info{ci}
CPAN release: http://search.cpan.org/~duncs/App-ClusterSSH-$v
SF release: http://sourceforge.net/projects/clusterssh/files/2.%20ClusterSSH%20Series%204/App-ClusterSSH-${v}.tar.gz/download
==========
EOF
return $self;
}
},
);
my $build = $class->new(
meta_merge => {
resources => {
Repository => [
'http://clusterssh.git.sourceforge.net/',
$project_info{repository},
],
bugtracker => $project_info{tracker},
homepage => $project_info{homepage},
},
},
module_name => 'App::ClusterSSH',
license => 'perl',
dist_author => q{Duncan Ferguson <[email protected]>},
dist_version_from => 'lib/App/ClusterSSH.pm',
requires => {
'version' => '0',
'Tk' => '800.022',
'X11::Protocol' => '0.56',
'X11::Protocol::WM' => '0',
'Locale::Maketext' => 0,
'Exception::Class' => '1.31',
'Try::Tiny' => 0,
'Getopt::Long' => 0,
'File::Path' => 0,
'File::Glob' => 0,
},
build_requires => {
'Test::Pod::Coverage' => 0,
'Test::Pod' => 0,
'Test::Trap' => 0,
'Readonly' => 0,
'File::Which' => 0,
'File::Temp' => 0,
'Test::DistManifest' => 0,
'Test::Differences' => 0,
'CPAN::Changes' => 0.27,
'File::Slurp' => 0,
'Test::PerlTidy' => 0,
},
recommends => { 'Sort::Naturally' => 0, },
configure_requires => { 'Module::Build' => 0, },
add_to_cleanup => ['App-ClusterSSH-*'],
create_makefile_pl => 'traditional',
script_files => [
'bin/cssh', 'bin/csftp',
'bin/ccon', 'bin/crsh',
'bin/ctel', 'bin/clusterssh_bash_completion.dist'
],
get_options => { changes => { type => '=s' }, },
PL_files => {
'bin_PL/_build_docs' => [
'bin/cssh', 'bin/csftp',
'bin/ccon', 'bin/crsh',
'bin/ctel', 'bin/clusterssh_bash_completion.dist'
],
},
);
$build->create_build_script;