# Contributor: omni <omni@gitlab.alpinelinux.org>
# Maintainer: omni <omni@gitlab.alpinelinux.org>
pkgname=dog
pkgver=0.1.0
pkgrel=5
pkgdesc="dog is a command-line DNS client"
url="https://github.com/ogham/dog"
arch="x86_64 armv7 armhf aarch64 ppc64le x86 loongarch64"
license="EUPL-1.2"
makedepends="cargo openssl-dev cargo-auditable"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ogham/dog/archive/v$pkgver.tar.gz
	openssl3.patch
	cargo-update-libc-lfs64.patch
	"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm0755 target/release/$pkgname -t "$pkgdir"/usr/bin
	install -Dm0644 man/dog.1.md -t "$pkgdir"/usr/share/doc/"$pkgname"
	install -Dm0644 LICENCE -t "$pkgdir"/usr/share/licenses/"$pkgname"
}

sha512sums="
03af5414b995710d22ea19bdbf382def4e53ae2870f396b4103546743c9cafcc445ee0819b6c8b7f435793fead5ebd03f091be89293a32847868a5544b4bc0e5  dog-0.1.0.tar.gz
ca5b81388b1c671a80250bc84da87cf19acdd92c290645c7842a1893e79f71e05f545564818a14e6b35701aed6f57d4fe47249934b69fd831f554d5885f82ec8  openssl3.patch
0a0782c3d992fb0f849d34db12c22e328a86a899f6d6e92f2ae771b6c3d278747b0a710e14bca09373d82cfc0fbb8b34c306e0db7b7c65a921f598f5f5d4b615  cargo-update-libc-lfs64.patch
"
