NAME
CPAN::Site - CPAN.pm subclass for adding site local modules
INHERITANCE
CPAN::Site
is a CPAN
SYNOPSIS
perl -MCPAN::Site -e shell
cpansite shell # alternative
perl -MCPAN::Site -e 'install AnyModule'
cpansite install AnyModule # alternative
DESCRIPTION
This module adds access to site specific modules to the CPAN.pm install interface. The general idea is to have a local (pseudo) CPAN server which is asked first. If the request fails -which is the usual case-, CPAN.pm switches to the next URL in the list pointing to a real CPAN server.
DETAILS
QUICK SETUP EXAMPLE FOR IMPATIENT
This explanation was contributed by Alex Efros. There is also an explanation in the manual page of the cpansite script.
Let's say your (registered or un-registered) Pause-ID is IMPATIENT, :) and you have private module in file Private-Module-1.23.tar.gz. You wish to make it available from your own CPAN mirror (actually it's better to call it "overlay" instead) on website http://impatient.net/ located in directory /var/www/impatient.net/.
Configuring the server
# cpan CPAN::Site
# mkdir -p /var/www/impatient.net/CPAN/authors/id/I/IM/IMPATIENT/
# cp Private-Module-1.23.tar.gz \
/var/www/impatient.net/CPAN/authors/id/I/IM/IMPATIENT/
# cpansite -vl index /var/www/impatient.net/CPAN/
This nested /I/IM/IMPATIENT/
structure is CPAN's way of avoiding huge directories. Your mirror only requires one level.
You may also wish to add cpansite index
to cron and have it run every hour or so. This way you can just copy new modules to /var/www/impatient.net/CPAN/authors/id/I/IM/IMPATIENT/ and they become automatically available on your CPAN mirror after a while. To do this you should run crontab -e
and add single line like this:
0 * * * * cpansite -l index /var/www/impatient.net/CPAN/ &>/dev/null
Configuring the clients
# cpan CPAN::Site
# cpansite
cpan> o conf urllist unshift http://impatient.net/CPAN/
cpan> o conf commit
Now clients should cpansite
command instead of cpan
to search, install or update modules. The cpan
command will use the real CPAN's indexes.
SEE ALSO
This module is part of CPAN-Site distribution version 0.20, built on April 10, 2008. Website: http://perl.overmeer.net/cpan-site/
LICENSE
Copyrights 1998,2005-2008 by Mark Overmeer. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html