#!/bin/bash
# Helper script that builds using libqalculate-dev from ../qalc-M.N
set -xe

VER="$(dpkg-parsechangelog -S Version | cut -d '.' -f -2)"
BUILDDIR="../qalc-${VER}"

if [[ ! -d "$BUILDDIR" ]]; then
    echo "Dependency directory $BUILDDIR does not exist"
    exit 1
fi
sbuild --build-dir="$BUILDDIR" --extra-package="$BUILDDIR" --no-clean-source "$@"
