Net-SSH-Perl
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
=encoding utf8
=head1 The build file for Net::SSH::Perl
This build file is a modulino; it works as both a build script and
a module.
To build the distribution, run this file normally:
% perl Makefile.PL
But, it's more interesting than that. You can load it with C<require>
and call C<arguments> to get the data structure it passes to
C<WriteMakefile>:
my $package = require '/path/to/Makefile.PL';
my $arguments = $package->arguments;
Note that C<require>-ing a file makes an entry in C<%INC> for exactly
that name. If you try to C<require> another file with the same name,
even from a different path, C<require> thinks it has already loaded
the file. As such, I recommend you always require the full path to the
file.
The return value of the C<require> is a package name (in this case,
the name of the main module. Use that to call the C<arguments> method.
Even if this distribution needs a higher version of Perl, this bit
only needs v5.8. You can play with the data structure with a primitive
Perl.
=cut
use 5.006;
package Net::SSH::Perl;
use strict;
use warnings;
use ExtUtils::MakeMaker qw(prompt WriteMakefile);
my %prereq = (
'IO::Socket' => 0,
'File::Spec' => 0,
'File::HomeDir' => 0,
);
my %SSH_PREREQ = (
1 => {
'Digest::MD5' => 0,
'String::CRC32' => '1.2',
'Math::GMP' => '1.04',
'Scalar::Util' => 0,
'Crypt::IDEA' => 0,
},
2 => {
'CryptX' => '0.032',
'Crypt::Curve25519' => '0.05',
},
);
$SSH_PREREQ{3} = { map %{$SSH_PREREQ{$_}}, 1..2 };
my $p = do {
if( caller ) { 3 }
else {
prompt_for_protocol();
}
};
@prereq{keys %{$SSH_PREREQ{$p}}} = values %{$SSH_PREREQ{$p}};
if( caller ) { $prereq{'Digest::BubbleBabble'} = '0.01' }
else {
print "Checking for optional modules\n\n";
( run in 1.418 second using v1.01-cache-2.11-cpan-39bf76dae61 )