SUMMARY = "Go service to check version info and broadcast hashicorp bulletins"
HOMEPAGE = "https://github.com/hashicorp/go-checkpoint"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b278a92d2c1509760384428817710378"

PKG_NAME = "github.com/hashicorp/go-checkpoint"
SRC_URI = "git://${PKG_NAME}.git"
SRCREV = "88326f6851319068e7b34981032128c0b1a6524d"

S = "${WORKDIR}/git"

do_install() {
    install -d ${D}${prefix}/local/go/src/${PKG_NAME}
    cp -a ${S}/* ${D}${prefix}/local/go/src/${PKG_NAME}/
}

SYSROOT_PREPROCESS_FUNCS += "go_checkpoint_sysroot_preprocess"

go_checkpoint_sysroot_preprocess () {
    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
    cp -a ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
}

FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"

Add bitbake recipe to build go-checkpoint
go-checkpoint: Add bitbake recipe to build go-checkpoint

Go-checkpoint is an internal go service created specifically for use
in Hashicorp software. It is used by Hashicorp services to check version
information and broadcast security bulletins to users. By default, this
package is necessary for consul to build, but can be removed from the
dependency chain by setting CHECKPOINT_DISABLE=1. Due to go-checkpoint being
designed to communicate specifically with Hashiicorp software and services,
it has no functionality when separated from these systems.

Signed-off-by: Christopher Braga <ecd7259f54548716af2f59ce4d8c3af5ea2e9f00@windriver.com>
