# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Patrick Ulbrich <zulu99 at gmx . net>
# Contributor: rasmus <rasmus . pank at gmail . com>

pkgname=mailnag
pkgver=1.3.0
pkgrel=1
pkgdesc="Extensible mail notification daemon"
arch=('any')
url="https://github.com/pulb/mailnag"
license=('GPL')
depends=('gst-plugins-base' 'gtk3' 'libnotify' 'python2-dbus' 'python2-gobject' 'python2-xdg')
optdepends=('gnome-keyring: safe password storage in GNOME'
            'mailnag-goa-plugin: GNOME Online Accounts integration'
            'mailnag-gnome-shell: GNOME Shell integration')
source=("$pkgname-$pkgver::https://github.com/pulb/$pkgname/archive/v$pkgver.tar.gz"
        0001-Don-t-use-legacy-path-for-appdata-file.patch
        0001-Update-appdata-file-to-the-latest-standard.patch)
sha256sums=('3a81c1b5627557bad60357f430a1e4e8c455ae4a71b5764960a57d699abae532'
            'edf642f0488937086a9451515feb4db0e8b3d9e6c1ff6f6e896537992050c945'
            '006a11c846074d6683b01252afff5c780838d5da4a169fe5cae28d6f19c53dfd')

prepare() {
  cd $pkgname-$pkgver
  # Appstream fixes
  patch -Np1 -i ../0001-Don-t-use-legacy-path-for-appdata-file.patch
  patch -Np1 -i ../0001-Update-appdata-file-to-the-latest-standard.patch
}

build() {
  cd $pkgname-$pkgver
  python2 setup.py build
}

package() {
  cd $pkgname-$pkgver
  python2 setup.py install --root="$pkgdir" --optimize=1
}
