2011-01-24 16:38:01 +08:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
2011-01-24 12:12:36 +08:00
|
|
|
use ExtUtils::MakeMaker;
|
2011-01-24 16:38:01 +08:00
|
|
|
|
2011-10-17 02:46:08 +08:00
|
|
|
sub parseversion
|
|
|
|
{
|
2012-09-12 02:17:12 +08:00
|
|
|
# grab the version number from the changelog. I look for lines line
|
2011-10-24 05:53:53 +08:00
|
|
|
#
|
2012-09-12 02:17:12 +08:00
|
|
|
# libpackage-perl (0.02)
|
2011-10-24 05:53:53 +08:00
|
|
|
#
|
|
|
|
# I parse out the 0.02 part
|
2013-02-08 17:43:19 +08:00
|
|
|
open DCH, '<', 'Changes' or die "Couldn't open 'Changes'";
|
2011-11-11 16:12:35 +08:00
|
|
|
my ($version) = <DCH> =~ /^\S+ \s* \( ([0-9\.]+) \)/x
|
2012-09-12 02:17:12 +08:00
|
|
|
or die "Couldn't parse version from 'Changes'";
|
2011-10-17 02:46:08 +08:00
|
|
|
close DCH;
|
|
|
|
|
2013-02-08 17: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-10-01 02:02:18 +08:00
|
|
|
if( /VERSION = '([0-9\.]+)'/ )
|
2013-02-08 17:43:19 +08:00
|
|
|
{
|
2017-10-01 02:02:18 +08:00
|
|
|
if ( $1 ne $version )
|
2013-02-08 17: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-17 02:46:08 +08:00
|
|
|
}
|
2011-06-12 14:02:22 +08:00
|
|
|
|
|
|
|
sub MY::libscan
|
|
|
|
{
|
|
|
|
package MY;
|
|
|
|
|
|
|
|
my ($self, $file) = @_;
|
|
|
|
|
2012-09-01 02:30:24 +08:00
|
|
|
# Don't install any symlinks (i.e. README.pod)
|
|
|
|
return undef if -l $file;
|
2011-06-12 14:02:22 +08:00
|
|
|
|
|
|
|
return $self->SUPER::libscan ($file);
|
|
|
|
}
|
|
|
|
|
2012-09-11 09:55:53 +08: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-09-01 02:30:24 +08:00
|
|
|
|
2011-01-24 12:12:36 +08:00
|
|
|
WriteMakefile
|
2011-01-24 16:38:01 +08:00
|
|
|
(
|
2011-10-17 02:17:18 +08:00
|
|
|
NAME => 'feedgnuplot',
|
2011-10-17 02:46:37 +08:00
|
|
|
AUTHOR => q{Dima Kogan <dima@secretsauce.net>},
|
2011-10-17 02:46:08 +08:00
|
|
|
VERSION => parseversion(),
|
2011-01-24 16:38:01 +08:00
|
|
|
($ExtUtils::MakeMaker::VERSION >= 6.3002
|
|
|
|
? ('LICENSE' => 'perl')
|
|
|
|
: ()),
|
|
|
|
PL_FILES => {},
|
2011-10-17 02:17:18 +08:00
|
|
|
EXE_FILES => [ 'bin/feedgnuplot' ],
|
2013-12-05 12:44:54 +08:00
|
|
|
BUILD_REQUIRES => { 'String::ShellQuote' => 0,
|
2016-11-26 06:41:39 +08:00
|
|
|
'List::MoreUtils' => 0,
|
2013-12-05 12:44:54 +08:00
|
|
|
'IPC::Run' => 0},
|
2011-01-24 16:38:01 +08:00
|
|
|
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
|
2011-10-17 02:17:18 +08:00
|
|
|
clean => { FILES => 'feedgnuplot-*' },
|
2011-01-24 16:38:01 +08:00
|
|
|
);
|