aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/ocre/Makefile
blob: 17f2a87241c2c0d876393633cb3473446fc541f0 (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
53
54
# New ports collection makefile for:    ocre
# Date created:     11 June 2007
# Whom:         Andrew Pantyukhin <infofarmer@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   ocre
PORTVERSION=    0.028
CATEGORIES= graphics
MASTER_SITES=   ftp://lem.eui.upm.es/pub/ocre/ CENKES
DISTNAME=   ${PORTNAME}_v${DISTVERSION:S/./_/}
EXTRACT_SUFX=   .tgz

MAINTAINER= infofarmer@FreeBSD.org
COMMENT=    Simple optical character recognition solution

LIB_DEPENDS=    aspell.16:${PORTSDIR}/textproc/aspell
RUN_DEPENDS=    display:${PORTSDIR}/graphics/ImageMagick \
        ispell:${PORTSDIR}/textproc/ispell \
        gnuplot:${PORTSDIR}/math/gnuplot

USE_GETTEXT=    yes
USE_GNOME=  gtk20
USE_GMAKE=  yes
WRKSRC=     ${WRKDIR}/v${DISTVERSION}
MAN1=       ${PORTNAME}.1
MANLANG=    "" es

post-patch:
    @${GREP} -rl /usr/share ${WRKSRC}|${XARGS} ${REINPLACE_CMD} -e\
        's|/usr/share/ocre|${DATADIR}|;s|/usr/share/locale|${PREFIX}/share/locale|'
    @${GREP} -rl DESTDIR ${WRKSRC}|${XARGS} ${REINPLACE_CMD} -e\
        '/^DESTDIR/s|/usr|${PREFIX}|'
    @${GREP} -rl /usr/bin ${WRKSRC}|${XARGS} ${REINPLACE_CMD} -e\
        's|/usr/bin|${LOCALBASE}/bin|'
    @${REINPLACE_CMD} -Ee 's|/usr/include|${LOCALBASE}/include|g;\
        s|/usr/lib/([a-z0-9.-]+)/include|${LOCALBASE}/include/\1|g;\
        s|opcionesp.h||'\
        ${WRKSRC}/ddepend
    @${REINPLACE_CMD} -e 's|, sys_nerr||' ${WRKSRC}/src/errors.c
    @${REINPLACE_CMD} -e 's|gcc|${CC}|;s|-O2|${CFLAGS}|' ${WRKSRC}/Makefile

do-install:
    @${INSTALL} -d ${DATADIR}/
    @${INSTALL} -d ${MAN1PREFIX}/man/es/man1/
    @${TAR} xof ${WRKSRC}/ocre-decsWood-${DISTVERSION}.tgz -C ${DATADIR}/
    @${CHMOD} -h 755 ${DATADIR}/decsWood
    @${INSTALL_PROGRAM} ${WRKSRC}/ocre ${PREFIX}/bin/
    @${INSTALL_MAN} ${WRKSRC}/ocre.1 ${MAN1PREFIX}/man/man1/
    @${INSTALL_MAN} ${WRKSRC}/ocre-es.1 ${MAN1PREFIX}/man/es/man1/ocre.1
    @${INSTALL_DATA} ${WRKSRC}/po/es.mo ${PREFIX}/share/locale/es/LC_MESSAGES/ocre.mo

.include <bsd.port.mk>