# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: Mark Foxwell <fastfret79@archlinux.org.uk>
# Contributor: Nicolas Pouillard [https://nicolaspouillard.fr]
# Contributor: seschwar -- contact via Arch Linux forum or AUR
# Contributor: Ian Denhardt <ian@zenhack.net>

pkgname=alot
pkgver=0.8.1
pkgrel=1
pkgdesc='Terminal-based MUA for the notmuch mail system'
arch=(any)
url=https://github.com/pazz/alot
license=('GPL3')
depends=('desktop-file-utils' 'notmuch' 'python-configobj' 'python-gpgme'
         'python-magic' 'python-setuptools' 'python-twisted' 'python-urwid'
         'python-urwidtrees')
makedepends=('python-sphinx')
checkdepends=('python-mock')
source=("$url/archive/$pkgver/alot-$pkgver.tar.gz"
        "alot-$pkgver.tar.gz.asc::$url/releases/download/$pkgver/$pkgver.tar.gz.asc")
sha512sums=('bca4a01636594f0e71c6ea260d74cf26e74dfd7aca1ea7801714b4aaf9602ae7737769e77e3af0363ed2701df1494e0f87ce85b58c47a6380ad1a9098f8501d4'
            'SKIP')
validpgpkeys=('B7838D65FEE80DED1DCA494D94340367D7D6C5AA') # Patrick Totzke

# The Arch Linux package python-magic's egg calls itself "file-magic",
# as opposed to the python-magic on PyPI.
prepare() {
  cd alot-$pkgver
  sed -i 's/python-magic/file-magic/' setup.py
}

build() {
  cd alot-$pkgver
  python setup.py build
  make -C docs man
}

check() {
  cd alot-$pkgver
  python setup.py test
}

package() {
  cd alot-$pkgver
  python setup.py install --optimize=1 --root="$pkgdir" --skip-build
  install -Dm644 -t "$pkgdir"/usr/share/man/man1 docs/build/man/alot.1
  install -Dm644 -t "$pkgdir"/usr/share/applications extra/alot*.desktop
  install -Dm644 extra/completion/alot-completion.zsh \
    "$pkgdir"/usr/share/zsh/functions/_alot
  install -Dm644 -t "$pkgdir"/usr/share/alot/themes \
    extra/themes/{mutt,solarized_light,solarized_dark,sup,tomorrow}
}

# vim:set ts=2 sw=2 et:
