# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=ugm
pkgver=1.6.0
pkgrel=0
pkgdesc="A terminal based UNIX user and group browser"
url="https://github.com/ariasmn/ugm"
license="MIT"
arch="all"
makedepends="go"
options="!check" # no test files
source="$pkgname-$pkgver.tar.gz::https://github.com/ariasmn/ugm/archive/refs/tags/v$pkgver.tar.gz
	unbump_go.patch
	"

export GOFLAGS="$GOFLAGS -trimpath -mod=readonly -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build \
		-ldflags="-linkmode=external -extldflags \"$LDFLAGS\"" \
		-v .
}

package() {
	install -Dm0755 "$pkgname" -t "$pkgdir"/usr/bin
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
10707d761ebe172754bd661162aff2ac2badfad673b4716711a826d9314de0d65c98b977625e9db0c866dadebd7f179a8ffbab73e32c35e83a32ae34154d3d8f  ugm-1.6.0.tar.gz
d5a954a1687d98f2c4261683f155b9add45054a7420ae09bb6ef045efecfe88ba61c0a2eff2ecf9f6ad3ef13bad428578b3e8420d4cde2dafe07127af498b6cf  unbump_go.patch
"
