#!/bin/bash
[% c("var/set_default_env") -%]
distdir=/var/tmp/dist/[% project %]
[% IF c("var/linux") %]
  [% pc('gcc', 'var/setup', { compiler_tarfile => c('input_files_by_name/gcc'),
                              hardened_gcc => 0 }) %]
[% END -%]
mkdir /var/tmp/build
tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
cd /var/tmp/build/[% project %]-[% c('version') %]
./bootstrap --prefix=$distdir
make -j[% c("buildconf/num_procs") %]
make install
cd /var/tmp/dist
[% c('tar', {
        tar_src => [ project ],
        tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
    }) %]
