feedgnuplot/Makefile.PL

60 lines
1.7 KiB
Makefile
Raw Normal View History

2011-01-24 16:38:01 +08:00
use strict;
use warnings;
use ExtUtils::MakeMaker;
2011-01-24 16:38:01 +08:00
sub parseversion
{
# grab the version number from the debian changelog file. I look for lines line
#
# libpackage-perl (0.02) unstable; urgency=low
#
# I parse out the 0.02 part
open DCH, 'debian/changelog' or die "Couldn't open debian/changelog";
my ($version) = <DCH> =~ /^\S+ \s* \( ([0-9\.]+) \)/x
or die "Couldn't parse version from debian/changelog";
close DCH;
return $version;
}
sub MY::libscan
{
package MY;
my ($self, $file) = @_;
# Don't install the README.pod or any non-feedgnuplot .pl file
return undef if $file !~ /feedgnuplot.pl/ && $file =~ /\.pl$|^README.pod/;
return $self->SUPER::libscan ($file);
}
WriteMakefile
2011-01-24 16:38:01 +08:00
(
NAME => 'feedgnuplot',
2011-10-17 02:46:37 +08:00
AUTHOR => q{Dima Kogan <dima@secretsauce.net>},
VERSION => parseversion(),
ABSTRACT_FROM => 'bin/feedgnuplot',
2011-01-24 16:38:01 +08:00
($ExtUtils::MakeMaker::VERSION >= 6.3002
? ('LICENSE' => 'perl')
: ()),
PL_FILES => {},
EXE_FILES => [ 'bin/feedgnuplot' ],
2011-02-07 07:54:18 +08:00
PREREQ_PM => { 'Test::Script::Run' => 0},
2011-01-24 16:38:01 +08:00
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'feedgnuplot-*' },
2011-01-24 16:38:01 +08:00
);
# reroute the main POD into a separate README.pod if requested. This is here
# purely to generate a README.pod for the github front page
if(exists $ARGV[0] && $ARGV[0] eq 'README.pod')
{
open SCRIPT, 'bin/feedgnuplot' or die "Couldn't open main script";
open README, '>README.pod' or die "Couldn't open README.pod";
while (<SCRIPT>)
{
if (/^=/../^=cut/)
{ print README; }
}
}