# $Id: PKGBUILD 131397 2015-04-15 09:42:26Z bgyorgy $
# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=deja-dup
pkgver=34.0
pkgrel=1
pkgdesc="Simple backup tool, that hides the complexity of backing up the Right Way and uses duplicity as the backend"
arch=('i686' 'x86_64')
url="https://launchpad.net/deja-dup"
license=('GPL')
depends=('duplicity' 'libpeas' 'libnotify' 'python2-gobject' 'gvfs')
makedepends=('cmake' 'vala' 'intltool' 'itstool' 'nautilus' 'gobject-introspection')
optdepends=('gnome-keyring: save passwords'
            'nautilus: backup extension'
            'python2-boto: Amazon S3 backend')
install=$pkgname.install
source=(http://launchpad.net/$pkgname/${pkgver%.*}/$pkgver/+download/$pkgname-$pkgver.tar.xz)
md5sums=('20791d5978f16f3ec456a0e51e6b0564')

prepare() {
  cd $pkgname-$pkgver

  # Python2 fix
  sed -i 's/\"python\", \"-c\"/\"python2\", \"-c\"/' libdeja/PythonChecker.vala
}

build() {
  cd $pkgname-$pkgver

  cmake . -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_INSTALL_PREFIX=/usr \
          -DCMAKE_INSTALL_SYSCONFDIR=/etc \
          -DCMAKE_INSTALL_LIBDIR=/usr/lib \
          -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib/$pkgname
  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="$pkgdir" install
}
