#!/bin/bash
[% c("var/set_default_env") -%]
distdir=$(pwd)/dist
mkdir -p $distdir/[% project %]
tar -xf [% project %]-[% c('version') %].tar.[% c('compress_tar') %]
cd [% project %]-[% c('version') %]

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/[% project %] -S ..
make
make DESTDIR=$distdir install

cd $distdir
[% c('tar', {
        tar_src => [ project ],
        tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
        }) %]
