tpederse has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks! We sometimes put together Perl code that we freely distribute, and sometimes things get a little complicated in terms of the user having to set things up. For example, they might have to set paths, or even have some other piece of software installed (either a CPAN module or, heaven forbid, something that isn't even Perl (we avoid this as best we can though :))

We are now trying to think of ways to make life easier for the user, and there seem to be at least two options. One is to come up with scripts like Perl's own Configure, or perhaps to use a tool like Gnu's autoconf. Any thoughts on this?

We'd just like to make the setup of our systems as convenient as it can be. If anyone has examples of how other systems have handled this, those would be most appreciated!

Cordially, Ted

Replies are listed 'Best First'.
Re: autoconf versus Configure-style
by Aristotle (Chancellor) on Oct 13, 2003 at 17:50 UTC
    How about using the standard Perl module installation mechanism based on ExtUtils::MakeMaker, or the more convenient EU::MM-based ExtUtils::ModuleMaker? That way it can be installed just like any CPAN module:
    perl Makefile.PL && make all test && make install

    In fact when installing such a package via CPAN.pm, any dependencies on CPAN modules will be resolved automatically, just like for any other CPAN module.

    Or even better, use the up and coming installation mechanism which does not rely on external make tools for much improved sanity: Module::Build. Installation then goes like

    perl Build.PL && ./Build && ./Build test && ./Build install
    although there's also a EU::MM compatibility mode where you can use the familiar Makefile.PL approach.

    Makeshifts last the longest.

      Thanks Aristotle,

      Just a clarification of sorts, most of our code isn't actually written as modules. One notable exception is WordNet::Similarity, and there we are in fact working on improving our Makefiles to help us out a bit.

      The packages that are a bit more perplexing are those that are collections of command line Perl programs that are sometimes held together via shell scripts, and/or might in fact call code that is written in C, etc. as well. Sort of a hodge-podge really.

      Do ExtUtils::MakeMaker and/or Module::Build seem appropriate in the non-module, somewhat heterogeneous scenario described above?

      Gratefully yours, Ted
        Many CPAN modules contain scripts that get installed in the system binary directory, so yes, you can use these same methods for script-only packages. It gets a bit muddier for the mixed language packages.. for these, I'd resort to autoconf.

        Makeshifts last the longest.