skazat has asked for the wisdom of the Perl Monks concerning the following question:
Is there a "better" way to bundle the Digest::MD5 module with a distributed application? I want to make sure I'm bundling a tricky module like, Digest::MD5 correctly.
I develop a very very popular CGI script. It comes with many CPAN modules. Let's say the cgi script itself is called, script.cgi. Along with the script.cgi file, there's a LIB directory. Inside the lib file are all the .pm files that are use'd/require'd by the script.cgi file.
In the lib directory, there's also a perllib directory, where I put modules fetched from CPAN in. I bundle the CPAN modules with the program, because I don't expect:
(1 that they will be installed by default and
(2 don't expect the user of my program (demographic: everyone from the casual website creator to professional JAPHY) to install each of the CPAN modules separately.
(3 I respect the Laziness of my users.
If that's hard to understand, here's a outline: (- = directories, + = files)
+script.cgi
-LIB
+IHandleErrorsForScript.pm
+IHandleCGIScreensForScript.pm
+ETC.pm
+ETC.pm
+ETC.pm
-perllib
+CGI.pm
-HTML
+Template.pm
-MIME
+Lite.pm
In the script.cgi file, the perllib directory is tweaked like so:
This means, my perllibs will be checked before the site_perl libs.use lib qw(./LIB ./LIB/perllib
One the modules I need is Digest::MD5. This is a hard module to install, because it has both a pure perl version and a compiled version. I want to bundle the pure perl version, because I don't want my users to have to compile any modules I bundle in.
So, the question is, what's the best way to get a copy of the pure-perl version of Digest::MD5?
At the moment, I fetch all the modules needed by the script.cgi program by making a CPAN bundle, running cpan with "force install My::Bundle in a separate perllib directory on my local machine.
I then delete the directory that has to do with my architecture, example, "darwin-thread-multi-2level", copy all the modules that got downloaded from the bundle into the LIB/perllib directory of my script.cgi program and tar/gzip it up!
So, is this the best way to go about my business? Is there a better way to distribute perl modules that have both compiled and pure-perl versions?
Do you guys bundle CPAN modules into distributed programs in a different way?
-justin simoni
skazat me
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bundling Digest::MD5 with a distributed application?
by Joost (Canon) on Mar 14, 2005 at 09:43 UTC | |
by skazat (Chaplain) on Mar 14, 2005 at 10:12 UTC |