From 55932d2ae5c9c4f002c999f5f0292d66302af6d7 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Wed, 6 Apr 2005 11:36:29 +0000 Subject: [PATCH] - Makefile.PL now adds rules to generate a suitable META.yml to the generated Makefile. --- Changes | 2 ++ MANIFEST | 1 + META.yml | 13 +++++++++++++ Makefile.PL | 36 +++++++++++++++++++++++++++++++++--- dynfilt/Makefile.PL | 5 +++++ 5 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 META.yml diff --git a/Changes b/Changes index 0088540d..2c156342 100644 --- a/Changes +++ b/Changes @@ -1044,6 +1044,8 @@ Revision history for Perl extension Imager. - Imager::Cookbook wasn't included in the MANIFEST - added samp-form.cgi and samp-image.cgi to the samples directory to demonstrate displaying a generated image on a HTML page. +- Makefile.PL now adds rules to generate a suitable META.yml to the + generated Makefile. ================================================================= diff --git a/MANIFEST b/MANIFEST index 7c7dc827..aa00c1a2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2,6 +2,7 @@ Changes Imager.pm Imager.xs MANIFEST +META.yml Module meta-data Makefile.PL README bigtest.perl Library selection tester diff --git a/META.yml b/META.yml new file mode 100644 index 00000000..7869fa51 --- /dev/null +++ b/META.yml @@ -0,0 +1,13 @@ +--- #YAML:1.0 +name: Imager +version: 0.44 +version_from: Imager.pm +author: Tony Cook , Arnar M. Hrafnkelsson +abstract: Perl extension for Generating 24 bit Images +installdirs: site +recommends: + Parse::RecDescent: 0 +license: perl +dynamic_config: 1 +distribution_type: module +generated_by: Imager version 0.44 diff --git a/Makefile.PL b/Makefile.PL index 444842d4..32013b8e 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -116,9 +116,6 @@ if ($ExtUtils::MakeMaker::VERSION > 6.06) { $opts{AUTHOR} = 'Tony Cook , Arnar M. Hrafnkelsson'; $opts{ABSTRACT} = 'Perl extension for Generating 24 bit Images'; } -if ($ExtUtils::MakeMaker::VERSION > 6.10) { - $opts{NO_META} = 1; -} make_imconfig(\@defines); @@ -144,6 +141,39 @@ imconfig.h: Makefile.PL '; } +sub MY::metafile { + my ($self) = @_; + + my $meta = <{VERSION} +version_from: $self->{VERSION_FROM} +author: $self->{AUTHOR} +abstract: $self->{ABSTRACT} +installdirs: $self->{INSTALLDIRS} +recommends: + Parse::RecDescent: 0 +license: perl +dynamic_config: 1 +distribution_type: module +generated_by: Imager version $self->{VERSION} +YAML + + my @write; + if ($self->can('echo')) { + # use EU::MM's version where possible, hopefully it's portable + @write = $self->echo($meta, 'META.yml'); + } + else { + my @lines = split /\n/, $meta; + @lines = map qq{"$_"}, @lines; + push @write, "\${ECHO} ".shift(@lines)." >META.yml"; + push @write, map { "\${ECHO} $_ >>META.yml" } @lines; + } + return sprintf "metafile :\n\t%s\n", join "\n\t", @write; +} + # manual configuration of helper libraries sub manual { diff --git a/dynfilt/Makefile.PL b/dynfilt/Makefile.PL index fa2fe397..2141dd90 100644 --- a/dynfilt/Makefile.PL +++ b/dynfilt/Makefile.PL @@ -90,3 +90,8 @@ pure_all :: } } + +# EU::MM crashes without this when we define it in the base Makefile.PL +sub MY::metafile { + ''; +} -- 2.39.5