Install Perl CPAN

From AwkwardTV
Revision as of 12:52, 28 September 2008 by Fcorthay (talk | contribs) (New page: The AppleTV comes with a minimal Perl installation. If you want to unleash the full power of Perl, the first thing you want is to install [http://www.cpan.org/ CPAN] modules. If you addit...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The AppleTV comes with a minimal Perl installation. If you want to unleash the full power of Perl, the first thing you want is to install CPAN modules.

If you additionally want PHP and MySQL, you can consider installing XAMPP which provides all 4 items independently of the ApplTV OS.

Prerequisites

First of all, you'll need to install gcc.

We'll start with an ssh enabled AppleTV having a proper recovery partition.

We'll also need some binaries from an Intel Mac with Tiger and Xcode tools install.

Tiger files

From an Intel Mac with Tiger with Xcode tools installed, copy to the following files to AppleTV:

/usr/bin/groff
/usr/bin/grotty
/usr/bin/nroff
/usr/bin/perldoc
/usr/bin/pod2man
/usr/bin/troff

From the same Mac, copy to the following direcories:

/System/Library/Perl
/usr/share/groff

These will be partly overwritten from the recovery partition files.

Perl modules

Log into the AppleTV as root.

Get the Perl modules from the recovery partition:

cd /Users/frontrow/Documents/
dd if=/dev/disk0s2 of=recovery.dmg bs=1m
hdiutil mount recovery.dmg
hdiutil mount /Volumes/Recovery/OS.dmg
cp -R /Volumes/OSBoot\ 1/System/Library/Perl /System/Library/
umount /Volumes/OSBoot\ 1

Configure CPAN (make it simple: answer no to the first question):

perl -MCPAN -e shell

Update CPAN (hit cr to the questions):

perl -MCPAN -e 'install Bundle::CPAN'

Once this is done, you can check your installation with one of:

perl -MCPAN -e 'autobundle'
perldoc perllocal