http://www.perlmonks.org?node_id=140938

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

Its funny but after all these years of doing Perl, I have never had to worry about generic installation because I have always has root access to the machines I worked on. However, I am about to deliver a utility I created for a client, and need to write an installation script that checks for specific modules, downloads them and installs them, and creates and installs parts of the utility in user selected directories.

Now, of course what I am curious about is if there a script someplace which will be easily altered to do this or if there is a module that can get me halfway there.


I admit it, I am Paco.

Replies are listed 'Best First'.
Re: Installation Script
by mkmcconn (Chaplain) on Jan 23, 2002 at 22:27 UTC
    Aren't you just talking about using CPAN, jonjacobmoon?

    "The CPAN module is designed to automate the make and install of perl modules and extensions. It includes some searching capabilities and knows how to use Net::FTP or LWP (or lynx or an external ftp client) to fetch the raw data from the net."

    "All methods provided are accessible in a programmer style and in an interactive shell style."
    mkmcconn

      Thank you for the lesson on CPAN but I am aware of its capabilities. Perhaps I did not make that clear, but I am not going to assume CPAN is installed. What if it is not. Let's assume NO modules are installed, or at the very least that I do not know what modules are installed.

      update: Man, my communication skills today must be way off :)

      I did not mean to sound offended. I just wanted something that was, what I think, is beyond or despite the CPAN module.


      I admit it, I am Paco.
(cLive ;-) Re: Installation Script
by cLive ;-) (Prior) on Jan 24, 2002 at 07:53 UTC
    I used Net::FTP and LWP::UserAgent for my system.

    First I upload test script that evals seperately the 'use' statements the script(s) use.

    i then call the script with LWP::UserAgent (it outputs list of uninstalled modules as text page).

    Then, either do a local install of the modules by FTP, or ask them to give you root access :-)

    If you want to see an example, msg me your e-mail and I'll send over a copy of the script I used.

    Of course, if http testing isn't on, you may have to think up another route :)

    later

    cLive ;-)

      Thanks, but I wanted to find something that assumes no modules. I think I am just going to assume CPAN and give up on the idea of a no-module option.


      I admit it, I am Paco.
        Yes, but you can install most Perl modules in a user directory, so if you do rely on them, you can install them and add:
        use lib '/path/to/modules';
        before requiring the locally installed modules.

        cLive ;-)