aboutsummaryrefslogtreecommitdiffstats
path: root/x11-fonts/indic-ttf/Makefile
blob: 9d8ba442d4fc47e72e3411555ec0a0a09387cff7 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# New ports collection makefile for: ttf-indic-fonts
# Date created:        March 31 2008
# Whom:                Giuseppe Pilichi aka Jacula Modyun <jacula@gmail.com>
#
# $FreeBSD$
#

PORTNAME=   indic-ttf
PORTVERSION=    0.5.14
CATEGORIES= x11-fonts
MASTER_SITES=   DEBIAN/pool/main/t/ttf-indic-fonts
PKGNAMESUFFIX=  -fonts
DISTNAME=   ${PORTNAME:C|(.*)-(.*)|\2-\1|}${PKGNAMESUFFIX}_${PORTVERSION}

MAINTAINER= ports@FreeBSD.org
COMMENT=    A collection of truetype Indic fonts

BUILD_DEPENDS+= mkfontdir:${PORTSDIR}/x11-fonts/mkfontdir \
        mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale \
        fc-cache:${PORTSDIR}/x11-fonts/fontconfig
RUN_DEPENDS=    fc-cache:${PORTSDIR}/x11-fonts/fontconfig

WRKSRC=     ${WRKDIR}/${DISTNAME:S|_|-|}

NO_BUILD=   yes

OPTIONS_MULTI=  FONTS
OPTIONS_MULTI_FONTS=    BENGALI DEVANAGARI GUJARATI KANNADA ORIYA PUNJABI \
            TAMIL TELUGU
OPTIONS_DEFAULT=    BENGALI DEVANAGARI GUJARATI KANNADA ORIYA PUNJABI \
            TAMIL TELUGU

BENGALI_DESC=       BENGALI font set
DEVANAGARI_DESC=    DEVANAGARI font set
GUJARATI_DESC=      GUJARATI font set
KANNADA_DESC=       KANNADA font set
MALAYALAM_DESC=     MALAYALAM font set
ORIYA_DESC=     ORIYA font set
PUNJABI_DESC=       PUNJABI font set
TAMIL_DESC=     TAMIL font set
TELUGU_DESC=        TELUGU font set

.include <bsd.port.options.mk>

FONTSNAME=  ${PORTNAME}
FONTSDIR?=  ${PREFIX}/lib/X11/fonts/${FONTSNAME}

CONFAVAILDIR?=  ${PREFIX}/etc/fonts/conf.avail

MKFONTSCALE?=   ${LOCALBASE}/bin/mkfontscale
MKFONTSDIR?=    ${LOCALBASE}/bin/mkfontdir
FCCACHE?=   ${LOCALBASE}/bin/fc-cache -f -v

PLIST_SUB=  FONTSDIR=${FONTSDIR:S|${PREFIX}/||} \
        CONFAVAILDIR=${CONFAVAILDIR:S|${PREFIX}/||} \
        FCCACHE='${FCCACHE}'

SUB_FILES=  pkg-message
SUB_LIST=   FONTSDIR=${FONTSDIR} \
        CONFAVAILDIR=${CONFAVAILDIR}

.if ${PORT_OPTIONS:MBENGALI}
FONTS=      bengali
PLIST_SUB+= BENGALI=''
.else
PLIST_SUB+= BENGALI='@comment '
.endif

.if ${PORT_OPTIONS:MDEVANAGARI}
FONTS+=     devanagari
PLIST_SUB+= DEVANAGARI=''
.else
PLIST_SUB+= DEVANAGARI='@comment '
.endif

.if ${PORT_OPTIONS:MGUJARATI}
FONTS+=     gujarati
PLIST_SUB+= GUJARATI=''
.else
PLIST_SUB+= GUJARATI='@comment '
.endif

.if ${PORT_OPTIONS:MKANNADA}
FONTS+=     kannada
PLIST_SUB+= KANNADA=''
.else
PLIST_SUB+= KANNADA='@comment '
.endif

.if ${PORT_OPTIONS:MMALAYALAM}
FONTS+=     malayalam
PLIST_SUB+= MALAYALAM=''
.else
PLIST_SUB+= MALAYALAM='@comment '
.endif

.if ${PORT_OPTIONS:MORIYA}
FONTS+=     oriya
PLIST_SUB+= ORIYA=''
.else
PLIST_SUB+= ORIYA='@comment '
.endif

.if ${PORT_OPTIONS:MPUNJABI}
FONTS+=     punjabi
PLIST_SUB+= PUNJABI=''
.else
PLIST_SUB+= PUNJABI='@comment '
.endif

.if ${PORT_OPTIONS:MTAMIL}
FONTS+=     tamil
PLIST_SUB+= TAMIL=''
.else
PLIST_SUB+= TAMIL='@comment '
.endif

.if ${PORT_OPTIONS:MTELUGU}
FONTS+=     telugu
PLIST_SUB+= TELUGU=''
.else
PLIST_SUB+= TELUGU='@comment '
.endif

SUB_LIST+=  FONTS="${FONTS}"

do-install: install-fonts install-conf

install-fonts:

.for f in ${FONTS}
    ${MKDIR} ${FONTSDIR}/${f}
    ${INSTALL_DATA} ${WRKSRC}/ttf-${f}/*.ttf ${FONTSDIR}/${f}
    ${INSTALL_DATA} ${WRKSRC}/debian/ttf-${f}${PKGNAMESUFFIX}.copyright ${FONTSDIR}/${f}
    ${MKFONTSCALE} ${FONTSDIR}/${f} 2>/dev/null || ${TRUE}
    ${MKFONTSDIR} ${FONTSDIR}/${f} 2>/dev/null || ${TRUE}
.endfor

install-conf:
    ${MKDIR} ${CONFAVAILDIR}
.for f in ${FONTS}
    ${INSTALL_DATA} ${WRKSRC}/ttf-${f}/90-ttf-${f}${PKGNAMESUFFIX}.conf ${CONFAVAILDIR}/
.endfor

post-install:
    @${ECHO_MSG} "===> Running fc-cache"
    -${FCCACHE} ${FONTSDIR}
    @${ECHO_MSG}
    @${CAT} ${PKGMESSAGE}
    @${ECHO_MSG}

.include <bsd.port.mk>