Ticket #263 (assigned enhancement)
Create an autoconf-like installation script
|Reported by:||rjl||Owned by:||rjl|
|Severity:||normal||Keywords:||installation script autoconf|
With a proper install script, a number of installation parameters (particularly file paths) can be specified on the command line and used not only to copy distribution files to the indicated locations, but also to set some values in their configuration files, saving administrators the need to edit multiple config files later.
At least three installation modes would be required, specified by flags:
--content-filter : amavisd-maia, Perl scripts
--web-server : PHP scripts, Smarty templates
--database-server : SQL schemas
That way, the install script could be used on all three types of servers, or used with all of these flags if everything is to be installed on a single host.
Installation paths for amavisd-maia, the Perl scripts, the PHP scripts, amavis home directory, and so on could also be specified with individual flags, using default values if an item is not explicitly specified.
This same flag-based mechanism could also be used to perform template substitutions in files like amavisd.conf, letting the administrator specify the paths to things like clamd and spamd sockets, Blowfish key files, and various other parameters that would otherwise have to be hand-edited after installation. Similarly, the location of the database.cfg file could be substituted into templates for the various Perl scripts.
In the case of the database server, the install script could perform a connection test and thus determine whether an existing Maia database is in danger of being overwritten, and if no existing database is found, the install script could then create the database from the schema. If certain schema items are to be overridden at install-time (e.g. score threshold defaults, default language/character set, default theme, etc.), command-line flags could be used to do so.
The full GNU autoconf is probably overkill for something like this, but a relatively simple Perl script could do this job. Configuration files would need to be distributed in template form, e.g. amavisd.conf.dist, with macros inserted in them for substitution by the install script, e.g. "%%BLOWFISH_KEY_PATH%%", etc.