
Shipwright::Manual::CustomizeBuild - Customize the build method for a distribution

There are currently two ways to build a dist: through a perl script (dists/foo/build.pl) which allows for heavy customization, or using a list of tagged commands (dists/foo/build), which is simpler but less customizable.
The script dists/foo/build.pl has higher precedence, so if both dists/foo/build.pl and dists/foo/build exist, the former will be used.
When executing build.pl for the dist foo, the current working directory will be dists/foo
The script will be run with a list of arguments (the format is designed to be easily extracted with Getopt::Long):
The base directory where the vessel is to be built to.
e.g.
--install-base '/tmp/test-xxxxxx/test'
A list of flags, joined by comma. (See Shipwright::Manual::UsingFlags for more information.)
e.g.
--flags default,mysql
Whether to skip running tests or not.
If any test fails, whether to go on or just die.
If run with this argument,
the script should do the clean work instead of the install work.
This is a text file; each line should be either blank or use the format type: command.
The command will be executed line by line,
and the current working directory for building the dist foo will be dists/foo.
In a normal build script, the following types of commands are specified: configure, make, install, clean, and sometimes test. Their functions should be self-explanatory for anyone familiar with building perl modules.
Three template substitutions are available for use in the command: %%PERL%%, %%PERL_ARCHNAME%% and %%INSTALL_BASE%%. These can be used in cases where the path to perl, the perl archname (e.g. 'i486-linux-gnu-thread-multi'), or the base install path are needed, since they are not known beforehand.
There are two special types: test and clean.
If executed with --skip-test,
this command won't be executed.
If executed with --force,
even if this command fails the build will continue.
If executed with --clean,
all commands will be skipped except this one.
