Tweak graphics/tesseract version 3.02.02_1
[dports.git] / graphics / tesseract / Makefile
1 # Created by: Andrew Pantyukhin <infofarmer@FreeBSD.org>
2 # $FreeBSD: graphics/tesseract/Makefile 338168 2013-12-30 20:55:18Z ohauer $
3
4 PORTNAME=       tesseract
5 PORTVERSION=    3.02.02
6 PORTREVISION=   1
7 CATEGORIES=     graphics
8 MASTER_SITES=   ${MASTER_SITE_GOOGLE_CODE}
9 DISTFILES=      tesseract-ocr-${PORTVERSION}${EXTRACT_SUFX}
10
11 MAINTAINER=     bf@FreeBSD.org
12 COMMENT=        Commercial quality open source OCR engine
13
14 LICENSE=        APACHE20
15
16 LIB_DEPENDS=    lept:${PORTSDIR}/graphics/leptonica
17
18 DIST_SUBDIR=    ${PORTNAME}
19 PROJECTHOST=    tesseract-ocr
20 WRKSRC=         ${WRKDIR}/tesseract-ocr
21
22 GNU_CONFIGURE=  yes
23 USE_LDCONFIG=   yes
24
25 CONFIGURE_ENV=  LIBLEPT_HEADERSDIR="${LOCALBASE}/include/leptonica" \
26                 LIBS="${PTHREAD_LIBS}"
27 LDFLAGS+=       -L${LOCALBASE}/lib
28
29 NO_STAGE=       yes
30 .include <bsd.port.options.mk>
31
32 .ifndef NOPORTDATA
33 DATADIR=        ${PREFIX}/share/tessdata
34 MAN1=           ambiguous_words.1 cntraining.1 combine_tessdata.1 dawg2wordlist.1 \
35                 mftraining.1 shapeclustering.1 tesseract.1 unicharset_extractor.1 \
36                 wordlist2dawg.1
37 MAN5=           unicharambigs.5 unicharset.5
38 PORTDATA=       *
39 .endif
40
41 .if ${PORT_OPTIONS:MDOCS}
42 PORTDOCS=       AUTHORS ChangeLog README ReleaseNotes html
43 .endif
44
45 .if ${PORT_OPTIONS:MDOCS} || make(makesum)
46 DISTFILES+=     tesseract-ocr-${PORTVERSION}-doc-html${EXTRACT_SUFX}
47 .endif
48
49 .if ${PORT_OPTIONS:MEXAMPLES}
50 PORTEXAMPLES=   eurotext.tif phototest.tif
51 .endif
52
53 post-patch:
54         @${REINPLACE_CMD} -e 's|-O3 -DNDEBUG||' ${WRKSRC}/configure
55         @${REINPLACE_CMD} -e \
56         's|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g' \
57         ${WRKSRC}/Makefile.in
58 .ifdef NOPORTDATA
59         @${FIND} ${WRKSRC} -type f -name 'Makefile.in' -print0 | ${XARGS} -0 \
60         ${REINPLACE_CMD} -e '\|^install-am:|,+1s|install-data-am||'
61 .endif
62
63 post-install:
64 .if ${PORT_OPTIONS:MDOCS}
65         @${MKDIR} ${DOCSDIR}
66         @cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS:Nhtml} ${DOCSDIR}
67         @cd ${WRKSRC}/doc && ${COPYTREE_SHARE} html ${DOCSDIR}
68 .endif
69 .if ${PORT_OPTIONS:MEXAMPLES}
70         @${MKDIR} ${EXAMPLESDIR}
71         @cd ${WRKSRC} && ${INSTALL_DATA} ${PORTEXAMPLES} ${EXAMPLESDIR}
72 .endif
73         @${ECHO_MSG} ""
74         @${CAT} ${PKGMESSAGE}
75         @${ECHO_MSG} ""
76
77 .include <bsd.port.mk>