pkgname=ocropy-hg pkgver=99 pkgrel=1 pkgdesc="Python bindings for ocropus" arch=('i686' 'x86_64') url="http://code.google.com/p/ocropus/" license=('APACHE') makedepends=('mercurial' 'python2') depends=('ocroswig-hg' 'python-scipy') _hgroot="https://ocropy.ocropus.googlecode.com/hg/" _hgrepo="ocropy" build() { cd "$srcdir" msg "Connecting to Mercurial server...." if [ -d $_hgrepo ] ; then cd $_hgrepo hg pull -u || return 1 msg "The local files are updated." else hg clone $_hgroot $_hgrepo || return 1 fi msg "Mercurial checkout done or server timeout" cd $srcdir/$_hgrepo find -name 'ocropus-*' -or -name '*.py' | while read filename do { sed 's|/usr/local/share/|/usr/share/|g; s|/usr/bin/env python$|/usr/bin/env python2|' $filename > $filename.sed mv $filename.sed $filename; } done python2 setup.py install --root=$pkgdir }