freebsd-ports/mail/thunderbird-dictionaries/Makefile
John Marino 8866cc102d mail/thunderbird-dictionaries: Rework (options invalid)
It is not valid to define PORT_OPTIONS variable directly (this is done
through OPTIONS_DEFINE and related variables) and definitely they can't
be modified after inclusions of bsd.port.pre.mk or bsd.port.options.mk
fragments.

Since the port needed to be reworked anyway, I simplified it a lot.  I
removed a shell command (with 3 pipes!) completely.  I saw several ways
to create ${ALLDICTS} with basic makefile techniques, but in the end
it wasn't even necessary.

I eliminated the "ALL" option.  It didn't make sense.  If "ALL" was set,
it would override the individual language options (leading to possible
confusion) and the "ALL" option was set by default, and then it even
checked PACKAGE_BUILDING to override the value to ALL again.  I have to
assume that it wasn't originally set up that way but changed over time.
Now only the language options are there and they are all "ON" by default.
It's simpler to disable languages than before (no need to deselect "ALL"
option first).

The <pre> and <post> inclusions were removed, they aren't necessary.
The PLIST substitutions are made with standard OPTIONS_SUB technique.

The work is verified by checking SELECTED_OPTIONS and DESELECTED_OPTIONS
which now show the correct values and the dependencies registered to the
built package now match the port.

Approved by:	infrastructure blanket (fix options)
2016-08-05 00:28:22 +00:00

69 lines
1.8 KiB
Makefile

# Created by: Matthew Luckie <mjl@luckie.org.nz>
# $FreeBSD$
PORTNAME= thunderbird-dictionaries
PORTVERSION= 20060220
PORTREVISION= 12
CATEGORIES= mail
MASTER_SITES= MOZDEV/dictionaries
DISTFILES= # filled in later after options
DIST_SUBDIR= thunderbird
MAINTAINER= mjl@luckie.org.nz
COMMENT= Dictionaries for Mozilla Thunderbird
RUN_DEPENDS= thunderbird>=6.0:mail/thunderbird
USES= zip:infozip
NO_BUILD= yes
WRKSRC= ${WRKDIR}/dictionaries
# All available dictionaries are listed in Makefile.dict
# Makefile.dict pulls in Makefile.options
.include "${.CURDIR}/Makefile.dict"
.include <bsd.port.options.mk>
# this dictionary requires special handling in do-install
BG_DICT= BG
# Figure out which distfiles to use, and how to construct the plist
.for f in ${ALLDICTS}
.if ${PORT_OPTIONS:M${f}}
DISTFILES+= ${${f}_FILE}
.endif
.endfor
# Extract the relevant distfiles
do-extract:
@${MKDIR} ${WRKSRC}
.for f in ${ALLDICTS}
.if ${PORT_OPTIONS:M${f}}
@${UNZIP_CMD} -q ${DISTDIR}/${DIST_SUBDIR}/${${f}_FILE} -d ${WRKSRC}/${${f}_FILE}
.endif
.endfor
# Install the requested dictionaries
do-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/thunderbird/dictionaries
.for f in ${ALLDICTS}
.if ${PORT_OPTIONS:M${f}}
.if ${BG_DICT}==${f}
${INSTALL_DATA} \
${WRKSRC}/${${f}_FILE}/bin/components/myspell/${${f}_FILE:S/spell-//:S/xpi//}aff \
${STAGEDIR}${PREFIX}/lib/thunderbird/dictionaries
${INSTALL_DATA} \
${WRKSRC}/${${f}_FILE}/bin/components/myspell/${${f}_FILE:S/spell-//:S/xpi//}dic \
${STAGEDIR}${PREFIX}/lib/thunderbird/dictionaries
.else
${INSTALL_DATA} \
${WRKSRC}/${${f}_FILE}/${${f}_FILE:S/spell-//:S/xpi//}aff \
${STAGEDIR}${PREFIX}/lib/thunderbird/dictionaries
${INSTALL_DATA} \
${WRKSRC}/${${f}_FILE}/${${f}_FILE:S/spell-//:S/xpi//}dic \
${STAGEDIR}${PREFIX}/lib/thunderbird/dictionaries
.endif
.endif
.endfor
.include <bsd.port.mk>