Tanktalus has asked for the wisdom of the Perl Monks concerning the following question:
This is actually something I'd rather put in CUFP ... but I don't have any code (yet) to do it. But I think it'd be a cool way to handle certain issues. My issues. And not the ones that only a shrink could help with.
The brief version: Given a list of (local) tarballs that are distributions of modules as are available on CPAN, what is the easiest automatic way to install them locally?
The long version.
I would like to take tarballs from CPAN, check them in to our version control system, and then, during an automated build (e.g., "make all"), install them inside that tree. The reasons for this include:
Two obvious possibilities arise. First off, so far all modules we want to do this for (which are not already part of the base 5.8.x perl distributions) are pure perl. So we could just take the .pm files, put them in the right place, set up the use lib calls appropriately, and be done with it. Advantage: easy to set up. Disadvantage: difficult to maintain (upgrading or deleting are both more painful).
Second option is to simply write a script that untars the tarball (I'll likely gunzip the tarball first just to avoid gzip dependancies on some platforms), cd's to the directory, runs "perl Makefile.PL PREFIX=$somewhere_in_build_tree && gnumake && gnumake install", and goes on to the next file. How to work out that dependency tree, should there ever become one, will be an interesting challenge. Advantage: once set up, should be as trivial to maintain as possible. Disadvantage: possibly reinventing someone else's wheel.
So the question is, using stock perl 5.8.x, is there anything out there I can bootstrap into this? I've looked at ExtUtils::AutoInstall (Mentioned in Re: Running CPAN without Being root by simonm) but that's kind of the opposite of what I'm looking for - it wants to do things interactively for another Makefile.PL, and isn't part of stock 5.8.x. Other interesting nodes include Automatic module installation by Juerd - but it's for installing from CPAN, and, well, is a bit scary ;-) I want to set up the installations where I can easily select the level to install (by placing it in a tarball in the version control system), and Juerd's implementation would need to be completely reworked anyway.
If there is no wheel out there yet invented, I'm going to have to pick my way through tachyon's A Guide to Installing Modules while writing that second one. (Let no one say I didn't super search this. They can say I didn't use the right terms, but they can't say I didn't try ;->)
Bottom line: I want to run "install_em_all.pl", walk away, and come back X amount of time later to find all tarballs done installing to a local directory. That I may need to write the logic to glob *.tar, or I need to write the logic to select the LIB directory to install to are minor. The rest probably isn't so big, either, but I'm guessing there are gotchas that I don't know about (yet).
One final note: some of these modules use Makefile.PL, others use Build.PL. Anything I take advantage of would necessarily need to handle both. Writing my own, if that's what is required, will obviously also need to do so.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Automated module install
by perrin (Chancellor) on Apr 08, 2005 at 00:31 UTC | |
Re: Automated module install
by blahblahblah (Priest) on Apr 08, 2005 at 04:18 UTC | |
Re: Automated module install
by chanio (Priest) on Apr 08, 2005 at 20:33 UTC |