# Template file for 'netdata-plugins-go'
pkgname=netdata-plugins-go
version=0.45.0
revision=3
build_style=go
go_import_path="github.com/netdata/go.d.plugin"
go_package="./cmd/godplugin"
depends="netdata"
short_desc="Netdata - Go Plugins"
maintainer="sn0w <me@sn0w.cx>"
license="GPL-3.0-or-later"
homepage="https://www.netdata.cloud/"
distfiles="https://github.com/netdata/go.d.plugin/archive/refs/tags/v${version}.tar.gz"
checksum=7062325e73520c501cc8aac4b298dec2471109120b8bb92e442e9394b4365c3b

do_install() {
	vmkdir usr/lib/netdata/conf.d
	vcopy config/go.d usr/lib/netdata/conf.d
	vcopy config/go.d.conf usr/lib/netdata/conf.d

	for f in ${GOPATH}/bin/* ${GOPATH}/bin/**/*; do
		if [ -f "$f" ] && [ -x "$f" ]; then
			vinstall "$f" 755 usr/lib/netdata/plugins.d go.d.plugin
			break
		fi
	done
}
