]> git.imager.perl.org - imager.git/commitdiff
- Makefile.PL now adds rules to generate a suitable META.yml to the
authorTony Cook <tony@develop=help.com>
Wed, 6 Apr 2005 11:36:29 +0000 (11:36 +0000)
committerTony Cook <tony@develop=help.com>
Wed, 6 Apr 2005 11:36:29 +0000 (11:36 +0000)
  generated Makefile.

Changes
MANIFEST
META.yml [new file with mode: 0644]
Makefile.PL
dynfilt/Makefile.PL

diff --git a/Changes b/Changes
index 0088540d0b9efc4c3f37af53c26e80f1be3f00d1..2c15634291d0fdb9ded07ffa1be4639aaab42f9b 100644 (file)
--- 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.
 
 =================================================================
 
index 7c7dc827cacfccd03141704c819e5cc926f320bd..aa00c1a2c9cc5df50bd05b5ee1b006c1e74e62d1 100644 (file)
--- 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 (file)
index 0000000..7869fa5
--- /dev/null
+++ b/META.yml
@@ -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
index 444842d44254432972805ab0ef20a59697168cf5..32013b8ed9136d24ffb4d82650a28b5287804b97 100644 (file)
@@ -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 {
index fa2fe397ba2c9ec137f7da2ec62eb5ac99af7269..2141dd90a125d068a791c273a02dcf7c499ea8f8 100644 (file)
@@ -90,3 +90,8 @@ pure_all ::
 
 }
 }
+
+# EU::MM crashes without this when we define it in the base Makefile.PL
+sub MY::metafile {
+  '';
+}