MakeMaker not manifying

Hmm, it seems my old favourite ExtUtils::MakeMaker has a certain problem with Perl modules whose names begin with the words ‘config’ or ‘setup’. The source (in ExtUtils::MM_Unix and probably others) says this:

# Remove "Configure.pm" and similar, if it's not the only pod listed
# To force inclusion, just name it "Configure.pod", or override MAN3PODS
foreach $name (keys %manifypods) {
    if ($name =~ /(config|setup).*\.pm/is) {
        delete $manifypods{$name};
        next;
    }
    ...

This isn't documented anywhere. To get round this I have to specify the exact paths for all the files which contain POD documentation (in Makefile.PL). Use the MAN3PODS parameter, and set it to a reference to a hash, where the keys are the filenames of the modules with POD in and the values are the output file which the man page should be put in, which you have to generate using the make variables INST_MAN3DIR and MAN3EXT:

WriteMakefile(
   ...
   MAN3PODS => {
      'lib/Jura.pm' => '$(INST_MAN3DIR)/Jura.$(MAN3EXT)',
      'lib/Jura/ConfigFile.pm' =>   # Unluckily named.
         '$(INST_MAN3DIR)/Jura::ConfigFile.$(MAN3EXT)',
      'lib/Jura/Page.pm' => '$(INST_MAN3DIR)/Jura::Page.$(MAN3EXT)',
      'lib/Jura/Template.pm' => '$(INST_MAN3DIR)/Jura::Template.$(MAN3EXT)',
   },
);

It probably makes more sense to do some of this automatically, to make it easier to add new modules:

WriteMakefile(
   ...
   MAN3PODS => {
      map {
         (my $filename = $_) =~ s/::/\//g;
         "lib/$filename.pm" => "\$(INST_MAN3DIR)/$_.\$(MAN3EXT)";
      }
      'Jura',
      'Jura::ConfigFile',
      'Jura::Page',
      'Jura::Template',
   },
);

< New year, new blog | Poems Online goes live >

Miniblog

(nuggets of inanity)

Tuesday Apr 24th 2007, 16:54 »
Just took the annual web design survey that AListApart do. I don't realy consider myself to be a web designer, but I have been doing a lot of HTML and CSS lately.
Monday Apr 23rd 2007, 18:23 »
Strange, there appears to be a bare-knuckle boxing match going on in the field outside my flat. Wish they wouldn't make so much noise about it.
Thursday Mar 1st 2007, 18:47 »
“In its written form, Hebrew has no vowels, making it the ideal language for texting.”
—Said in jest on some Radio 4 programme just now.

Archive: 2007 · 2006 · 2005 · 2004
Feed