#!/bin/sh
set -e

DATE=$(date +%Y%m%d)
rm -f debian/changelog
DISTRO=${DEB_DISTRO:-"$(lsb_release -cs)"}
VERSION=0.1.${DATE}~${DISTRO}
EDITOR=true NAME="Darling build server" EMAIL=${DEB_EMAIL:-noreply@darlinghq.org} dch -u low -v ${VERSION} --create --distribution ${DISTRO} --package darling "Daily build"

ARG='-S'
if [ -e "../darling_${VERSION}.orig.tar.xz" ]; then
rm ../darling_${VERSION}.orig.tar.xz
fi
tar -cJf ../darling_${VERSION}.orig.tar.xz .

debuild --no-lintian -us -uc -S ${ARG}
