Permalink
Browse files

- Makefile.PL now adds rules to generate a suitable META.yml to the

  generated Makefile.
  • Loading branch information...
1 parent 7a0ab1b commit 55932d2ae5c9c4f002c999f5f0292d66302af6d7 Tony Cook committed Apr 6, 2005
Showing with 54 additions and 3 deletions.
  1. +2 −0 Changes
  2. +1 −0 MANIFEST
  3. +13 −0 META.yml
  4. +33 −3 Makefile.PL
  5. +5 −0 dynfilt/Makefile.PL
View
@@ -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.
=================================================================
View
@@ -2,6 +2,7 @@ Changes
Imager.pm
Imager.xs
MANIFEST
+META.yml Module meta-data
Makefile.PL
README
bigtest.perl Library selection tester
View
@@ -0,0 +1,13 @@
+--- #YAML:1.0
+name: Imager
+version: 0.44
+version_from: Imager.pm
+author: Tony Cook <tony@imager.perl.org>, 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
View
@@ -116,9 +116,6 @@ if ($ExtUtils::MakeMaker::VERSION > 6.06) {
$opts{AUTHOR} = 'Tony Cook <tony@imager.perl.org>, 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 = <<YAML;
+--- #YAML:1.0
+name: Imager
+version: $self->{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 {
View
@@ -90,3 +90,8 @@ pure_all ::
}
}
+
+# EU::MM crashes without this when we define it in the base Makefile.PL
+sub MY::metafile {
+ '';
+}

0 comments on commit 55932d2

Please sign in to comment.