# $Id: PKGBUILD 229576 2015-01-19 09:53:41Z jgc $
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Michel Brabants <michel.linux@tiscali.be>

pkgname=seahorse
pkgver=3.14.0
pkgrel=2
pkgdesc="GNOME application for managing PGP keys."
arch=(i686 x86_64)
license=(GPL)
url="http://projects.gnome.org/seahorse/"
depends=(gtk3 gcr libsecret libsoup gpgme desktop-file-utils hicolor-icon-theme dconf)
makedepends=(libldap intltool yelp-tools gobject-introspection openssh libsm vala)
optdepends=('openssh: SSH support')
provides=(x11-ssh-askpass)
options=('!emptydirs')
groups=(gnome-extra)
install=seahorse.install
source=(http://ftp.gnome.org/pub/GNOME/sources/$pkgname/${pkgver:0:4}/$pkgname-$pkgver.tar.xz
        0001-Don-t-hide-GtkBuilder-errors.patch
        0002-ssh-generation-Fix-invalid-ui-file.patch
        0003-Remove-more-invalid-properties.patch
        gpg-2.1.patch
        seahorse-ssh-askpass.sh)
sha256sums=('2ea22830f5af1a11fadbdd8da6b34513410f2c371d9ec75fbf9b9b2d9177fc8a'
            '302ed86a8848d5e1c5931173696301267ab7a14f5521a9b4895337b507f5baf8'
            'd19b38972612823dd203aefa51782c21f0b3c8e905ab1cb71fdf15950f11eecc'
            '2217f60541e37ba49072fe17f6354fd6ba1bfa0d2958a6c7b2e7fd472063ea69'
            '491cacc029e6eac1c13b7808806cc45b49413570e73e1fa7668c28efe10427a0'
            '400ea9a6084acc93f1dbd4223b95622bbd48071b763063328efba00de378b68c')

prepare() {
  cd "$pkgname-$pkgver"
  patch -Np1 -i ../0001-Don-t-hide-GtkBuilder-errors.patch
  patch -Np1 -i ../0002-ssh-generation-Fix-invalid-ui-file.patch
  patch -Np1 -i ../0003-Remove-more-invalid-properties.patch
  
  # Quick fix for now
  patch -Np1 -i ../gpg-2.1.patch

  autoreconf -fi
}

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
      --enable-ldap --enable-hkp \
      --disable-schemas-compile
  make
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
  install -Dm755 "$srcdir/seahorse-ssh-askpass.sh" \
    "$pkgdir/etc/profile.d/seahorse-ssh-askpass.sh"
}
