1use ExtUtils::MakeMaker; 2use Config; 3 4my $pkg = 'Net::DNSBL::Statistics'; 5$pkg =~ /[^:]+$/; 6my $module = $& .'.pm'; 7 8# See lib/ExtUtils/MakeMaker.pm for details of how to influence 9# the contents of the Makefile that is written. 10 11WriteMakefile( 12 'NAME' => $pkg, 13 'VERSION_FROM' => $module, # finds $VERSION 14 'PREREQ_PM' => { Net::DNS::Codes => 0.09, 15 Net::DNS::ToolKit => 0.41, 16 Net::DNSBL::MultiDaemon => 0.26, 17 Test::More => 0, 18 }, 19 'clean' => { FILES => "*~ tmp*"}, 20 'dist' => {COMPRESS=>'gzip', SUFFIX=>'gz'} 21); 22 23sub MY::top_targets { 24 package MY; 25 my $inherited = shift->SUPER::top_targets(@_); 26 $inherited =~ s/(pure_all\s+::.+)/$1 README/; 27 $inherited; 28} 29 30sub MY::post_constants { 31 my $post_constants = $Config{scriptdirexp} .'/pod2text'; 32 if (-e $post_constants) { 33 $post_constants = q| 34MY_POD2TEXT = |. $post_constants .q| 35|; 36 } else { 37 $post_constants = q| 38MY_POD2TEXT = echo "perl distro missing 'pod2text' to convert " |; 39 } 40} 41 42sub MY::postamble { 43 package MY; 44 my $postamble = q| 45README : |. $module .q| 46 @$(MY_POD2TEXT) |. $module .q| > README 47 48|; 49} 50