Skip to content
This repository has been archived by the owner on Mar 17, 2018. It is now read-only.

Self installation of perl modules

zyxmon edited this page Apr 9, 2017 · 7 revisions

Prerequisites

Before you start to install perl modules please install

  1. gcc - follow instructions here: Using-gcc-(native-compilation). You do not need to assign any special environment variables by running /opt/bin/gcc_env.sh, all needed flags will be used automatically by perl.

  2. All perlbase modules. Use the command opkg list | grep perlbase- | sed 's/ - .*//' | xargs opkg install

  3. perl-dev package with headers opkg install perl-dev.

  4. perl tests packages opkg install perl-test-warn and opkg install perl-test-harness --force-overwrite - please use --force-ovewrite flag. The last package has same files in common with one of perlbase packages.

  5. make: opkg install make

Manual installation.

Perl modules can be installed manually. Start with installing http://search.cpan.org/~gbarr/CPAN-DistnameInfo-0.12/lib/CPAN/DistnameInfo.pm - it may be later used by CPAN. Download and unpack CPAN-DistnameInfo-0.12.tar.gz. In the directory with unpacked archive run perl Makefile.PL, 'make' and 'make install':

# perl Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for CPAN::DistnameInfo
Writing MYMETA.yml and MYMETA.json

# make
cp lib/CPAN/DistnameInfo.pm blib/lib/CPAN/DistnameInfo.pm

# make install
Installing /opt/lib/perl5/5.22/CPAN/DistnameInfo.pm
Appending installation info to /opt/lib/perl5/5.22/perllocal.pod

This method can be used for other perl modules.

Using CPAN

CPAN system can create a huge cache in your home dir. If your home directory is in RAM create any folder on storage and use it as HOME. Start CPAN with HOME=<your folder for cache> perl -MCPAN -e shell:

CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.

Would you like to configure as much as possible automatically? [yes]


Autoconfiguration complete.

commit: wrote '/root/.cpan/CPAN/MyConfig.pm'

You can re-run configuration any time with 'o conf init' in the CPAN shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.11)
Enter 'h' for help.

cpan[1]> 

First install HTTP::Date by entering install HTTP::Date. It is needed for other installations. After this you can install other modules. All dependent modules will be installed. All C extensions compiled, tests will be run. For example install DBD::SQLite runs 3000+ tests that takes some time:

install DBD::SQLite
...
All tests successful.
Files=103, Tests=3561, 100 wallclock secs ( 4.92 usr  0.63 sys + 63.44 cusr  2.83 csys = 71.82 CPU)
Result: PASS
  ISHIGAKI/DBD-SQLite-1.50.tar.gz
  /opt/bin/make test -- OK
Running make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /opt/lib/perl5/5.22/auto/DBD/SQLite/SQLite.so
Installing /opt/lib/perl5/5.22/DBD/SQLite.pm
......

Leave CPAN with bye command.