1use ExtUtils::MakeMaker; 2 3$ENV{CLAMD_PATH} ||= -e "/usr/local/sbin/clamd" ? 4 "/usr/local/sbin" : -e "/usr/sbin/clamd" ? 5 "/usr/sbin" : -e "/usr/local/bin/clamd" ? 6 "/usr/local/bin" : -e "/usr/bin/clamd" ? 7 "/usr/bin" : "$ENV{HOME}/bin"; 8 9my $help = `$ENV{CLAMD_PATH}/clamd --help 2>&1` || ''; 10if ($help !~ /clam/i) { 11 die "Cannot find clamd in $ENV{CLAMD_PATH} (or a number of other places)\n - are you sure clamav in installed?\n"; 12} 13 14WriteMakefile( 15 'NAME' => 'File::Scan::ClamAV', 16 'VERSION_FROM' => 'lib/File/Scan/ClamAV.pm', 17 'PREREQ_PM' => {}, 18 'ABSTRACT' => 'A simple interface to the Clam Anti-Virus system', 19 'AUTHOR' => 'Colin Faber <cfaber@fpsn.net>', 20 'LICENSE' => 'perl_5', 21 'MIN_PERL_VERSION' => 5.006, 22 'META_MERGE' => { 23 'resources' => { 24 'repository' => 'https://github.com/smith153/File-Scan-ClamAV', 25 }, 26 }, 27); 28 29sub MY::test { 30 package MY; 31 my $self = shift; 32 my $make = $self->SUPER::test(); 33 $make =~ s/PERL_DL_NONLAZY=1/PERL_DL_NONLAZY=1 CLAMD_PATH=$ENV{CLAMD_PATH}/g; 34 return $make; 35} 36 37