Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

installing dependencies

by morgon (Deacon)
on Dec 22, 2013 at 19:18 UTC ( #1068111=perlquestion: print w/ replies, xml ) Need Help??
morgon has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have an application (that I did not write myself) that is currently distributed as a tar-file consisting of the main script depending on some modules.

The modules in turn depend on about 50 CPAN-modules.

Part of the distribution is an install-script that checks the prerequisites (by doing a use_ok on all the CPAN-modules it depends on) and creates some directories and default config-files.

Unfortunately (that is what I want to change) it is up to the user to satisfy the dependencies, i.e. the install-script aborts the installation when a dependency is not met, rather than installing the dependency as part of the installation.

What would be the best way to fix this?

What would be the easiest way to convert the installer into something that also installs missing dependencies?

Many thanks!

Comment on installing dependencies
Re: installing dependencies
by marto (Bishop) on Dec 22, 2013 at 19:25 UTC

    You could consider using PAR and it's tools to distribute your app and all it's dependancies. It has many features including application repositories, I suggest reading the slides linked to and the PAR documentation.

Re: installing dependencies
by taint (Chaplain) on Dec 22, 2013 at 20:37 UTC
    Greetings, morgon.

    While I think marto has a good suggestion. I like choices (and offering them). I recently had to install a Module for a project I'm working on. It too had external resources that it thought I should/needed to install. It was Lingua-JA-Romanize-Japanese. The build, install session went as follows

    # perl ./Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Lingua::JA::Romanize::Japanese Writing MYMETA.yml and MYMETA.json
    and make went in a way I really prefer
    # make /usr/local/bin/perl5.12.5 -Ilib -MLingua::JA::Romanize::DictJA -e 'Lin +gua::JA::Romanize::DictJA->update();' Updater: Lingua::JA::Romanize::DictJA (0.23) Path: lib/Lingua/JA/Romanize/Japanese.bdb Loading module: DB_File.pm Loading module: LWP::UserAgent Loading module: IO::Zlib Loading module: Encode.pm External dictionaries: http://openlab.jp/skk/dic/SKK-JISYO.L.gz http://openlab.jp/skk/dic/SKK-JISYO.jinmei.gz http://openlab.jp/skk/dic/SKK-JISYO.propernoun.gz http://openlab.jp/skk/dic/SKK-JISYO.geo.gz http://openlab.jp/skk/dic/SKK-JISYO.station.gz Do you wish to download these files? [y]
    Choosing n didn't cause a FAIL. As it (the module) still worked w/o those dictionaries. But I just felt this was similar enough to your situation, that it's source might provide some information you might find useful in your current quest.

    λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ƨᴉɥʇ ədoH

    --Chris

    UPDATE: A point that might have been missed here; is that this method allows the person installing your module satisfy the dependencies using a different method that maybe their "dist" (OS) can satisfy "natively".

    Yes. What say about me, is true.
    
      Thanks for the suggestion, but my problem is not to have a self-contained package that can be installed even without network, but only a very simple hack to spare me the pain of having to deal with manually installing dependencies.

      I probably should have clarified that my problem is not providing a convenient installation for other people but rather to make it comfortable for me to install it on several machines, all of which have access to cpan.

      So I'll probably just add some CPAN->install statements ...

Re: installing dependencies
by moritz (Cardinal) on Dec 22, 2013 at 21:06 UTC
      While Carton indeed looks interesting at the moment I don't like that it installs dependencies into a "local" directory.

      As at the moment I want to install the modules into their default location I think I'll just go with calls to CPAN->install which when I think about it should be good enough for me.

        Is this application part of the system installation? If not, what happens when the underlying OS updates its libraries to something incompatible with your application?

        I typically recommend that you not rely on the core Perl install, but instead consider it as part of your application, and install all of the required modules as part of your application stack -- especially if this application is an internal application, or you can enforce that requirement on your customers.

        If you application is external, and you are not able to dictate a Perl installation apart from the OS, then it starts to get a little dicey.

        --MidLifeXis

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-12-21 09:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls