# Template file for 'scaleway-cli'
pkgname=scaleway-cli
version=2.45.0
revision=1
build_style=go
go_import_path=github.com/scaleway/scaleway-cli/v2
go_package=github.com/scaleway/scaleway-cli/v2/cmd/scw
go_ldflags="-X main.Version=${version} -X main.GitBranch=${version} -X main.GitCommit=${version}"
short_desc="Interact with the Scaleway API from the command line"
maintainer="Sébastien Pondichy <sebastien.pondichy@gmail.com>"
license="MIT"
homepage="https://github.com/scaleway/scaleway-cli"
distfiles="https://github.com/scaleway/scaleway-cli/archive/v${version}.tar.gz"
checksum=8c9d56d752d06e35abccb0f626e7df2418a17a22b27cb1a49a2638370f0f2c83
# Tests fail when run on i686
make_check="no"

pre_build() {
	local _date
	if [ "$SOURCE_DATE_EPOCH" ]; then
		_date="$(date --utc --date "@SOURCE_DATE_EPOCH" "+%Y-%m-%d")"
		go_ldflags+=" -X main.BuildDate=${_date}"
	fi
}

post_install() {
	vdoc README.md README
	vlicense LICENSE
}
