pileofrogs has asked for the wisdom of the Perl Monks concerning the following question:

First, let me apologize. I'm almost positive this question has been answered before, but I couldn't find it.

I have a number of modules I've written. I've got to install my modules on several machines. The modules have a few non-standard prerequisites. So, every time I install my module on a new machine, I have make a list of the prereqs, fire up CPAN and install the prereqs, and then manually install my modules.

Is there a way I can either install my custom module and the prereqs in one command ala:

frob pileofrogs-v0.0.1.tar.gz

Or use cpan to install my modules and the prereqs as though my modules were on CPAN?

perl -MCPAN -e "CPAN::install pileofrogs"

CPAN::Site looks like it does what I want, but it has this warning:

This is not even alpha software and will be made obsolete by CPAN.pm extensions/plugins some day.

So is CPAN::Site actually OK despite that warning, or is there something better to solve my problem?

Thanks!
-Pileofrogs

Update: Success! See CPAN::Mini::Inject Discoveries.

Replies are listed 'Best First'.
Re: CPAN and Site Modules
by duckyd (Hermit) on Mar 09, 2006 at 01:12 UTC
    You could package up your modules using ExtUtils::MakeMaker or Module::Build and then install them like a CPAN package, or create a pseudo package that just pulls in all your prereqs, and then install your modules however you do currently.

      I already use Module::Build to make the modules. I generate a "traditional" Makefile.PL for each as well. How do I install them like a CPAN package? How do i make CPAN find them?

      How does a "pseudo package that just pulls in all your prereqs" work? Do I have to tell it my prereqs? Since I'm already defining my prereqs in Build.PL/Makefile.PL, I don't want to have to duplicate that.

      Thanks
      -Pileofrogs

Re: CPAN and Site Modules
by asz (Pilgrim) on Mar 09, 2006 at 16:37 UTC
    this might not be what you are after, but you should also check out PAR. you could create a PAR "bundle" of your modules and their (non-core) prerequisites and deploy it on the other machines.

    for usage instructions see PAR::Tutorial and also Super Search...

    <update time="Thu Mar 9 18:42:52 EET 2006">
    or if you're only intrested in how to find you're module's prerequisites, you can use Module::Scandeps (that PAR uses internally).
    </update>

    i hope this helps

    :)))))
Re: CPAN and Site Modules
by grantm (Parson) on Mar 09, 2006 at 23:27 UTC

    You might like to look at using the native packaging system for your OS.

    For example, on Debian GNU/Linux I do exactly the sorts of things you're describing using .deb files in apt repositories. Many of the common CPAN modules are already packaged as .debs and you can use the dh-make-perl utility to create a .deb from a CPAN-style tarball. The .deb format handles dependencies including system libraries that a Perl module might require.