diff --git a/Makefile.PL b/Makefile.PL index 5f2d613..1c6c8f7 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -3,6 +3,22 @@ use strict; use ExtUtils::MakeMaker; use Alien::SDL; +use File::Spec; + +sub _slurp +{ + my $filename = shift; + + open my $in, '<', $filename + or die "Cannot open '$filename' for slurping - $!"; + + local $/; + my $contents = <$in>; + + close($in); + + return $contents; +} my $lib = 'betweener'; my $test = 'betweener_unit_tests'; @@ -36,6 +52,30 @@ WriteMakefile( ? (LICENSE => 'perl',) : () ), + (($ExtUtils::MakeMaker::VERSION >= 6.48) + ? ( + META_MERGE => + { + provides => { + 'SDLx::Betweener' => { + file => "lib/SDLx/Betweener.pm", + version => sub { + my $contents = _slurp(File::Spec->catfile(File::Spec->curdir, qw( lib SDLx Betweener.pm))); + if (my ($version) = ($contents =~ /^our \$VERSION = '([^']*)'/ms)) + { + return $version; + } + else + { + die "Cannot find version in file."; + } + }->(), + }, + }, + }, + ) + : () + ), # clean => {'FILES' => ''}, ); diff --git a/lib/SDLx/Betweener.pm b/lib/SDLx/Betweener.pm index 94bc30e..aa085c6 100644 --- a/lib/SDLx/Betweener.pm +++ b/lib/SDLx/Betweener.pm @@ -7,7 +7,7 @@ use Scalar::Util qw(weaken); use SDL; use SDLx::Betweener::Timeline; -our $VERSION = '0.0102'; +our $VERSION = '0.0103'; require XSLoader; XSLoader::load('SDLx::Betweener', $VERSION);