# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: William Rea <sillywilly@gmail.com>

pkgname=grsync
pkgver=1.2.6
pkgrel=4
pkgdesc="GTK+ GUI for rsync to synchronize folders, files and make backups"
arch=('x86_64')
url="http://www.opbyte.it/grsync/"
license=('GPL')
depends=('gtk3' 'rsync')
makedepends=('intltool')
source=(http://www.opbyte.it/release/$pkgname-$pkgver.tar.gz
        grsync.appdata.xml
        gtk3-port.patch
        use-themed-icon.patch)
sha256sums=('66d5acea5e6767d6ed2082e1c6e250fe809cb1e797cbbee5c8e8a2d28a895619'
            '5dee994cafbcf8adfda34767cbd60f7eb2039bdeccab2dfd879f045bd11fb9fd'
            '96d8911ee969b943ae0c69896d3d95271e9a794bfd8c8ce865282cd0c13011eb'
            '490108a9b65750162786f9aa230668736502477ce260ad1948f9d0124d5fb207')

prepare() {
  cd $pkgname-$pkgver

  # Port to GTK+ 3
  patch -Np1 -i ../gtk3-port.patch

  # Use themed icon
  patch -Np1 -i ../use-themed-icon.patch

  autoreconf -fi
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --disable-unity
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 ../$pkgname.appdata.xml "$pkgdir/usr/share/metainfo/$pkgname.appdata.xml"
}
