#!/bin/bash

set -eo pipefail

dpkg-source -x ~/source/<%= @dscfilename %>
builddir=$(echo */)
cd ${builddir}
dpkg-buildpackage -uc -us<%= (@buildpackage_args.map { |x| " " + x}).join("") %> 2>&1 | tee /build/<%= @dscfile.package %>_<%= @dscfile.version %>_`dpkg-architecture -qDEB_BUILD_ARCH`.build
cd ..
rm -rf ${builddir}
