# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ EAPI=5 PYTHON_COMPAT=( python2_7 ) LANGS=" ca ca@valencia cs da de el en_GB es fr gl hu it nb pl pt pt_BR sl sv uk zh_CN zh_HK zh_TW" inherit eutils gnome2 autotools python-single-r1 MY_PV=${PV%.*} DESCRIPTION="OCRFeeder is a document layout analysis and optical character recognition system. " HOMEPAGE="http://live.gnome.org/OCRFeeder" SRC_URI="http://ftp.gnome.org/pub/GNOME/sources/ocrfeeder/${MY_PV}/${P}.tar.xz" LICENSE="GPL-3" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE+="${LANGS// / linguas_}" REQUIRED_USE="${PYTHON_REQUIRED_USE}" RDEPEND="${PYTHON_DEPS} >=app-text/unpaper-0.3 >=app-text/ghostscript-gpl-8.63 dev-python/gtkspell-python[${PYTHON_USEDEP}] dev-python/lxml[${PYTHON_USEDEP}] >=dev-python/odfpy-0.7[${PYTHON_USEDEP}] >=dev-python/pyenchant-1.3[${PYTHON_USEDEP}] dev-python/pygobject:3[${PYTHON_USEDEP}] >=dev-python/pygoocanvas-0.12[${PYTHON_USEDEP}] >=dev-python/pygtk-2.13[${PYTHON_USEDEP}] >=dev-python/python-sane-1.1.7[${PYTHON_USEDEP}] dev-python/reportlab[${PYTHON_USEDEP}] virtual/python-imaging[${PYTHON_USEDEP}]" DEPEND="${PYTHON_DEPS} app-text/gnome-doc-utils[${PYTHON_USEDEP}] dev-libs/glib[${PYTHON_USEDEP}] >=dev-util/intltool-0.35.0" src_prepare() { # remove bundled odfpy epatch ${FILESDIR}/${PN}-0.8.1-pyodf-unbundle.patch rm -rf src/ocrfeeder/odf/ || die # create default configuration for zbar epatch ${FILESDIR}/${PN}-0.7.11-zbar-default-configuration.patch # linguas local langs x for x in ${LANGS}; do if use !linguas_${x}; then sed -e "/^${x}$/d" -i po/LINGUAS || die rm -rf po/${x}.po locale/${x} || die fi done eautoreconf gnome2_src_prepare } src_install() { default python_fix_shebang "${ED}"usr/bin } pkg_postinst() { einfo "You should install one OCR engine, supported" einfo "packages are app-text/cuneiform, app-text/gocr," einfo "app-text/ocrad and app-text/tesseract. If you" einfo "want support to bar codes then use media-gfx/zbar." }