2011-01-24 00:38:01 -08:00
|
|
|
use strict;
|
|
|
|
|
use warnings;
|
2011-01-23 20:12:36 -08:00
|
|
|
use ExtUtils::MakeMaker;
|
2011-01-24 00:38:01 -08:00
|
|
|
|
2011-10-16 11:46:08 -07:00
|
|
|
sub parseversion
|
|
|
|
|
{
|
2012-09-11 11:17:12 -07:00
|
|
|
# grab the version number from the changelog. I look for lines line
|
2011-10-23 14:53:53 -07:00
|
|
|
#
|
2012-09-11 11:17:12 -07:00
|
|
|
# libpackage-perl (0.02)
|
2011-10-23 14:53:53 -07:00
|
|
|
#
|
|
|
|
|
# I parse out the 0.02 part
|
2013-02-08 01:43:19 -08:00
|
|
|
open DCH, '<', 'Changes' or die "Couldn't open 'Changes'";
|
2011-11-11 00:12:35 -08:00
|
|
|
my ($version) = <DCH> =~ /^\S+ \s* \( ([0-9\.]+) \)/x
|
2012-09-11 11:17:12 -07:00
|
|
|
or die "Couldn't parse version from 'Changes'";
|
2011-10-16 11:46:08 -07:00
|
|
|
close DCH;
|
|
|
|
|
|
2013-02-08 01:43:19 -08:00
|
|
|
# The version is also stored in the script itself. Here I extract that version
|
|
|
|
|
# number and make sure the two match
|
|
|
|
|
open PL, '<', 'bin/feedgnuplot' or die "Couldn't open 'bin/feedgnuplot'";
|
|
|
|
|
|
|
|
|
|
while(<PL>)
|
|
|
|
|
{
|
2017-09-30 11:02:18 -07:00
|
|
|
if( /VERSION = '([0-9\.]+)'/ )
|
2013-02-08 01:43:19 -08:00
|
|
|
{
|
2017-09-30 11:02:18 -07:00
|
|
|
if ( $1 ne $version )
|
2013-02-08 01:43:19 -08:00
|
|
|
{
|
|
|
|
|
die "Version mismatch. Changes says version is '$version', but 'bin/feedgnuplot' says it is '$1'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $version;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
die "Couldn't parse version from 'bin/feedgnuplot'";
|
2011-10-16 11:46:08 -07:00
|
|
|
}
|
2011-06-11 23:02:22 -07:00
|
|
|
|
|
|
|
|
sub MY::libscan
|
|
|
|
|
{
|
|
|
|
|
package MY;
|
|
|
|
|
|
|
|
|
|
my ($self, $file) = @_;
|
|
|
|
|
|
2012-08-31 11:30:24 -07:00
|
|
|
# Don't install any symlinks (i.e. README.pod)
|
|
|
|
|
return undef if -l $file;
|
2011-06-11 23:02:22 -07:00
|
|
|
|
|
|
|
|
return $self->SUPER::libscan ($file);
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-10 18:55:53 -07:00
|
|
|
# I want my manpage to go into the man section '1', NOT '1p'. Here I add a
|
|
|
|
|
# snippet to the end of the generated Makefile to force this
|
|
|
|
|
sub MY::postamble
|
|
|
|
|
{
|
|
|
|
|
return "MAN1EXT := 1\n";
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-31 11:30:24 -07:00
|
|
|
|
2011-01-23 20:12:36 -08:00
|
|
|
WriteMakefile
|
2011-01-24 00:38:01 -08:00
|
|
|
(
|
2011-10-16 11:17:18 -07:00
|
|
|
NAME => 'feedgnuplot',
|
2011-10-16 11:46:37 -07:00
|
|
|
AUTHOR => q{Dima Kogan <dima@secretsauce.net>},
|
2011-10-16 11:46:08 -07:00
|
|
|
VERSION => parseversion(),
|
2011-01-24 00:38:01 -08:00
|
|
|
($ExtUtils::MakeMaker::VERSION >= 6.3002
|
|
|
|
|
? ('LICENSE' => 'perl')
|
|
|
|
|
: ()),
|
|
|
|
|
PL_FILES => {},
|
2011-10-16 11:17:18 -07:00
|
|
|
EXE_FILES => [ 'bin/feedgnuplot' ],
|
2013-12-04 20:44:54 -08:00
|
|
|
BUILD_REQUIRES => { 'String::ShellQuote' => 0,
|
2016-11-25 14:41:39 -08:00
|
|
|
'List::MoreUtils' => 0,
|
2013-12-04 20:44:54 -08:00
|
|
|
'IPC::Run' => 0},
|
2011-01-24 00:38:01 -08:00
|
|
|
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
|
2011-10-16 11:17:18 -07:00
|
|
|
clean => { FILES => 'feedgnuplot-*' },
|
2011-01-24 00:38:01 -08:00
|
|
|
);
|