# $Id: PKGBUILD 108224 2014-03-25 03:13:07Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contrinutor: shining <shiningxc@gmail.com>
# Contributor: phillid <dbphillipsnz _at_thingy_that_swirly_a_symbol gmaildott comm>

_pypiname=pydot
pkgname=python2-$_pypiname
pkgver=1.0.28
pkgrel=3
pkgdesc="Python interface to Graphviz's Dot language"
arch=('any')
url="http://code.google.com/p/pydot/"
license=('MIT')
provides=("pydot=$pkgver")
conflicts=('pydot')
replaces=('pydot')
depends=('python2-pyparsing' 'graphviz')
makedepends=('python2-setuptools')
source=("http://pydot.googlecode.com/files/$_pypiname-$pkgver.tar.gz"
        "noncomma.patch")
md5sums=('c0a7a027176a62c412fd0f54951af692'
         'c709dccc04dfa1960b64fbd8aa7c5da7')

prepare() {
  cd $_pypiname-$pkgver
  # Fix compatibility with pyparsing >=2.0
  patch -p0 -i "${srcdir}/noncomma.patch"
}

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

package() {
  cd $_pypiname-$pkgver
  python2 setup.py install -O1 --install-data=/usr/share/pydot --root="$pkgdir"
  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
