# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=pinentry
pkgver=1.3.0
pkgrel=1
pkgdesc='Collection of simple PIN or passphrase entry dialogs which utilize the Assuan protocol'
url='https://gnupg.org/related_software/pinentry/'
arch=('x86_64')
license=('GPL')
depends=(
  'glibc' 'ncurses' 'libassuan' 'libsecret' 'glib2'
  libsecret-1.so libncursesw.so libassuan.so libglib-2.0.so)
makedepends=('gtk2' 'qt6-base' 'qt5-x11extras' 'kwayland5' 'gcr')
optdepends=(
  'gtk2: gtk2 backend'
  'qt5-x11extras: qt backend'
  'kwayland5: qt backend'
  'gcr: gnome3 backend'
)
backup=('etc/pinentry/preexec')
source=("https://www.gnupg.org/ftp/gcrypt/${pkgname}/${pkgname}-${pkgver}.tar.bz2"{,.sig}
        'pinentry'
        'preexec')
sha256sums=('9b3cd5226e7597f2fded399a3bc659923351536559e9db0826981bca316494de'
            'SKIP'
            'af7c27139b20a7f1b9a227f3663abb21bb2b954523352b7844da27db1b0c1c86'
            'f428f08d77f1f7830eadb8435af282a833fc13d8b623b122eefd9d3b628bef90')
  'D8692123C4065DEA5E0F3AB5249B39D24F25E3B6' # Werner Koch (dist sig)
  '6DAA6E64A76D2840571B4902528897B826403ADA' # Werner Koch (dist signing 2020)
  'AC8E115BF73E2D8D47FA9908E98E9B2D19C6C8BD' # Niibe Yutaka (GnuPG Release Key)
)

build() {
  cd "${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 "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  install -Dm 755 ../pinentry -t "${pkgdir}/usr/bin"
  install -Dm 755 ../preexec -t "${pkgdir}/etc/pinentry"
}

# vim: ts=2 sw=2 et:
