# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=tesseract-git
_sha=5f5e85e4a0827cf44f57bc87344d3fa15b067a75
pkgver=20170807
pkgrel=0
pkgdesc="Tesseract Open Source OCR Engine"
url="https://github.com/tesseract-ocr/tesseract"
arch="all"
license="Apache-2.0"
depends=""
makedepends="cmake leptonica-dev tiff-dev icu-dev cairo-dev automake autoconf
	libtool autoconf-archive pango-dev cairo-dev"
install=""
replaces="tesseract-ocr"
subpackages="$pkgname-dev $pkgname-training"
source="tesseract-$pkgver.tar.gz::https://github.com/tesseract-ocr/tesseract/archive/$_sha.tar.gz"
builddir="$srcdir/tesseract-$_sha"

build() {
        cd "$builddir"
        ./autogen.sh
        ./configure \
                --build=$CBUILD \
                --host=$CHOST \
                --prefix=/usr \
                --sysconfdir=/etc \
                --mandir=/usr/share/man \
                --infodir=/usr/share/info \
                --localstatedir=/var \
                --disable-static
        make
        make training
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

training() {
	cd "$builddir"
	make DESTDIR="$subpkgdir" training-install
}

sha512sums="ce88bb280931c9636d72f338e1e2d159333d281016d8c71ddeb11af79b3468349eabcc50885dfa363acc8508477b86c1e4480126bb5108cf1944093f116d9b41  tesseract-20170807.tar.gz"
