# $Id: PKGBUILD 327637 2018-06-26 18:30:21Z heftig $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Maintainer: Gaetan Bisson <bisson@archlinux.org>

pkgname=pinentry
pkgver=1.1.0
pkgrel=4
pkgdesc='Collection of simple PIN or passphrase entry dialogs which utilize the Assuan protocol'
url='http://gnupg.org/related_software/pinentry/'
arch=('x86_64')
license=('GPL')
depends=('ncurses' 'libcap' 'libassuan' 'libsecret')
makedepends=('gtk2' 'qt5-base' 'gcr')
optdepends=('gtk2: gtk2 backend'
            'qt5-base: qt backend'
            'gcr: gnome3 backend')
validpgpkeys=('D8692123C4065DEA5E0F3AB5249B39D24F25E3B6')
source=("ftp://ftp.gnupg.org/gcrypt/${pkgname}/${pkgname}-${pkgver}.tar.bz2"{,.sig}
        'pinentry')
sha256sums=('68076686fa724a290ea49cdf0d1c0c1500907d1b759a3bcbfbec0293e8f56570'
            'SKIP'
            '4f51d67c8cf92f2bb535e07d2ba7dc8972535dae077c678102a34fb87f3b3a9c')

backup=('usr/bin/pinentry')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	./configure \
		--prefix=/usr \
		--enable-pinentry-tty \
		--enable-pinentry-curses \
		--enable-fallback-curses \
		--enable-pinentry-emacs \
		--enable-pinentry-gtk2 \
		--enable-pinentry-gnome3 \
		--enable-pinentry-qt \
		--enable-libsecret \

	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
	install ../pinentry "${pkgdir}/usr/bin/pinentry"
}
