#!/usr/bin/env modbuild


pbuild::prep() { :; }

pbuild::configure() { :; }

pbuild::compile() { :; }

pbuild::install() {
    # autoPROC is licence-gated: the Global Phasing snapshot cannot be wget'd
    # (download needs credentials), so stage it in this module dir first as
    # autoPROC_snapshot_<snapshot-date>.tar.gz, then unpack into $PREFIX. Not committed.
    # V_PKG (not V) so rebuilds as <date>-2, <date>-3 reuse the same staged tarball.
    mkdir -p "${PREFIX}"
    cd "${PREFIX}"
    tar -xf "${BUILDBLOCK_DIR}/autoPROC_snapshot_${V_PKG}.tar.gz" --strip-components=1

    # Install the PSI licence token at the software home so autoPROC is activated.
    cp "${BUILDBLOCK_DIR}/.licence" "${PREFIX}/.licence"
}
