Software build rules are placed in a so-called "skel" (short of
"skeleton"). By default, each skel is just a shell script, telling how
to get the source code, how to configure, compile and install it. If
there is any architecture-dependent issues, then you just write
necessary if-s in that skel.

The most crucial decision is installation destination of the skel. In
too many cases it can not be some temporary directory you create during
the build. Because much software tend to hardcode various configured
installation paths and it just won't work from other place. That is why,
like Nix does, skel is installed to some *permanent* path. If you have
got enough RAM, it could be just a directory in tmpfs.

Actually skels are not shell-scripts, but
=> redo
targets. So they could be written in any other language, even be
compiled programs. redo is used because of its built-in locking
capabilities and ability to run jobs in parallel.