updated on Sun Jan 15 04:04:02 UTC 2012
[aur-mirror.git] / ocropy-hg / PKGBUILD
blob2a2d01de18781f7515d921534aae34487175357c
1 # Maintainer: Ilya Mezhirov <mezhirov at iupr dot com>
2 # Contributor: MTsoul
4 pkgname=ocropy-hg
5 pkgver=111
6 pkgrel=1
7 pkgdesc="Python part of OCRopus: top-level scripts"
8 arch=('any')
9 url="http://code.google.com/p/ocropus/"
10 license=('APACHE')
11 makedepends=('mercurial' 'python2')
12 depends=('ocroswig-hg' 'python-scipy' 'python-matplotlib')
13 conflicts=('ocropy')
14 source=()
15 md5sums=()
18 _hgroot="https://ocropy.ocropus.googlecode.com/hg/"
19 _hgrepo="ocropy"
21 build() {
22     cd "$srcdir"
23     msg "Connecting to Mercurial server...."
25     if [ -d $_hgrepo ] ; then
26         cd $_hgrepo
27         hg pull -u || return 1
28         msg "The local files are updated."
29     else
30         hg clone $_hgroot $_hgrepo || return 1
31     fi
33     msg "Mercurial checkout done or server timeout"
35     rm -rf "$srcdir/$pkgname-build"
36     cp -r "$srcdir/$_hgrepo" "$srcdir/$pkgname-build"
37     cd "$srcdir/$pkgname-build"
39     msg "fixing sources with sed..."
40     find -name 'ocropus-*' -or -name '*.py' |
41         while read filename
42         do
43         {
44             sed -i 's|/usr/local/share/|/usr/share/|g; s|/usr/bin/env python$|/usr/bin/env python2|; s|/usr/bin/python$|/usr/bin/python2|' $filename
45         }
46         done
48     msg "running setup.py"
49     python2 setup.py install --root=$pkgdir