aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/tesseract/Makefile
blob: 4e3e62a01b41b4bd8a2d957443241c3a2985d6a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Created by: Andrew Pantyukhin <infofarmer@FreeBSD.org>
# $FreeBSD$

PORTNAME=   tesseract
PORTVERSION=    3.02.02
PORTREVISION=   3
CATEGORIES= graphics
MASTER_SITES=   GOOGLE_CODE
DISTFILES=  tesseract-ocr-${PORTVERSION}${EXTRACT_SUFX}

MAINTAINER= ports@FreeBSD.org
COMMENT=    Commercial quality open source OCR engine

OPTIONS_DEFINE= DOCS EXAMPLES

LICENSE=    APACHE20

LIB_DEPENDS=    liblept.so:graphics/leptonica

DIST_SUBDIR=    ${PORTNAME}
PROJECTHOST=    tesseract-ocr
WRKSRC=     ${WRKDIR}/tesseract-ocr

USES=       libtool
GNU_CONFIGURE=  yes
USE_LDCONFIG=   yes

CONFIGURE_ENV=  LIBLEPT_HEADERSDIR="${LOCALBASE}/include/leptonica"
LIBS+=      -L${LOCALBASE}/lib

DATADIR=    ${PREFIX}/share/tessdata
PORTDATA=   *
PORTDOCS=   AUTHORS ChangeLog README ReleaseNotes html
PORTEXAMPLES=   eurotext.tif phototest.tif

DOCS_DISTFILES= tesseract-ocr-${PORTVERSION}-doc-html${EXTRACT_SUFX}

post-patch:
    @${REINPLACE_CMD} -e 's|-O3 -DNDEBUG||' ${WRKSRC}/configure
    @${REINPLACE_CMD} -e \
    's|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g' \
    ${WRKSRC}/Makefile.in

post-install-DOCS-on:
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS:Nhtml} ${STAGEDIR}${DOCSDIR}
    cd ${WRKSRC}/doc && ${COPYTREE_SHARE} html ${STAGEDIR}${DOCSDIR}
post-install-EXAMPLES-on:
    @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
    @cd ${WRKSRC} && ${INSTALL_DATA} ${PORTEXAMPLES} ${STAGEDIR}${EXAMPLESDIR}

.include <bsd.port.mk>