Install CPANPLUS for Apple’s OS X 10.5+ Operating System
The source for CPANPLUS is located at:
http://search.cpan.org/search?query=cpanplus&mode=all
To begin you just need to download the API and CLI source which should be the first item in the list, the other entries are modules for CPANPLUS that you can elect to install after install CPANPLUS. I’m keeping this post very simple so I won’t delve into the inner workings of CPAN/CPANPLUS and the many features available to you for configuration, etc.
If you haven’t used Perl on your Apple yet, you have a fresh install of OS X, … you will need to install several prerequisite packages before you can install CPANPLUS.
Without going into details I’ll try to make an attempt to outline the steps to configure perl for the first time on your Apple machine with just enough details to get you started and to the point where you have CPANPLUS installed.
Beginning with Perl Version 5.004 and later CPAN comes with the Perl package and this is the module you use to install other mdoules. To Invoke CPAN and install the module IPC::Cmd type the following:
su – root – Log in as root or you can use sudo to execute the commands, I put my .cpan and .cpanplus directories in /Users/shared. If you intend on placing the new Perl Programs in the System Directory Structure you have to use sudo to make install, otherwise your account (even though it may be the administrator account) does not have access to overwrite files located in the System Directory Structure. You can compile and test Perl modules but you will not be able to install them.
su – root
cd /Users/Shared
perl -MCPAN -e shell
/System/Library/Perl/5.8.8/CPAN/Config.pm initialized.
CPAN is the world-wide archive of perl resources. It consists of about
100 sites that all replicate the same contents all around the globe.
Many countries have at least one CPAN site already. The resources
found on CPAN are easily accessible with the CPAN.pm module. If you
want to use CPAN.pm, you have to configure it properly.
If you do not want to enter a dialog now, you can answer ‘no’ to this
question and I’ll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing ‘o conf init’ at the cpan prompt.)
Are you ready for manual configuration? [yes]
The following questions are intended to help you with the
configuration. The CPAN module needs a directory of its own to cache
important index files and maybe keep a temporary mirror of CPAN files.
This may be a site-wide directory or a personal directory.
First of all, I’d like to create this directory. Where?
CPAN build and cache directory? [/var/root/.cpan]
If you want, I can keep the source files after a build in the cpan
home directory. If you choose so then future builds will take the
files from there. If you don’t want to keep them, answer 0 to the
next question.
How big should the disk cache be for keeping the build directories
with all the intermediate files?
Cache size for build directory (in MB)? [10] 30
By default, each time the CPAN module is started, cache scanning
is performed to keep the cache size in sync. To prevent from this,
disable the cache scanning with ‘never’.
Perform cache scanning (atstart or never)? [atstart]
To considerably speed up the initial CPAN shell startup, it is
possible to use Storable to create a cache of metadata. If Storable
is not available, the normal index mechanism will be used.
Cache metadata (yes/no)? [yes]
The next option deals with the charset your terminal supports. In
general CPAN is English speaking territory, thus the charset does not
matter much, but some of the aliens out there who upload their
software to CPAN bear names that are outside the ASCII range. If your
terminal supports UTF-8, you say no to the next question, if it
supports ISO-8859-1 (also known as LATIN1) then you say yes, and if it
supports neither nor, your answer does not matter, you will not be
able to read the names of some authors anyway. If you answer no, names
will be output in UTF-8.
Your terminal expects ISO-8859-1 (yes/no)? [yes]
If you have one of the readline packages (Term::ReadLine::Perl,
Term::ReadLine::Gnu, possibly others) installed, the interactive CPAN
shell will have history support. The next two questions deal with the
filename of the history file and with its size. If you do not want to
set this variable, please hit SPACE RETURN to the following question.
File to save your history? [/var/root/.cpan/histfile]
Number of lines to save? [100] 500
The CPAN module can detect when a module that which you are trying to
build depends on prerequisites. If this happens, it can build the
prerequisites for you automatically (’follow’), ask you for
confirmation (’ask’), or just ignore them (’ignore’). Please set your
policy to one of the three values.
Policy on building prerequisites (follow, ask or ignore)? [ask] follow
The CPAN module will need a few external programs to work properly.
Please correct me, if I guess the wrong path for a program. Don’t
panic if you do not have some of them, just press ENTER for those. To
disable the use of a download program, you can type a space followed
by ENTER.
Where is your gzip program? [/usr/bin/gzip]
Where is your tar program? [/usr/bin/tar]
Where is your unzip program? [/usr/bin/unzip]
Where is your make program? [/usr/bin/make]
Warning: lynx not found in PATH
Where is your lynx program? []
Warning: wget not found in PATH
Where is your wget program? []
Warning: ncftpget not found in PATH
Where is your ncftpget program? []
Warning: ncftp not found in PATH
Where is your ncftp program? []
Where is your ftp program? [/usr/bin/ftp]
Warning: gpg not found in PATH
Where is your gpg program? []
What is your favorite pager program? [col -b | bbedit --clean --view-top]
What is your favorite shell? [/bin/sh]
Every Makefile.PL is run by perl in a separate process. Likewise we
run ‘make’ and ‘make install’ in processes. If you have any
parameters (e.g. PREFIX, LIB, UNINST or the like) you want to pass
to the calls, please specify them here.
If you don’t understand this question, just press ENTER.
Parameters for the ‘perl Makefile.PL’ command?
Typical frequently used settings:
PREFIX=~/perl non-root users (please see manual for more hints)
Your choice: []
Parameters for the ‘make’ command?
Typical frequently used setting:
-j3 dual processor system
Your choice: []
Parameters for the ‘make install’ command?
Typical frequently used setting:
UNINST=1 to always uninstall potentially conflicting files
Your choice: []
Sometimes you may wish to leave the processes run by CPAN alone
without caring about them. As sometimes the Makefile.PL contains
question you’re expected to answer, you can set a timer that will
kill a ‘perl Makefile.PL’ process after the specified time in seconds.
If you set this value to 0, these processes will wait forever. This is
the default and recommended setting.
Timeout for inactivity during Makefile.PL? [0]
If you’re accessing the net via proxies, you can specify them in the
CPAN configuration or via environment variables. The variable in
the $CPAN::Config takes precedence.
Your ftp_proxy?
Your http_proxy?
Your no_proxy?
You have no /var/root/.cpan/sources/MIRRORED.BY
I’m trying to fetch one
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY
Now we need to know where your favorite CPAN sites are located. Push
a few sites onto the array (just in case the first on the array won’t
work). If you are mirroring CPAN to your local workstation, specify a
file: URL.
First, pick a nearby continent and country (you can pick several of
each, separated by spaces, or none if you just want to keep your
existing selections). Then, you will be presented with a list of URLs
of CPAN mirrors in the countries you selected, along with previously
selected URLs. Select some of those URLs, or just keep the old list.
Finally, you will be prompted for any extra URLs — file:, ftp:, or
http: — that host a CPAN mirror.
(1) Africa
(2) Asia
(3) Central America
(4) Europe
(5) North America
(6) Oceania
(7) South America
Select your continent (or several nearby continents) [] 5
Sorry! since you don’t have any existing picks, you must make a
geographic selection.
(1) Bahamas
(2) Canada
(3) Mexico
(4) United States
Select your country (or several nearby countries) [] 4
Sorry! since you don’t have any existing picks, you must make a
geographic selection.
(1)
(2) ftp://carroll.cac.psu.edu/pub/CPAN/
(3) ftp://cpan-du.viaverio.com/pub/CPAN/
(4) ftp://cpan-sj.viaverio.com/pub/CPAN/
(5) ftp://cpan.calvin.edu/pub/CPAN
(6) ftp://cpan.cs.utah.edu/pub/CPAN/
(7) ftp://cpan.erlbaum.net/CPAN/
(8) ftp://cpan.hexten.net/
(9) ftp://cpan.hostrack.net/pub/CPAN
(10) ftp://cpan.llarian.net/pub/CPAN/
(11) ftp://cpan.mirrors.redwire.net/pub/CPAN/
(12) ftp://cpan.mirrors.tds.net/pub/CPAN
(13) ftp://cpan.netnitco.net/pub/mirrors/CPAN/
(14) ftp://cpan.pair.com/pub/CPAN/
(15) ftp://csociety-ftp.ecn.purdue.edu/pub/CPAN
(16) ftp://ftp-mirror.internap.com/pub/CPAN/
38 more items, hit SPACE RETURN to show them
Select as many URLs as you like (by number),
put them on one line, separated by blanks, e.g. ‘1 4 5′ [] 16 6 13 8 2
Enter another URL or RETURN to quit: []
New set of picks:
ftp://ftp-mirror.internap.com/pub/CPAN/
ftp://cpan.cs.utah.edu/pub/CPAN/
ftp://cpan.netnitco.net/pub/mirrors/CPAN/
ftp://cpan.hexten.net/
ftp://carroll.cac.psu.edu/pub/CPAN/
commit: wrote /System/Library/Perl/5.8.8/CPAN/Config.pm
cpan shell — CPAN exploration and modules installation (v1.7602)
ReadLine support enabled
cpan> exit
My list of missing modules when I attempted to install CPANPLUS were;
Checking if your kit is complete…
Looks good
Warning: prerequisite Archive::Extract 0.16 not found.
Warning: prerequisite File::Fetch 0.13_04 not found.
Warning: prerequisite IPC::Cmd 0.36 not found.
Warning: prerequisite Log::Message 0.01 not found.
Warning: prerequisite Module::CoreList 2.09 not found.
Warning: prerequisite Module::Load 0.10 not found.
Warning: prerequisite Module::Load::Conditional 0.18 not found.
Warning: prerequisite Module::Loaded 0.01 not found.
Warning: prerequisite Object::Accessor 0.32 not found.
Warning: prerequisite Package::Constants 0.01 not found.
Warning: prerequisite Params::Check 0.22 not found.
Warning: prerequisite Term::UI 0.18 not found.
Warning: prerequisite Test::Harness 2.62 not found. We have 2.56.
Warning: prerequisite version 0.73 not found. We have 0.700.
Writing Makefile for CPANPLUS
perl -MCPAN -e shell (from /Users/Shared)
install Archive::Extract
…
install version
exit
cd $HOME/Downloads; cd cpanplus-0.84 (location of the CPANPLUS source from earlier download):
perl Makefile.PL
imac:cpanplus-0.84 repettas$ perl Makefile.PL
### IMPORTANT! ######################################################
As of CPANPLUS 0.070, configuration during ‘perl Makefile.PL’
is no longer required. A default config is now shipped that
should work out of the box on most machines, for priviliged
and unprivileged users.
If you wish to configure CPANPLUS to your environment, you can
either do that from the interactive shell after installation:
$ cpanp
CPAN Terminal> s reconfigure
Or you can invoke this program as follows, to do it now:
$ perl Makefile.PL –setup
This also means that any config created by any CPANPLUS older
than 0.070 will no longer work, and you are required to
reconfigure. See the ChangeLog file for details.
We appologize for the inconvenience.
### PLEASE NOTE ###################################################
Since CPANPLUS has a few prerequisites that are not included
in versions of perl prior to 5.9.5, they are bundled with the
distribution for boot-strapping purposes.
You should install these prerequisites before continuing to
install CPANPLUS. You can do this from the build directory
with the following commands:
$ perl bin/cpanp-boxed -s selfupdate dependencies
$ perl bin/cpanp-boxed -s selfupdate enabled_features
Or you may install them using your system’s package manager.
###################################################################
Writing Makefile for CPANPLUS
make
make test
If everything builds and tests without errors you are ready to install CPANPLUS by issuing the following line;
make install
To update CPANPLUS do the following;
su – root
cd /Users/Shared
cpanp
s selfupdate all
You can get help by entering in help from the command prompt inside of cpanp. There are several options for the selfupdate which you can see by typing in: s selfupdate (return). You can execute the selfupdate and view what it will do without actually executing the command by using the flag –dryrun at the end of the command line.