SUMMARY = "A Go DNS library with a granular approach"
HOMEPAGE = "https://github.com/miekg/dns"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=147353de6868a20caa562d26eab7b3c5"

PKG_NAME = "github.com/miekg/dns"
SRC_URI = "git://${PKG_NAME}.git"
SRCREV = "7864d445e5087e8d761dbefec43f29b92f7650eb"

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 += "dns_sysroot_preprocess"

dns_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 a bitbake recipe to build the go library dns
dns: Add a bitbake recipe to build the go library dns

Dns is a go library that implements a fully usable DNS. This library
is part of the dependency tree needed to build consul.

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