Subject: | Customizing the Installation Process |
CPAN-styled distributions work great if all you want to do is install
some perl modules and maybe a command-line utility, but it doesn't work
as well for installing full-blown applications. Unlike libraries,
applications typically have more things to install. An application may
want to install configuration files in $PREFIX/etc and data files in
$PREFIX/share/$application_name. Web applications might want to no
where the DocumentRoot is. Unfortunately, CPAN-styled distributions
don't have a standard way of expressing this.
That's not to say it can't be done. With ExtUtils::MakeMaker, you could
emit a Makefile fragment to perform extra actions during the `make
install` phase. With Module::Build, you could subclass it and override
the sub that handles the `./Build install` part. With
Module::Install... I'm not sure what you're supposed to do, but I'd
also like to take a step back and make an observation.
'''The vast majority of the time, installing is the act of copying files
from one place to another.'''
Unfortunately, we don't have a vocabulary/API to express the act of
copying files in a general way. CPAN-styled distributions can handle
files that should go into bin, lib, and man just fine, but if you want
file to go into etc, share, htdocs, or whatever.... you end up having
to write code, and this sucks for people who want to package up
applications as CPAN-styled distributions.
If Module::Install could provide a way to say, "copy this from here to
there," people who write applications in Perl would be in a better place.