1

I have an application that I deploy on both Linux (Red Hat) and Unix (Solaris). My application installs itself using the built in Perl, and from then creates its own local Perl (new user).

I would like to know what is the best way to deploy Curses::UI? Currently I install other modules by just copying them to my local perl lib folder, but these are pure Perl modules that don't depend on C libraries (.so shared objects, XS, etc.).

Also will I have to compile libncurses for each platform beforehand?

NOTE: The computer doesnt have network connectivity, hence I cant use the CPAN module.

snoofkin
  • 8,725
  • 14
  • 49
  • 86
  • No network, no problem. Make a [minicpan](http://p3rl.org/minicpan) copy and carry it over to the target. Configure its CPAN client to [read from the local filesystem](http://p3rl.org/CPAN#The-urllist-parameter-has-CD-ROM-support) instead of the network. – daxim Apr 17 '12 at 08:59

2 Answers2

2

You should use a CPAN client (CPAN.pm, CPANPLUS) to deploy modules such as Curses::UI from CPAN. Usually you need development libs to compile XS modules. For Curses::UI the Ubuntu package is called libncurses-dev. Other Linux distributions probably have an ncurses devel package under the same or similar name.

You said you have a local Perl lib. A very good way to have a local lib is the module of the same name - local::lib. Its documentation will tell you how to easily install modules into your local::lib using a CPAN client.

daxim
  • 39,270
  • 4
  • 65
  • 132
Caldrin
  • 101
  • 2
  • so can I use CPAN::Mini to build a local repository which consists only of Curses::UI and its dependencies? – snoofkin Apr 17 '12 at 13:31
1

For the CPAN modules that need to be built, try looking at carton. It has a bundle command that will bundle all your cpan modules together so they can be installed/built on the target machines without any network involved.

As for libcurses, I'd probably lean toward having a custom installer to build it on the target machine if it's not already installed. That or make your software refuse to be installed unless that library is found. Unfortunately I don't know of a good way to build dependent C libraries locally other than doing a custom build script.

mpeters
  • 4,737
  • 3
  • 27
  • 41