Mail-IMAPClient

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

use ExtUtils::MakeMaker;
use warnings;
use strict;

use 5.008_001;

my @missing;
my %optional = (
    "Authen::NTLM"     => { for => "Authmechanism 'NTLM'" },
    "Authen::SASL"     => { for => "Authmechanism 'DIGEST-MD5'" },
    "Compress::Zlib"   => { for => "COMPRESS DEFLATE support" },
    "Digest::HMAC_MD5" => { for => "Authmechanism 'CRAM-MD5'" },
    "Digest::MD5"      => { for => "Authmechanism 'DIGEST-MD5'" },
    "IO::Socket::IP"   => { for => "IPv6 support" },
    "IO::Socket::SSL"  => { for => "SSL enabled connections (Ssl => 1)" },
    "Test::Pod"        => { for => "Pod tests", ver => "1.00" },
);

foreach my $mod ( sort keys %optional ) {
    my $for = $optional{$mod}->{"for"} || "";
    my $ver = $optional{$mod}->{"ver"} || "";
    eval "use $mod $ver ();";
    push @missing, $mod . ( $for ? " for $for" : "" ) if $@;
}

# similar message to one used in DBI:
if (@missing) {
    print( "The following optional modules were not found:",
        map( "\n\t" . $_, @missing ), "\n" );

    print <<'MSG';
Optional modules are available from any CPAN mirror, reference:
  https://metacpan.org/
  https://www.cpan.org/modules/by-module/

MSG
    sleep 3;
}

# HACK: die on broken Parse::RecDescent 1.966002 through 1.967009
# - rt.cpan.org#74593: Recent changes break Module::ExtractUse and ...
# - rt.cpan.org#74733: Fails with Parse::RecDescent >= 1.966_002
do {
    eval { require version; require Parse::RecDescent; };
    unless ($@) {
        my $found = version->parse( Parse::RecDescent->VERSION() );
        my $broke = version->parse("1.966002");
        my $fixed = version->parse("1.967009");
        if ( $found < $fixed and $found >= $broke ) {
            die(
                "Found broken Parse::RecDescent $found in your environment.\n",
                "Please upgrade to version $fixed or greater.\n"
            );
        }
    }
};

WriteMakefile(
    NAME         => 'Mail::IMAPClient',
    AUTHOR       => 'Phil Pearl (Lobbes) <plobbes+mail-imapclient@gmail.com>',
    ABSTRACT     => 'IMAP4 client library',
    VERSION_FROM => 'lib/Mail/IMAPClient.pm',
    LICENSE      => 'perl',
    META_MERGE   => {
        resources => {
            bugtracker => {
                web => 'https://github.com/plobbes/mail-imapclient/issues',
            },
            homepage   => 'https://github.com/plobbes/mail-imapclient/',
            repository => {
                url  => 'https://github.com/plobbes/mail-imapclient.git',
                web  => 'https://github.com/plobbes/mail-imapclient/',
                type => 'git',
            },
        },



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