# This Makefile.PL for POE-Component-Server-NSCA was generated by
# Dist::Zilla::Plugin::MakeMaker::Awesome 0.48.
# Don't edit it but the dist.ini and plugins used to construct it.

use strict;
use warnings;

use ExtUtils::MakeMaker;

my %WriteMakefileArgs = (
  "ABSTRACT" => "a POE Component that implements NSCA daemon functionality",
  "AUTHOR" => "Chris Williams <chris\@bingosnet.co.uk>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "POE-Component-Server-NSCA",
  "LICENSE" => "perl",
  "NAME" => "POE::Component::Server::NSCA",
  "PREREQ_PM" => {
    "Math::Random" => "0.7",
    "Net::Netmask" => "1.9015",
    "POE" => "0.38",
    "POE::Component::Client::NSCA" => "0.06",
    "POE::Filter::Stream" => 0,
    "POE::Wheel::ReadWrite" => 0,
    "POE::Wheel::SocketFactory" => 0
  },
  "TEST_REQUIRES" => {
    "File::Spec" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,
    "Test::More" => "0.47"
  },
  "VERSION" => "0.12",
  "test" => {
    "TESTS" => "t/*.t"
  }
);

%WriteMakefileArgs = (
    %WriteMakefileArgs,
    clean => {FILES => "send_nsca.tests"},
);

my %FallbackPrereqs = (
  "File::Spec" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "Math::Random" => "0.7",
  "Net::Netmask" => "1.9015",
  "POE" => "0.38",
  "POE::Component::Client::NSCA" => "0.06",
  "POE::Filter::Stream" => 0,
  "POE::Wheel::ReadWrite" => 0,
  "POE::Wheel::SocketFactory" => 0,
  "Test::More" => "0.47"
);

# inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.039
if (prompt_default_no('Do you want encryption ( requires Mcrypt )')) {
requires( 'Mcrypt' => '2.5.7.0' );
}

unless ( eval { ExtUtils::MakeMaker->VERSION('6.63_03') } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};
  delete $WriteMakefileArgs{BUILD_REQUIRES};
  $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}

delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };

WriteMakefile(%WriteMakefileArgs);

my $send_nsca = prompt( 'Specify the path to the "send_nsca" program (leave blank to skip) []?', '' );
if ( $send_nsca and -e $send_nsca ) {
  open FH, "> send_nsca.tests" or die "$!\n";
  print FH "$send_nsca\n";
  close FH;
}

# inserted by Dist::Zilla::Plugin::DynamicPrereqs 0.039
sub _add_prereq {
  my ($mm_key, $module, $version_or_range) = @_;
  $version_or_range ||= 0;
  warn "$module already exists in $mm_key (at version $WriteMakefileArgs{$mm_key}{$module}) -- need to do a sane metamerge!"
    if exists $WriteMakefileArgs{$mm_key}{$module}
      and $WriteMakefileArgs{$mm_key}{$module} ne '0'
      and $WriteMakefileArgs{$mm_key}{$module} ne $version_or_range;
  warn "$module already exists in FallbackPrereqs (at version $FallbackPrereqs{$module}) -- need to do a sane metamerge!"
    if exists $FallbackPrereqs{$module} and $FallbackPrereqs{$module} ne '0'
        and $FallbackPrereqs{$module} ne $version_or_range;
  $WriteMakefileArgs{$mm_key}{$module} = $FallbackPrereqs{$module} = $version_or_range;
  return;
}

sub prompt_default_no {
  prompt("$_[0] [y/N]", 'N') =~ /^y/i ? 1 :0;
}

sub requires { goto &runtime_requires }

sub runtime_requires {
  my ($module, $version_or_range) = @_;
  _add_prereq(PREREQ_PM => $module, $version_or_range);
}