App-ClusterSSH
view release on metacpan or search on metacpan
use strict;
use warnings;
use Cwd;
use Module::Build;
# touch README
open( my $fh, '>>', 'README' );
close($fh);
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',
coverage => 'https://coveralls.io/github/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}',
coverage => '$project_info{coverage}',
);
} . 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}
Full Changes log: $project_info{repository}/blob/release-$v/Changes
Automated Testing: $project_info{ci}
Automated test coverage: $project_info{coverage}
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;
}
sub ACTION_dist {
my ($self, @args) = @_;
print "Creating README", $/;
qx{ $^X bin_PL/cssh --generate-pod | pod2text > README };
$self->SUPER::ACTION_dist;
}
sub ACTION_clean {
my ($self, @args) = @_;
for my $file (keys %{ $self->script_files } ) {
if( -e $file) {
print "Removing '$file'",$/;
unlink $file;
}
}
$self->SUPER::ACTION_clean;
}
},
);
my $build = $class->new(
meta_merge => {
resources => {
Repository => [
#'http://clusterssh.git.sourceforge.net/',
$project_info{repository},
],
( run in 0.993 second using v1.01-cache-2.11-cpan-39bf76dae61 )