aboutsummaryrefslogtreecommitdiffstats
path: root/x11-fonts/fntsample/Makefile
blob: 6101829a3a587bd7b803bb6143c95336fe01b103 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Created by: Andrew Pantyukhin <infofarmer@FreeBSD.org>
# $FreeBSD$

PORTNAME?=  fntsample
PORTVERSION=    3.2
PORTREVISION?=  1
CATEGORIES?=    x11-fonts
MASTER_SITES=   SF/fntsample/fntsample/${PORTVERSION} http://unicode.org/Public/6.0.0/ucd/:unidata
DISTNAME=   fntsample-${PORTVERSION}
DISTFILES=  ${DISTNAME}${EXTRACT_SUFX} Blocks.txt:unidata
EXTRACT_ONLY=   ${DISTFILES:M*gz}

MAINTAINER= sunpoet@FreeBSD.org
COMMENT?=   Show Unicode coverage of a font

LICENSE=    GPLv3

USE_PERL5=  run
USES=       perl5

MAN1=       ${PORTNAME}.1

.if defined(PDFOUTLINE)
RUN_DEPENDS+=   p5-Locale-libintl>=0:${PORTSDIR}/devel/p5-Locale-libintl \
        p5-PDF-API2>=0:${PORTSDIR}/textproc/p5-PDF-API2

NO_BUILD=   yes

PLIST_FILES=    bin/${PORTNAME}
.else
BUILD_DEPENDS+= gawk:${PORTSDIR}/lang/gawk
RUN_DEPENDS+=   pdfoutline:${PORTSDIR}/textproc/pdfoutline

CONFIGURE_ARGS+=--disable-silent-rules \
        --with-unicode-blocks=${WRKSRC}/Blocks.txt
GNU_CONFIGURE=  yes
USE_GNOME=  pango
USES+=      gettext

PLIST_FILES=    bin/${PORTNAME} share/locale/uk/LC_MESSAGES/${PORTNAME}.mo
.endif

post-extract:
.if !defined(PDFOUTLINE)
    @${CP} ${DISTDIR}/${DIST_SUBDIR}/Blocks.txt ${WRKSRC}
.endif

post-patch:
.if defined(PDFOUTLINE)
    @${SED} -e 's|##PACKAGE##|fntsample|g ; \
         s|##LOCALEDIR##|${PREFIX}/share/locale|g' \
            ${WRKSRC}/${PORTNAME}.pl > ${WRKSRC}/${PORTNAME}
    @${SED} -e 's|@DATE@|2008-10-22|g' \
        ${WRKSRC}/${PORTNAME}.1.in > ${WRKSRC}/${PORTNAME}.1
.else
    @${REINPLACE_CMD} -e \
        's|^bin_SCRIPTS|#bin_SCRIPTS|g' ${WRKSRC}/Makefile.in
.endif

do-install:
.if defined(PDFOUTLINE)
    ${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
    ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${MANPREFIX}/man/man1
.else
    ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
    ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${MANPREFIX}/man/man1
    @${MKDIR} ${PREFIX}/share/locale/uk/LC_MESSAGES
    ${INSTALL_DATA} ${WRKSRC}/po/uk.gmo \
        ${PREFIX}/share/locale/uk/LC_MESSAGES/${PORTNAME}.mo
.endif

.include <bsd.port.mk>