# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=doas-sudo-shim
# Note: This should be always lower than pkgver of the real sudo!
pkgver=0.1.2
pkgrel=0
pkgdesc="A shim for the sudo command that utilizes doas"
url="https://github.com/jirutka/doas-sudo-shim"
arch="noarch"
license="ISC"
depends="cmd:doas"
makedepends="asciidoctor doas"
subpackages="$pkgname-doc"
source="https://github.com/jirutka/doas-sudo-shim/archive/v$pkgver/doas-sudo-shim-$pkgver.tar.gz
	help-alpine.patch
	"
options="!check"  # no tests provided

build() {
	make man
}

package() {
	depends="$depends !sudo"  # this must not be defined on top-level
	provides="sudo-virt"
	provider_priority=1

	make install DESTDIR="$pkgdir" PREFIX=/usr
}

sha512sums="
86adc10f89ec7b5b2d8a8940f3aeb93499900cc90c28bbb2b9667f454ea79661e079c1156fb6d5d649f304d781eb01d8f5201b8e1f6b4dd35890e09fe7428142  doas-sudo-shim-0.1.2.tar.gz
86e2d7e7ac3bb855ce2677e2f86092facb6da2f8d4e6fc24149b9bf836590be17f340fba54b74fd24d280b79be6ed97d405f7ce2e972f2bb5d12cf6bfe0bc9f7  help-alpine.patch
"
