Here's how you get all of CPAN to carry around with you.
Check out merlyn's minicpan script. In that script, set the $LOCAL
variable to a directory of your choice, and the $REMOTE to a CPAN
server near you. Run that script on a machine with internet access.
Burn the directory to a CD (or copy it to a USB stick).
On the target machine, mount the medium. Run cpan and set the first item
in urllist to the directory containing the CPAN archive (e.g. /mnt/cdrom/MINICPAN):
$ cpan
cpan shell -- CPAN exploration and modules installation (v1.xxxx)
cpan> o conf urllist unshift file:///mnt/cdrom/MINICPAN
cpan> o conf commit
commit: wrote /home/user/.cpan/CPAN/MyConfig.pm
cpan>
Voilà. You are ready to install any CPAN Module from your removable device.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] [d/l] [select] |
Thanks a lot for your replies....i'm trying to make a cd with all the necessary packages for installing koha....since i have to take them to villages in kerala with no internet access.
Here is the perl part of the job
koha:~# perl -MCPAN -e shell
cpan> install Event MARC::Charset MARC::Lint Digest::MD5 MARC::File::XML \
> LWP::Simple ZOOM PDF::API2 GD::Barcode Data::Random PDF::Reuse::Barcode
cpan> get Net::Z3950
cpan> exit
| [reply] |
If you are using a linux box this is one way..
Go to search.cpan.org and find your modules, to the upper right of the documentation page for a module ( for example RDF::Redland::Storage
You can download the distribution package, usually a "tarball" this is a zip like file with the files you need to install the module.
Save those for whatever you need.. then take them to your computer of choice. And follow the README instructions- which will likely tell you to run 'make', 'make test', 'make install' - as root user- from the directory you unpacked your files into (unzipped files to)
That was a brief 5 cent breakdown. That said- In my humble opinion- I would discourage this! It could become a nightmare. The modules quite often need modules that are not already installed. So.. if You install a::b, it is likely you also need b::c, but how do you know if you already have it? I suggest you plug your machine temporarily into the net, run cpan which will will also take care of dependencies.
Would you explain further what your situation is? Is this a laptop without wireless? There are solutions for this.
| [reply] |
Each module or bundle distribution from CPAN is just a single tar file. On a machine with internet access, you can use any of several methods to download the tar files you want from search.cpan.org, get these tar files onto the target machine, and for each one, go through a process like this:
tar xzf module-name.tar.gz
cd module-name
perl Makefile.PL
make
make test
make install
cd ..
If the target machine is any sort of unix/linux box, you'll probably want to do that as the root user. Or, as a non-root user, you can install the modules in some non-default path (where you have write access) by changing the the third step as follows:
perl Makefile.PL PREFIX=/my/install/path
But as the first reply points out, things can get tricky if the chosen modules have dependencies that you haven't anticipated. The best thing might be to have an equivalent machine with internet access, use perl -MCPAN -e shell to go through the module installations, and keep track of any dependencies that are reported in the process.
When there are dependencies among the modules you want, you'll need to make sure you install them in the proper order. (The manual CPAN session will do things in proper order, so just keep track of that, and make sure to move all the tar files from the .cpan/sources/authors/id/* directories.)
(UPDATE: If you use "perl -MCPAN" on an internet-connected machine to do a "mirror" or "dry-run" for the set of installations you want, there's a chance that this might miss some module dependencies, if someone has already been installing CPAN modules on that machine. At worst, you may need to look through the README files of each module to see what it's dependencies are, if any.) | [reply] [d/l] [select] |
another possible workaround, depending on your situation, is to set the conf var index_expire very high, as i explain in another post on this topic.
| [reply] [d/l] [select] |