Crypt-Keys

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

# $Id: Makefile.PL,v 1.5 2002/02/16 18:27:22 btrott Exp $

use ExtUtils::MakeMaker qw( prompt WriteMakefile );
use strict;

my %PREREQS = (
    _base => {
        'Digest::MD5'       => 0,
        'Math::Pari'        => '2.001804',
        'Data::Buffer'      => 0,
        'MIME::Base64'      => 0,
    },

    PEM   => {
        'Convert::PEM'      => '0.05',
        'Crypt::DES'        => 0,
    },

    SSH   => {
        'Crypt::CBC'        => '2.00',
        'Crypt::DES'        => 0,
    },
);

my %all;
for my $type (keys %PREREQS) {
    for my $mod (keys %{ $PREREQS{$type} }) {
        $all{$mod} = $PREREQS{$type}{$mod};
    }
}
$PREREQS{_all} = \%all;

my %prereq = %{ $PREREQS{_base} };

print<<MSG;
This is Crypt::Keys.

Crypt::Keys contains read/write routines for a variety of
public and private key algorithms; each algorithm can be
encoded in several different formats. For example, you might
have a private RSA key file, encoded in PEM format.

In order to determine the modules you'll need on your system,
you must select the types of encoding you will be using. Please
choose the encodings you'd like to use from the following list
("All" is the default).

MSG

my($i, @map) = (0);
for my $enc (keys %PREREQS) {
    next if $enc =~ /^_/;
    $map[++$i] = $enc;
    printf "    [%d] %s\n", $i, $enc;
}
$i++;
printf "    [$i] All\n";

my $p = prompt("\nEnter your choices for encoding(s), separated by spaces:", $i);
print "\n";

if ($p == $i) {
    $p = join ' ', 1..$i-1;
}

for my $id (split /\s+/, $p) {
    next if $id == $i;
    for my $mod (keys %{ $PREREQS{$map[$id]} }) {
        $prereq{$mod} = $PREREQS{$map[$id]}{$mod};
    }
}

print "\nChecking for required modules\n\n";
my(%todo, $missing);
while (my($k, $v) = each %prereq) {
    unless (check_module($k, $v, \$missing)) {
        $todo{$k} = $v;
    }
}

use Cwd;



( run in 0.724 second using v1.01-cache-2.11-cpan-39bf76dae61 )