1# Makefile.PL -- Makefile for Text::Filter 2# Author : Johan Vromans 3# Last Modified By: Johan Vromans 4# Last Modified On: Thu Jan 17 13:26:26 2013 5# Update Count : 22 6# Status : Stable 7 8# Verify perl version. 9require 5.8.8; 10 11use ExtUtils::MakeMaker; 12 13my @scripts = qw(); 14 15my $x = WriteMakefile 16 ( 17 NAME => 'Text::Filter', 18 ($] >= 5.005) 19 ? (AUTHOR => 'Johan Vromans (jvromans@squirrel.nl)', 20 ABSTRACT => 'Base class for line based text processing modules', 21 ) : (), 22 VERSION_FROM => "lib/Text/Filter.pm", 23 PREREQ_PM => { 'IO::File' => 0, 24 'Test::More' => 0, 25 }, 26 # EXE_FILES => [ map { "scripts/$_" } @scripts ], 27 # *.pm files will be picked up automatically from ./lib 28 ); 29 30my $name = $x->{NAME}; 31my $version = $x->{VERSION}; 32 33my $fh; 34(my $mname = "$name") =~ s'::'-'g; 35my $fname = "perl-$mname.spec"; 36if ( open ($fh, "$fname.in") ) { 37 print "Writing RPM spec file...\n"; 38 my $newfh; 39 open ($newfh, ">$fname"); 40 while ( <$fh> ) { 41 s/%define modname .+/%define modname $mname/; 42 s/%define modversion \d+\.\d+/%define modversion $version/; 43 print $newfh $_; 44 } 45 close($newfh); 46} 47