#!/usr/bin/perl

$download = "/home/Natura/download";
if($x = `egrep 'makedist>(.*)<' CAT`) {
     if($x =~ m{makedist>(.*?)<}) 
       {$x=$1}
     die if  system($x);
     system("cp `ls -tr1 *gz | head -1` $download/");
  }
elsif (`grep '>m�dulo perl<' CAT`){
  die if system("perl Makefile.PL && make dist ") ;
  system("cp `ls -tr1 *gz | head -1` $download/"); }
elsif( -f "Makefile.PL") {
  die if system("perl Makefile.PL && make dist ") ;
  system("cp `ls -tr1 *gz | head -1` $download/"); }
elsif( -f "Makefile" || -f "makefile") {
  system("make dist") and system("make tgz") and die("please insert a make dist..."); 
  system("cp `ls -tr1 *gz | head -1` $download/"); }
else {
  print "?????" }