# Contributor (Arch): Florian Walch <florian.walch@gmx.at>
# Maintainer (Arch): Robin Baumgartner <robin@baumgartners.ch>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
pkgname=trytond
pkgver=4.2.1
_pkgdir=4.2
pkgrel=1
pkgdesc="A three-tiers high-level general purpose application platform (server application)"
arch=('any')
url="http://www.tryton.org/"
license=('GPL3')
depends=('python2>=2.7' 'python2-lxml' 'python2-relatorio>=0.2.0'
         'python2-genshi>=0.5' 'python2-dateutil' 'python2-polib'
         'python2-sql>=0.4' 'python2-werkzeug' 'python2-wrapt')
optdepends=('python2-psycopg2: support for PostgreSQL database'
  'unoconv: support for document conversion'
  'python2-pydot: support for displaying workflow graphs'
  'python2-levenshtein'
  'python2-bcrypt')
makedepends=('python2-distribute')
backup=('etc/trytond.conf')
source=("http://downloads.tryton.org/$_pkgdir/$pkgname-$pkgver.tar.gz"
        'trytond.conf'
        'trytond.service')
md5sums=('ab3e92100e0229ca8a48f03f3dbc5a30'
         'db21177e78e6983d85feb14436f5a7ba'
         'c3318e663c17194d71f6ef4ded16b293')

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

package() {
  cd $srcdir/$pkgname-$pkgver
  python2 setup.py install --root=$pkgdir --optimize=1
  install -D -m640 "$srcdir/trytond.conf" "$pkgdir/etc/trytond.conf"
  install -D -m755 "$srcdir/trytond.service" "$pkgdir/usr/lib/systemd/system/trytond.service"
}
