# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=openssh-askpass
pkgver=9.7_p1
_myver=${pkgver%_*}${pkgver#*_}
pkgrel=0
pkgdesc="A passphrase dialog for OpenSSH and GTK"
url="http://www.openssh.org/portable.html"
arch="all"
license="BSD-3-Clause"
depends="openssh-client"
options="!check"
makedepends="gtk+3.0-dev"
source="https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-$_myver.tar.gz"
builddir="$srcdir"/openssh-$_myver/contrib

build() {
	make gnome-ssh-askpass3
}

package() {
	install -Dm755 gnome-ssh-askpass3 "$pkgdir"/usr/lib/ssh/gtk-ssh-askpass
	install -d "$pkgdir"/etc/profile.d
	cat > "$pkgdir"/etc/profile.d/openssh-askpass.sh <<- EOF
	SSH_ASKPASS=/usr/lib/ssh/gtk-ssh-askpass
	export SSH_ASKPASS
	EOF
}

sha512sums="
0cafc17d22851605a4a5495a1d82c2b3fbbe6643760aad226dbf2a25b5f49d4375c3172833706ea3cb6c05d5d02a40feb9a7e790eae5c4570dd344a43e94ca55  openssh-9.7p1.tar.gz
"
