-----BEGIN PGP SIGNED MESSAGE-----

Moin,

this question came up because search.cpan.org was not including an 
ABSTRACT for some packages of mine (tar.gz without modules), even when I 
did put an ABSTRACT into Makefile.PL or an "abstract" into META.YML.

Graham said that search.cpan.org should probably be updated to use 
META.yml. However, this now poses the question on how to get the abstract 
into META.yml. 

Unfortunately, the META spec:

        http://module-build.sourceforge.net/META-spec.html

does not have an "abstract" field.

I think it should and MakeMaker should add the abstract automatically when 
it creates META.yml.

My current Makefile.PL looks like the one below.

Best wishes,

Tels

###########################################################
use 5.006001;
use ExtUtils::MakeMaker;

sub MY::metafile {
  package MY;
  my $self = shift;
  if (!eval { require YAML; 1 })
  {
    warn ("YAML not installed, 'make dist' will not override 
'META.yml'.");
    return $self->SUPER::metafile_target(@_);
  };

  my $node = new YAML::Node {};

  $node->{name}                 = $self->{DISTNAME};
  $node->{abstract}             = $self->{ABSTRACT};
  $node->{version}              = $self->{VERSION};
  $node->{version_from}         = $self->{VERSION_FROM};
  $node->{license}              = 'gpl';
  $node->{distribution_type}    = 'module';
  $node->{generated_by}         = "$self->{DISTNAME} version 
$self->{VERSION}";
  $node->{installdirs}          = 'site';
  $node->{requires}             = $self->{PREREQ_PM};

  my $dump = YAML::Dump( $node );

  $dump =~ s/^(.*)$/\t\$(NOECHO) \$(ECHO) "$1" >>META.yml/gm;
  $dump =~ s/>>META\.yml/>META.yml/;

  return "metafile:\n$dump";
}

WriteMakefile(
    NAME                => 'graph-perl-usage',
    VERSION_FROM        => 'gen_graph', # finds $VERSION
    PREREQ_PM           => {
        Graph => 0.65,
        Graph::Easy => 0.22,
        },
    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
      (ABSTRACT  => 'graph Perl Package usage',
       AUTHOR         => 'Tels <[EMAIL PROTECTED]>') : ()),
);
###########################################################

- -- 
 Signed on Wed Jul 20 18:42:50 2005 with key 0x93B84C15.
 Visit my photo gallery at http://bloodgate.com/photos/
 PGP key on http://bloodgate.com/tels.asc or per email.

 "I can imagine what you're thinking though: this girl keeps her brains
 in her backside! But actually only the more primitive parts of my brain
 are in my butt. The more interesting parts are kept in a PC - my spinal
 cord is actually an RS232 lead!" - Lucy, the OrangUtan Robot Girl
 http://tinyurl.com/3fv6z

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iQEVAwUBQt5/C3cLPEOTuEwVAQH8lQf9Emu7yAmo2fq91V6boHbX5bvzjB8jO3R1
dsefdteifYDD1rBFaKPIr+vwiHMrDlkCjcqa+PpYkkwzAmRnGOxTrZl84bgVziJD
CZtTBCx3SZM9seKxg4Adke6tP8orAZhWhaUwawlEqHng4/VP/mjVJCLh9LuC7/Ai
p+DSUQiimn/1NCI5XAmpSfj7URRFZ36oRsXrRWDYYNpG1FGeDGKJlij7wwuvLWCe
oVOfLBZj2Im446lQSM3JvT0oVlCAIQpiMyzvQYPGLMhdWJRAwv9+0RAVlzVCj87F
q4Quv2/6zbL/XzhlNbjQuHddWZQydIsv6pewjCCQ9xfosBWn+GKaJA==
=0Cjl
-----END PGP SIGNATURE-----

Reply via email to