dev-php/PEAR-Console_CommandLine: Pure PHP code stable on all arches
[gentoo.git] / app-text / gocr / gocr-0.50.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=4
5
6 DESCRIPTION="An OCR (Optical Character Recognition) reader"
7 HOMEPAGE="http://jocr.sourceforge.net"
8 SRC_URI="http://www-e.uni-magdeburg.de/jschulen/ocr/${P}.tar.gz"
9
10 LICENSE="GPL-2"
11 SLOT="0"
12 KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
13 IUSE="doc scanner tk"
14
15 DEPEND=">=media-libs/netpbm-9.12
16         doc? ( >=media-gfx/transfig-3.2 app-text/ghostscript-gpl )
17         tk? ( dev-lang/tk )"
18 RDEPEND="${DEPEND}
19         tk? (
20                 media-gfx/xli
21                 scanner? ( media-gfx/xsane )
22         )"
23
24 src_compile() {
25         local mymakes="src man"
26
27         use doc && mymakes="${mymakes} doc examples"
28
29         emake ${mymakes}
30 }
31
32 src_install() {
33         emake DESTDIR="${D}" prefix="${EPREFIX}/usr" exec_prefix="${EPREFIX}/usr" install
34         dodoc AUTHORS BUGS CREDITS HISTORY RE* TODO
35
36         # remove the tk frontend if tk is not selected
37         use tk || rm "${ED}"/usr/bin/gocr.tcl
38         # and install the documentation and examples
39         if use doc ; then
40                 dodoc doc/gocr.html doc/examples.txt doc/unicode.txt
41                 insinto /usr/share/doc/${PF}/examples
42                 doins "${S}"/examples/*.{fig,tex,pcx}
43                 docompress -x /usr/share/doc/${PF}/examples
44         fi
45 }