aboutsummaryrefslogtreecommitdiff
path: root/mail/thunderbird-dictionaries/Makefile
blob: f5769a404b55e8dea1aed4785c743f33fdff8630 (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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# Ports collection Makefile for:	thunderbird-dictionaries
# Date created:				19 February 2006
# Whom:					Matthew Luckie <mjl@luckie.org.nz>
# Based on:				multimedia/mplayer-skins
#
# $FreeBSD$
#

PORTNAME=	thunderbird-dictionaries
PORTVERSION=	20060220
PORTREVISION=	1
CATEGORIES=	mail
MASTER_SITES=	${MASTER_SITE_MOZDEV}
MASTER_SITE_SUBDIR=	dictionaries
DISTFILES=	# filled in later after options
DIST_SUBDIR=	thunderbird

MAINTAINER=	mjl@luckie.org.nz
COMMENT=	Dictionaries for Mozilla Thunderbird

RUN_DEPENDS=	thunderbird:${PORTSDIR}/mail/thunderbird

USE_ZIP=	yes
WRKSRC=		${WRKDIR}/dictionaries

# Dictionary files
AF_ZA_FILE=	spell-af-ZA.xpi
BG_FILE=	spell-bg.xpi
CA_FILE=	spell-ca.xpi
CS_FILE=	spell-cs.xpi
CY_GB_FILE=	spell-cy-GB.xpi
DA_FILE=	spell-da.xpi
DE_AT_FILE=	spell-de-AT.xpi
DE_CH_FILE=	spell-de-CH.xpi
DE_DE_FILE=	spell-de-DE.xpi
EL_FILE=	spell-el.xpi
EN_AU_FILE=	spell-en-AU.xpi
EN_CA_FILE=	spell-en-CA.xpi
EN_GB_FILE=	spell-en-GB.xpi
EN_NZ_FILE=	spell-en-NZ.xpi
ES_ES_FILE=	spell-es-ES.xpi
ES_MX_FILE=	spell-es-MX.xpi
FO_FILE=	spell-fo.xpi
FR_FR_FILE=	spell-fr-FR.xpi
GA_FILE=	spell-ga.xpi
GL_FILE=	spell-gl.xpi
HE_IL_FILE=	spell-he-IL.xpi
HR_FILE=	spell-hr.xpi
HU_FILE=	spell-hu.xpi
IA_FILE=	spell-ia.xpi
IT_FILE=	spell-it.xpi
LA_FILE=	spell-la.xpi
LT_FILE=	spell-lt.xpi
LV_LV_FILE=	spell-lv-LV.xpi
MI_FILE=	spell-mi.xpi
MS_FILE=	spell-ms.xpi
NB_FILE=	spell-nb.xpi
NL_FILE=	spell-nl.xpi
NN_FILE=	spell-nn.xpi
PL_FILE=	spell-pl.xpi
PT_FILE=	spell-pt.xpi
PT_BR_FILE=	spell-pt-BR.xpi
RO_FILE=	spell-ro.xpi
RU_FILE=	spell-ru.xpi
SK_FILE=	spell-sk.xpi
SL_FILE=	spell-sl.xpi
SV_FILE=	spell-sv.xpi
UK_FILE=	spell-uk.xpi
ZU_ZA_FILE=	spell-zu-ZA.xpi

# Dictionary options
OPTIONS=	DICT_ALL "all dictionaries" on
OPTIONS+=	DICT_AF_ZA "Afrikaans" off
OPTIONS+=	DICT_BG "Bulgarian" off
OPTIONS+=	DICT_CA "Catalan" off
OPTIONS+=	DICT_HR "Croatian" off
OPTIONS+=	DICT_CS "Czech" off
OPTIONS+=	DICT_DA "Danish" off
OPTIONS+=	DICT_NL "Dutch" off
OPTIONS+=	DICT_EN_AU "English (Australia)" off
OPTIONS+=	DICT_EN_CA "English (Canada)" off
OPTIONS+=	DICT_EN_NZ "English (New Zealand)" off
OPTIONS+=	DICT_EN_GB "English (United Kingdom)" off
OPTIONS+=	DICT_FR_FR "French (France)" off
OPTIONS+=	DICT_FO "Faroese" off
OPTIONS+=	DICT_GL "Galician (Spain)" off
OPTIONS+=	DICT_DE_AT "German (Austria)" off
OPTIONS+=	DICT_DE_DE "German (Germany)" off
OPTIONS+=	DICT_DE_CH "German (Switzerland)" off
OPTIONS+=	DICT_EL "Greek" off
OPTIONS+=	DICT_HE_IL "Hebrew" off
OPTIONS+=	DICT_HU "Hungarian" off
OPTIONS+=	DICT_IA "Interlingua" off
OPTIONS+=	DICT_GA "Irish" off
OPTIONS+=	DICT_IT "Italian" off
OPTIONS+=	DICT_LA "Latin" off
OPTIONS+=	DICT_LV_LV "Latvian" off
OPTIONS+=	DICT_LT "Lithuanian" off
OPTIONS+=	DICT_MS "Malay" off
OPTIONS+=	DICT_MI "Maori" off
OPTIONS+=	DICT_NB "Norwegian (Bokmal)" off
OPTIONS+=	DICT_NN "Norwegian (Nynorsk)" off
OPTIONS+=	DICT_PL "Polish" off
OPTIONS+=	DICT_PT "Portuguese (Portugal)" off
OPTIONS+=	DICT_PT_BR "Portuguese (Brasil)" off
OPTIONS+=	DICT_RO "Romanian" off
OPTIONS+=	DICT_RU "Russian" off
OPTIONS+=	DICT_ES_MX "Spanish (Mexico)" off
OPTIONS+=	DICT_ES_ES "Spanish (Spain)" off
OPTIONS+=	DICT_SK "Slovak" off
OPTIONS+=	DICT_SL "Slovenian" off
OPTIONS+=	DICT_SV "Swedish" off
OPTIONS+=	DICT_UK "Ukrainian" off
OPTIONS+=	DICT_CY_GB "Welsh" off
OPTIONS+=	DICT_ZU_ZA "Zulu (South Africa)" off

.include <bsd.port.pre.mk>

# For batch building, build all dictionaries
.if defined(BATCH)
WITH_DICT_ALL=yes
.endif

# All available dictionaries
ALLDICTS=	AF_ZA BG CA CS CY_GB DA DE_AT DE_CH DE_DE EL EN_AU EN_CA \
		EN_GB EN_NZ ES_ES ES_MX FO FR_FR GA GL HE_IL HR HU IA IT \
		LA LT LV_LV MI MS NB NL NN PL PT PT_BR RO RU SK SL SV \
		UK ZU_ZA

# this dictionary requires special handling in do-install
BG_DICT=	BG

# Build and install all dictionaries
.if defined(WITH_DICT_ALL)
.for f in ${ALLDICTS}
WITH_DICT_${f}=	yes
.endfor
.endif

# Figure out which distfiles to use, and how to construct the plist
.for f in ${ALLDICTS}
.ifdef(WITH_DICT_${f})
PLIST_SUB+=	${f}=""
HAVE_DICT=	yes
DISTFILES+=	${${f}_FILE}
.else
PLIST_SUB+=	${f}="@comment "
.endif
.endfor

# Extract the relevant distfiles
do-extract:
	@${MKDIR} ${WRKSRC}
.for f in ${ALLDICTS}
.ifdef(WITH_DICT_${f})
	@${UNZIP_CMD} -q ${DISTDIR}/${DIST_SUBDIR}/${${f}_FILE} -d ${WRKSRC}/${${f}_FILE}
.endif
.endfor

# Check to make sure that at least one dictionary was selected
do-build:
.if !defined(HAVE_DICT)
	@${ECHO_MSG} "No dictionary selected"
	@${FALSE}
.else
	@${DO_NADA}
.endif

# Install the requested dictionaries
do-install:
	@${MKDIR} ${PREFIX}/lib/thunderbird/components/myspell
.for f in ${ALLDICTS}
.ifdef(WITH_DICT_${f})
.if ${BG_DICT}==${f}
	@${INSTALL_DATA} \
		${WRKSRC}/${${f}_FILE}/bin/components/myspell/${${f}_FILE:S/spell-//:S/xpi//}aff \
		${PREFIX}/lib/thunderbird/components/myspell
	@${INSTALL_DATA} \
		${WRKSRC}/${${f}_FILE}/bin/components/myspell/${${f}_FILE:S/spell-//:S/xpi//}dic \
		${PREFIX}/lib/thunderbird/components/myspell
.else
	@${INSTALL_DATA} \
		${WRKSRC}/${${f}_FILE}/${${f}_FILE:S/spell-//:S/xpi//}aff \
		${PREFIX}/lib/thunderbird/components/myspell
	@${INSTALL_DATA} \
		${WRKSRC}/${${f}_FILE}/${${f}_FILE:S/spell-//:S/xpi//}dic \
		${PREFIX}/lib/thunderbird/components/myspell
.endif
.endif
.endfor

.include <bsd.port.post.mk>