Blame Makefile.PL

Packit 258f23
use ExtUtils::MakeMaker;
Packit 258f23
Packit 258f23
# Calculate the dependencies
Packit 258f23
my %PREREQ_PM;
Packit 258f23
if ( $^O ne 'MSWin32' ) {
Packit 258f23
    foreach ( eval { require IO::Pty; IO::Pty->VERSION } ) {
Packit 258f23
        s/_//g if defined $_;
Packit 258f23
        unless ( defined $_ ) {
Packit 258f23
            warn("WARNING: \"IO::Pty not found\".\nWARNING: '<pty<', '>pty>' will not work.\n\n");
Packit 258f23
            last;
Packit 258f23
        }
Packit 258f23
        $PREREQ_PM{'IO::Pty'} = '1.08';
Packit 258f23
    }
Packit 258f23
}
Packit 258f23
else {
Packit 258f23
    $PREREQ_PM{'Win32::Process'} = '0.14';
Packit 258f23
    $PREREQ_PM{'Win32API::File'} = '0.0901';
Packit 258f23
    if ( $] >= 5.021006 ) {
Packit 258f23
        $PREREQ_PM{'Win32API::File'} = '0.1203';
Packit 258f23
    }
Packit 258f23
    if ( !eval "use Socket qw( IPPROTO_TCP TCP_NODELAY ); 1" ) {
Packit 258f23
        warn <<"TOHERE";
Packit 258f23
$@
Packit 258f23
IPC::Run on Win32 requires a recent Sockets.pm in order to handle more
Packit 258f23
complex interactions with subprocesses.  They are not needed for most
Packit 258f23
casual uses of run(), but it is impossible to tell whether all uses of
Packit 258f23
IPC::Run in your installed modules meet the requirements, so IPC::Run
Packit 258f23
should not be installed on Win32 machines with older perls.
Packit 258f23
Packit 258f23
TOHERE
Packit 258f23
Packit 258f23
        ## Die nicely in case some install manager cares about the canonical
Packit 258f23
        ## error message for this.  Not that I've ever seen one, but those
Packit 258f23
        ## wacky CPANPLUSers might just do something cool in this case.
Packit 258f23
        ## Older perls' Socket.pm don't export IPPROTO_TCP
Packit 258f23
        require 5.006;
Packit 258f23
        ## Most of the time it's not needed (since IPC::Run tries not to
Packit 258f23
        ## use sockets), but the user is not likely to know what the hell
Packit 258f23
        ## went wrong running sb. else's program.
Packit 258f23
Packit 258f23
        ## If something really odd is happening...
Packit 258f23
        exit 1;
Packit 258f23
    }
Packit 258f23
}
Packit 258f23
Packit 258f23
if ( $] < 5.008001 ) {
Packit 258f23
Packit 258f23
    # need Scalar::Util::looks_like_number
Packit 258f23
    $PREREQ_PM{'Scalar::List::Utils'} = '1.10';
Packit 258f23
}
Packit 258f23
Packit 258f23
WriteMakefile(
Packit 258f23
    NAME         => 'IPC::Run',
Packit 258f23
    ABSTRACT     => 'system() and background procs w/ piping, redirs, ptys (Unix, Win32)',
Packit 258f23
    AUTHOR       => 'Barrie Slaymaker <barries@slaysys.com>',
Packit 258f23
    VERSION_FROM => 'lib/IPC/Run.pm',
Packit 258f23
    ( $ExtUtils::MakeMaker::VERSION >= 6.3002 ? ( 'LICENSE' => 'perl', ) : () ),
Packit 258f23
    PREREQ_PM => {
Packit 258f23
        Test::More => '0.47',
Packit 258f23
        %PREREQ_PM,
Packit 258f23
    },
Packit 258f23
    dist       => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
Packit 258f23
    clean      => { FILES    => 'IPC-Run-*' },
Packit 258f23
    META_MERGE => {
Packit 258f23
        recommends => {
Packit 258f23
            'IO::Pty' => '1.08',
Packit 258f23
        },
Packit 258f23
        build_requires => {
Packit 258f23
            'Test::More'      => 0,    # For testing
Packit 258f23
            'Readonly'        => 0,
Packit 258f23
            'Readonly::Array' => 0,
Packit 258f23
        },
Packit 258f23
        resources => {
Packit 258f23
            license    => 'http://dev.perl.org/licenses/',
Packit 258f23
            bugtracker => 'https://github.com/toddr/IPC-Run/issues',
Packit 258f23
            repository => 'https://github.com/toddr/IPC-Run',
Packit 258f23
        }
Packit 258f23
    }
Packit 258f23
);
Packit 258f23
Packit 258f23
sub MY::libscan {
Packit 258f23
Packit 258f23
    package MY;
Packit 258f23
    my $self = shift;
Packit 258f23
    my ($path) = @_;
Packit 258f23
    return '' if $path =~ m/\.sw[a-z]\z/msx;
Packit 258f23
    return '' unless length $self->SUPER::libscan($path);
Packit 258f23
    return $path;
Packit 258f23
}