in reply to Gather and check dependencies w/o Makefile.PL

Instead of relying on egrep, sed and multiline shell commands being aailable, why don't you just run that script once (or after each checking) and output a fresh Makefile.PL?

A Makefile.PL is not hard to write and it immediately enables many tools to automatically test and install your distribution and all of its (listed) prerequisites.

ExtUtils::Makemaker lists a very simple Makefile.PL:

use ExtUtils::MakeMaker; WriteMakefile( NAME => "Foo::Bar", VERSION_FROM => "lib/Foo/Bar.pm", );

You would likely expand that with the appropriate PREREQ_PM section:

use ExtUtils::MakeMaker; WriteMakefile( NAME => "Foo::Bar", VERSION_FROM => "lib/Foo/Bar.pm", PREREQ_PM => { # Require other prerequisites "Acme::Buffy" => 0, ... } );

If you're feeling extra crafty, you could generate that Makefile.PL automatically, but as such mechanisms usually fail or require special cases, I prefer manually maintaining such lists.

Replies are listed 'Best First'.
Re^2: Gather and check dependencies w/o Makefile.PL
by flowdy (Scribe) on Aug 19, 2014 at 20:37 UTC

    Hi Corion,

    Okay, thanks, I built a Makefile.PL with ExtUtils::MakeMaker that has the advantage of being a core module I just looked it up (I am absolutely new to building makefiles and CPAN distributions). Did I overlook something or doesn't the generated Makefile contain a target for installing dependencies? Whatever, with cpanm --installdeps it works well.

    --flowdy

      Installing dependencies is done by the surrounding tool, be it cpan, cpanm or cpanp. It's not the task of the Makefile generated by Makefile.PL.