# $Id: Makefile.PL,v 1.19 2006/07/18 21:20:12 jv Exp $ use Config; use ExtUtils::MakeMaker 5.0; use lib "./lib"; use Getopt::Long; my $version = $Getopt::Long::VERSION_STRING || $Getopt::Long::VERSION; my $leave_alone = 1; sub MY::postamble { my $ret = ""; my $mandir = $Config{installman3dir}; my $obsolete = "$mandir/Getopt::GetoptLong.3"; if ( -e $obsolete ) { print STDERR (< "Getopt::Long", VERSION => $version, ( $] < 5.005 ) ? () : ( AUTHOR => 'Johan Vromans (jvromans@squirrel.nl)', ABSTRACT => 'Module to handle parsing command line options', ), PM => { "lib/newgetopt.pl" => '$(INST_LIB)/newgetopt.pl', "lib/Getopt/Long.pm" => '$(INST_LIB)/Getopt/Long.pm', }, dist => { COMPRESS => 'gzip', SUFFIX => 'gz', }, PREREQ_PM => { "Pod::Usage" => 1.14 }, ); # Write .spec file. # Note that $x->{...} is not supported in older Perls. WriteSpecfile($x->{DISTNAME}, $x->{VERSION}) if $] >= 5.008; sub WriteSpecfile { my $name = shift; my $version = shift; if ( open (FH, "rpm/$name.spec.in") ) { print "Writing RPM spec file...\n"; open (NEWFH, ">perl-$name.spec"); while ( ) { s/%define modname [\w---]+/%define modname $name/; s/%define modversion \d+\.\d+/%define modversion $version/; print NEWFH $_; } close(NEWFH); close(FH); } }