Eliminate the python build requirement

This moves the template into a shell script and does the formatting
work with `awk`. It's helpful on platforms where Python is not available
by default, e.g. *BSD.