#!/bin/bash
[% c("var/set_default_env") -%]
distdir="/var/tmp/dist/[% project %]"
mkdir -p "$distdir"
tar xjf [% c('input_files_by_name/SDK') %]
mv MacOSX10.11.sdk "$distdir/"
tar xf [% c('input_files_by_name/clang') %]
mv clang "$distdir/clang"
tar -C $distdir -xf [% c('input_files_by_name/cctools') %]
cd $distdir/cctools/bin
ln -s ../../clang/bin/clang x86_64-apple-darwin11-clang
ln -s ../../clang/bin/clang++ x86_64-apple-darwin11-clang++

cd "/var/tmp/dist"
[% c('tar', {
   tar_src => [ project ],
   tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
}) %]
