#!/usr/bin/env bash
set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"

# Defaults suitable for automation
: "${CLEAN:=1}"
: "${PREFIX:=/usr/local/imap}"

./scripts/apply-patches.sh
CLEAN="$CLEAN" ./scripts/build.sh
PREFIX="$PREFIX" ./scripts/install.sh
