Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Entire project on CPAN -- including all modules

by stevieb (Hermit)
on Mar 08, 2012 at 20:56 UTC ( #958534=perlquestion: print w/ replies, xml ) Need Help??
stevieb has asked for the wisdom of the Perl Monks concerning the following question:

Monks

A couple years ago, I wrote an entire billing/accounting/client management system suited for an *SP environment. To see how CPAN would deal with it, I threw it up: http://search.cpan.org/~steveb/Business-ISP-0.13_02/README

The system isn't really installable, but when it is installed, it is functional. Overlook the crappy code I desire to fix for a moment...

What I want to know, is how I can tell CPAN to install all of my modules from this distribution in one pass. I've found it isn't as easy as "perl -MCPAN -e 'install Business::ISP::'. I tried to include an ISP.pm module to see if that would help, but it didn't. This distribution is more of a complete integrated system than anything

Beyond that, this project uses ExtUtils::MakeMaker, which I am having a hard time figuring out how to ensure dependencies are installed. I have a user-input Makefile.PL that I bypass for CPAN, but I'm kind of stuck in these two areas to move forward on this project.

Any tips appreciated.

sb

Comment on Entire project on CPAN -- including all modules
Re: Entire project on CPAN -- including all modules
by VinsWorldcom (Priest) on Mar 08, 2012 at 21:13 UTC

    If they're not bundled in the same distribution (.tar.gz) file then you could put prerequisites in the Makefile.PL of each separate module. Since you said you use ExtUtils::MakeMaker, I've done that with:

    # # $Id: Makefile.PL 49 2009-05-31 13:15:34Z $ # use ExtUtils::MakeMaker; require v5.6.1; WriteMakefile( NAME => 'Module::Name', VERSION_FROM => 'lib/Module/Name.pm', LICENSE => 'artistic', ABSTRACT_FROM => 'lib/Module/Name.pm', AUTHOR => 'VinsWorldcom', PREREQ_PM => { Business::ISP::m1 => 1.00 # must be greater than ver 1 Business::ISP::m2 => 0 # version doesn't matter }, );

      What I was hoping for, was the ability to have a 'root' or a top-level of my distribution so that everything within its relative namespace gets installed.

      The PREREQ_PM only *warns* that dependencies aren't installed.

      What I'd like (at minimum) is for all of my modules under this distro to be installed by default, and then the rest of the prereq's installed automatically, or by choice by the user.

      I hope I am explaining myself clearly ;)

      sb

        If you are in your distribution directory, the command

        cpan .

        (note that dot) will install all prerequisites and then that module from CPAN.

        The alternative is to just include all modules in your distribution directly.

        There is no mechanism to tell CPAN to "just pull in all things within that same namespace", except to list all these modules yourself.

Re: Entire project on CPAN -- including all modules
by tobyink (Abbot) on Mar 08, 2012 at 22:54 UTC

    CPAN should automatically install every module within a distribution when a single module is requested. For example, if you install HTTP::Request you'll find that HTTP::Message, HTTP::Reponse, HTTP::Headers, HTTP::Status and others get installed as well because they're part of the same distribution.

    That's just how CPAN and ExtUtils::MakeMaker work. If this is not working for you, then you're probably using ExtUtils::MakeMaker wrong.

Re: Entire project on CPAN -- including all modules
by pemungkah (Priest) on Mar 09, 2012 at 02:29 UTC
    You may possibly want to create a "bundle", which is a fake package that says "I have no code of my own, just dependencies". This makes it simple to install a whole bunch od stuff at once. Here's an example of how to make a CPAN bundle.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://958534]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-07-31 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (244 votes), past polls