Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Best strategy to facilitate dependency installation for a Perl-based software distribution

by hermida (Scribe)
on Oct 25, 2011 at 20:45 UTC ( [id://933700]=perlquestion: print w/replies, xml ) Need Help??

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

Hi all,

I am distributing a Perl-based piece of software and wanted to make it as easy as possible for people to install it when it comes to the CPAN dependencies. I'm assuming they do not have any superuser privileges. Previously when I've distributed software I've simply listed the CPAN requirements in the install doc and left it up to the people installing the software to have these dependencies in their Perl @INC. I would like to make it much easier this time around and was wondering what is the best strategy for facilitating missing CPAN dependencies?

  • Should I include all non-XS CPAN dependencies in a local lib within the distribution?
  • Should I do something a la Catalyst with Module::AutoInstall and local::lib?
  • Should I use something like lib::xi?

Advice more than welcome :-)

Replies are listed 'Best First'.
Re: Best strategy to facilitate dependency installation for a Perl-based software distribution
by Anonymous Monk on Oct 25, 2011 at 21:17 UTC

    Depends, how clueless is the target audience?

    How dependent is your software on non-standard libraries (unlike expat,libxml2,libgd...)?

    Does your software require specific versions of cpan modules?

    See this presentation and the mentioned solutions Seen in PerlWeekly newsletter: Carton CPAN dependency manager, maybe you use par, or cpan2rpm/cpan2deb...

      Depends, how clueless is the target audience?
      I would say I could assume they have basic Linux knowledge and can run scripts and answer interactive questions if needed in these scripts.
      How dependent is your software on non-standard libraries (unlike expat,libxml2,libgd...)?
      Not sure what you meant by non-standard libraries, every CPAN dependency I have is non-XS or has a non-XS version.
      Does your software require specific versions of cpan modules?
      No, works with any recent versions of libraries.
      See this presentation and the mentioned solutions Seen in PerlWeekly newsletter: Carton CPAN dependency manager, maybe you use par, or cpan2rpm/cpan2deb...
      Thanks for the heads up on Carton, didn't know this existed and I see T. Miyagawa recently started the project, this is great.
        I would say I could assume they have basic Linux knowledge
        Linux?

        Make RPMs.

Re: Best strategy to facilitate dependency installation for a Perl-based software distribution
by hermida (Scribe) on Nov 13, 2011 at 22:14 UTC
    Ok so I've gone the route of including all non-CORE and non-XS dependencies bundled in an extlib in my distribution to make things as easy as possible for people trying to install the software, looks to be a good way.

    When I started building the extlib in my development environment using cpanm -L extlib <module> etc I realized that cpanm installs everything in a local::lib compatible way, meaning everything doesn't go starting at extlib but rather extlib/lib/perl5. Therefore I would have to use local::lib "$FindBin::Bin/../extlib" in my programs instead of use lib "$FindBin::Bin/../extlib" to get use the dependencies in extlib but this brings a chicken-or-egg problem, local::lib in not in CORE :-(

    Is there something I'm not thinking right here? I don't want to make to have to make an external dependency that people have local::lib already installed in their Perl tree (which could require administrator access)

      Is there something I'm not thinking right here?

      I think so :)

      If the route you have chosen is to bundle all non-CORE dependencies, and local::lib is not core, why can't you bundle local::lib?

        Sorry if I wasn't clear, its because one needs to use local::lib "$FindBin::Bin/../extlib" to be able to include and use these bundled dependencies therefore local::lib cannot be bundled

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-03-29 00:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found