1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
use strict;
use ExtUtils::MakeMaker;
sub parseversion
{
my $version;
open GP, 'lib/Alien/Gnuplot.pm' or die "Couldn't open lib/Alien/Gnuplot.pm";
for(<GP>){
if(m/our \$VERSION = \'([\d\.]+b?)\'/) {$version = $1;}
last if($version);
}
die "Couldn't parse version from Gnuplot.pm" unless($version);
close GP;
return $version;
}
sub MY::libscan
{
package MY;
my ($self, $file) = @_;
# Don't install the README.pod or any .pl file
return undef if $file =~ /\.pl$|^README.pod/;
return $self->SUPER::libscan ($file);
}
##############################
##############################
## Write a generic Makefile that puts the module in place. Include a postamble
## that will also make the source code, if necessary.
WriteMakefile(
NAME => 'Alien::Gnuplot',
AUTHOR => 'Craig DeForest <craig@deforest.org>',
VERSION => parseversion(),
ABSTRACT_FROM => 'lib/Alien/Gnuplot.pm',
($ExtUtils::MakeMaker::VERSION >= 6.3002
? ('LICENSE'=> 'perl')
: ()),
PREREQ_PM => { 'Time::HiRes' => 0,
'File::Temp' => 0,
'POSIX' => 0,
'File::Spec' => 0
},
META_ADD => {
resources => {
homepage => 'http://github.com/drzowie/Alien-Gnuplot',
repository => 'git://github.com/drzowie/Alien-Gnuplot.git',
bugtracker => 'craig@deforest.org'
}
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Alien-Gnuplot-* src/*[0-9]' },
);
|