This page is a sort of 'code style guide' for working with Baserock Definitions.

Shell commands

When writing shell commands in configure-commands, build-commands, etc, follow the usual good shell programming practices. Especially, remember to quote any expansion of shell variables, unless you know you mustn't and that it's OK not to quote. This includes variables like DESTDIR and PREFIX: Morph does not guarantee they don't contain whitespace or other characters that matter to the shell. Thus, write commands like this:

configure-commands:
- ./configure --prefix="$PREFIX"
install-commands:
- make "DESTDIR=$DESTDIR" install

In install-commands, if you need to install individual files or create directories, it's usually best to use the command install instead of cp or mkdir. install doesn't obey the umask setting, whereas cp and mkdir do, and the result may be wrong permissions set. For example:

install-commands:
- install -D "$DESTDIR/$PREFIX/share/man/man1"
- install -m 0644 *.1 "$DESTDIR/$PREFIX/share/man/man1"

If in doubt, ask for a review on, say, the Baserock IRC channel.