# Contributor: Jakob Meier <comcloudway@ccw.icu>
# Maintainer: Jakob Meier <comcloudway@ccw.icu>
pkgname=xq
pkgver=1.2.4
pkgrel=5
pkgdesc="Command-line XML and HTML beautifier and content extractor"
url="https://github.com/sibprogrammer/xq"
arch="all"
license="MIT"
makedepends="go"
subpackages="$pkgname-doc"
source="https://github.com/sibprogrammer/xq/archive/v$pkgver/xq-$pkgver.tar.gz"
options="net"

export GOCACHE="$srcdir/go-build"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build
}

check() {
	go test -coverprofile=coverage.txt -covermode=atomic -v ./...
}

package() {
	install -Dm755 xq $pkgdir/usr/bin/xq
	install -Dm644 README.md "$pkgdir/usr/share/doc/xq/README"
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
	install -Dm644 docs/xq.man $pkgdir/usr/share/man/man1/xq.1
}

sha512sums="
bd8e5776f37b91007587f1b413540f6721bb0ce6b6f94bb848c428014b116c40a666e59cc2d69207af00c8cd4e7aa4308b4b9faed753dcc9bbb48db81a69c23c  xq-1.2.4.tar.gz
"
