# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Maintainer: Brett Cornwall <ainola@archlinux.org>
# Contributor: Simon Zimmermann <simon@insmo.com>
# Contributor: Daniel M. Capella <polyzen@archlinux.org>

pkgname=pass
pkgver=1.7.4
pkgrel=5
pkgdesc='Stores, retrieves, generates, and synchronizes passwords securely'
arch=(any)
url='https://www.passwordstore.org/'
license=('GPL2')
depends=('bash' 'gnupg' 'tree')
checkdepends=('git')
makedepends=('git')
optdepends=('git: for Git support'
            'dmenu: for passmenu'
            'xdotool: to type passwords with passmenu'
            'ydotool: to type passwords with passmenu (wayland)'
            'qrencode: for QR code support'
            'vim-plugin-runtime: for redact_pass.vim'
            'xclip: for clipboard support on X11'
            'wl-clipboard: for clipboard support on Wayland'
            'pinentry'
            'gtk2: pinentry backend (gtk2)'
            'gcr: pinentry backend (gnome3)'
            'qt5-x11extras: pinentry backend (qt)'
            'kwayland5: pinentry backend (qt)'
)
replaces=('passmenu')
provides=('passmenu')
conflicts=('passmenu')
source=("git+https://git.zx2c4.com/password-store?signed#tag=${pkgver}")
sha256sums=('SKIP')
validpgpkeys=('AB9942E6D4A4CFC3412620A749FC7012A5DE03AE') # Jason A. Donenfeld

check() {
  cd "${srcdir}/password-store"
  make test
}

package() {
  cd "${srcdir}/password-store"
  make DESTDIR="${pkgdir}" WITH_ALLCOMP=yes install

  install -Dm0755 -t "${pkgdir}/usr/bin" contrib/dmenu/passmenu
  install -Dm0644 -t "${pkgdir}/usr/share/vim/vimfiles/plugin" \
    contrib/vim/redact_pass.vim
}
