Blame Makefile.PL

Packit 745572
use ExtUtils::MakeMaker;
Packit 745572
Packit 745572
BEGIN
Packit 745572
{
Packit 745572
    die "Filters needs Perl version 5.005 or better, you have $]\n"
Packit 745572
	if $] < 5.005 ;
Packit 745572
Packit 745572
    warn "Perl 5.6.0 or better is strongly recommended for Win32\n"
Packit 745572
	if $^O eq 'MSWin32' && $] < 5.006 ;
Packit 745572
}
Packit 745572
Packit 745572
use strict;
Packit 745572
Packit 745572
my @files = qw( t/filter-util.pl
Packit 745572
             Call/Call.pm 
Packit 745572
             Exec/Exec.pm 
Packit 745572
             decrypt/decrypt.pm decrypt/decr decrypt/encrypt
Packit 745572
             tee/tee.pm
Packit 745572
             lib/Filter/cpp.pm lib/Filter/exec.pm lib/Filter/sh.pm
Packit 745572
             examples/filtdef
Packit 745572
             examples/method/Count.pm
Packit 745572
             examples/method/NewSubst.pm
Packit 745572
             examples/method/UUdecode.pm
Packit 745572
             examples/method/Decompress.pm
Packit 745572
             examples/method/Joe2Jim.pm
Packit 745572
             examples/method/Subst.pm
Packit 745572
             examples/closure/Count.pm
Packit 745572
             examples/closure/NewSubst.pm
Packit 745572
             examples/closure/UUdecode.pm
Packit 745572
             examples/closure/Decompress.pm
Packit 745572
             examples/closure/Include.pm
Packit 745572
             examples/closure/Joe2Jim.pm
Packit 745572
             examples/closure/Subst.pm
Packit 745572
             examples/filtdef
Packit 745572
             examples/filtuu
Packit 745572
             t/call.t
Packit 745572
             t/cpp.t
Packit 745572
             t/decrypt.t
Packit 745572
             t/exec.t
Packit 745572
             t/order.t
Packit 745572
             t/sh.t
Packit 745572
             t/tee.t         
Packit 745572
           );
Packit 745572
             
Packit 745572
if ($] < 5.006001) { oldWarnings(@files) }
Packit 745572
# keep the src in the new-warnings style
Packit 745572
#else { newWarnings(@files) }
Packit 745572
Packit 745572
WriteMakefile
Packit 745572
  (
Packit 745572
   DISTNAME     => 'Filter',
Packit 745572
   NAME         => 'Filter::Util::Call',
Packit 745572
   VERSION_FROM => 'Call/Call.pm',
Packit 745572
   'linkext'    => {LINKTYPE => ''},
Packit 745572
   'dist'       => {COMPRESS=>'gzip', SUFFIX=>'gz',
Packit 745572
		   DIST_DEFAULT => 'tardist'},
Packit 745572
   'SIGN' => 1,
Packit 745572
   ($] >= 5.005
Packit 745572
    ? (ABSTRACT	=> 'Source Filters',
Packit 745572
       AUTHOR  	=> 'Paul Marquess <pmqs@cpan.org>')
Packit 745572
    : ()
Packit 745572
   ),
Packit 745572
Packit 745572
   INSTALLDIRS  => ($] >= 5.00703 && $] < 5.011 ? 'perl' : 'site'),
Packit 745572
Packit 745572
   ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
Packit 745572
    ('LICENSE'  => 'perl', SIGN => 1)  : ()),
Packit 745572
   ((ExtUtils::MakeMaker->VERSION() gt '6.46') ?
Packit 745572
    ('META_MERGE'  =>
Packit 745572
     {recommends =>
Packit 745572
      {
Packit 745572
	'Filter::Simple'          => '0.88',
Packit 745572
        'Filter::Simple::Compile' => '0.02',
Packit 745572
        'Test::More'        => '0.88',
Packit 745572
        'Test::Kwalitee'    => 0,
Packit 745572
        'Class::XSAccessor' => 0,
Packit 745572
        'Text::CSV_XS'      => 0,
Packit 745572
        'List::MoreUtils'   => 0,
Packit 745572
        'Pod::Spell::CommonMistakes' => 0,
Packit 745572
        'Test::Pod'         => '1.00',
Packit 745572
        'Test::CPAN::Meta'   => 0,
Packit 745572
        'Perl::MinimumVersion' => 0,
Packit 745572
      },
Packit 745572
      resources =>
Packit 745572
      {
Packit 745572
	license     => 'http://dev.perl.org/licenses/',
Packit 745572
	repository  => 'https://github.com/rurban/Filter',
Packit 745572
      }}) : ()),
Packit 745572
   clean => { FILES =>
Packit 745572
		"t/FilterTry.pm *~ "
Packit 745572
		."META.yml MYMETA.yml MYMETA.json "
Packit 745572
		."decrypt/MYMETA.yml decrypt/MYMETA.json decrypt/Makefile.old decrypt/pm_to_blib decrypt/*.c decrypt/*.o "
Packit 745572
		."tee/MYMETA.yml tee/MYMETA.json tee/Makefile.old tee/pm_to_blib tee/*.c tee/*.o "
Packit 745572
		."Exec/MYMETA.yml Exec/MYMETA.json Exec/Makefile.old Exec/pm_to_blib Exec/*.c Exec/*.o "
Packit 745572
		."Call/MYMETA.yml Call/MYMETA.json Call/Makefile.old Call/pm_to_blib Call/*.c Call/*.o"
Packit 745572
   }
Packit 745572
  );
Packit 745572
Packit 745572
sub MY::libscan
Packit 745572
{
Packit 745572
    my $self = shift ;
Packit 745572
    my $path = shift ;
Packit 745572
Packit 745572
    return undef
Packit 745572
        if $path =~ /(~|\.bak)$/ || 
Packit 745572
           $path =~ /^\..*\.swp$/ ;
Packit 745572
Packit 745572
    return $path;    
Packit 745572
}
Packit 745572
Packit 745572
#sub MY::postamble 
Packit 745572
#{
Packit 745572
#	'
Packit 745572
#
Packit 745572
#MyDoubleCheck:	
Packit 745572
#	@echo Checking for $$^W in files
Packit 745572
#	@perl -ne \'						\
Packit 745572
#	    exit 1 if /^\s*local\s*\(\s*\$$\^W\s*\)/;		\
Packit 745572
#         \' ' . " @files || " . '				\
Packit 745572
#	(echo found unexpected $$^W ; exit 1)
Packit 745572
#	@echo All is ok.
Packit 745572
#
Packit 745572
#' ;
Packit 745572
#}
Packit 745572
Packit 745572
sub oldWarnings
Packit 745572
{
Packit 745572
    local ($^I) = ".bak" ;
Packit 745572
    local (@ARGV) = @_ ;
Packit 745572
Packit 745572
    while (<>)
Packit 745572
    {
Packit 745572
	if (/^__END__/)
Packit 745572
	{
Packit 745572
	    print ;
Packit 745572
	    my $this = $ARGV ;
Packit 745572
    	    while (<>)
Packit 745572
	    {
Packit 745572
		last if $ARGV ne $this ;
Packit 745572
		print ;
Packit 745572
	    }
Packit 745572
	}
Packit 745572
Packit 745572
	s/^(\s*)(no\s+warnings)/${1}local (\$^W) = 0; #$2/ ;
Packit 745572
	s/^(\s*)(use\s+warnings)/${1}local (\$^W) = 1; #$2/ ;
Packit 745572
	print ;
Packit 745572
    }
Packit 745572
}
Packit 745572
Packit 745572
sub newWarnings
Packit 745572
{
Packit 745572
    local ($^I) = ".bak" ;
Packit 745572
    local (@ARGV) = @_ ;
Packit 745572
Packit 745572
    while (<>)
Packit 745572
    {
Packit 745572
	if (/^__END__/)
Packit 745572
	{
Packit 745572
	    my $this = $ARGV ;
Packit 745572
	    print ;
Packit 745572
    	    while (<>)
Packit 745572
	    {
Packit 745572
		last if $ARGV ne $this ;
Packit 745572
		print ;
Packit 745572
	    }
Packit 745572
	}
Packit 745572
Packit 745572
	s/^(\s*)local\s*\(\$\^W\)\s*=\s*\d+\s*;\s*#\s*((no|use)\s+warnings.*)/$1$2/ ;
Packit 745572
	print ;
Packit 745572
    }
Packit 745572
}