Changeset View
Changeset View
Standalone View
Standalone View
japanese/skk-jisyo/Makefile
Show All 19 Lines | |||||
SKKDIR?= share/skk | SKKDIR?= share/skk | ||||
SKK_JISYO_TYPE?=L M S | SKK_JISYO_TYPE?=L M S | ||||
USES= tar:bzip2 | USES= tar:bzip2 | ||||
NO_WRKSUBDIR= yes | NO_WRKSUBDIR= yes | ||||
EXTRACT_CMD= ${CP} | EXTRACT_CMD= ${CP} | ||||
EXTRACT_BEFORE_ARGS= -p | EXTRACT_BEFORE_ARGS= -p | ||||
EXTRACT_AFTER_ARGS= ${WRKDIR} | EXTRACT_AFTER_ARGS= ${WRKSRC} | ||||
PLIST_SUB+= SKKDIR=${SKKDIR} | PLIST_SUB+= SKKDIR=${SKKDIR} | ||||
.for type in ${SKK_JISYO_TYPE} | .for type in ${SKK_JISYO_TYPE} | ||||
DISTFILES+= SKK-JISYO.${type}.${PORTVERSION}.bz2 | DISTFILES+= SKK-JISYO.${type}.${PORTVERSION}.bz2 | ||||
PLIST_FILES+= ${SKKDIR}/SKK-JISYO.${type}${CDBSUFFIX} | PLIST_FILES+= ${SKKDIR}/SKK-JISYO.${type}${CDBSUFFIX} | ||||
.endfor | .endfor | ||||
.if defined(WITH_SKKJISYO_CDB) | .if defined(WITH_SKKJISYO_CDB) | ||||
CDBSUFFIX= .cdb | CDBSUFFIX= .cdb | ||||
.else | .else | ||||
CDBSUFFIX= #empty | CDBSUFFIX= #empty | ||||
NO_BUILD= yes | NO_BUILD= yes | ||||
.endif | .endif | ||||
post-extract: | post-extract: | ||||
@(cd ${WRKDIR}; ${BZIP2_CMD} -d *.bz2) | @(cd ${WRKSRC}; ${BZIP2_CMD} -d *.bz2) | ||||
.if defined(WITH_SKKJISYO_DELCOMMENTS) | .if defined(WITH_SKKJISYO_DELCOMMENTS) | ||||
# Strip comments in transtation candidates list. | # Strip comments in transtation candidates list. | ||||
# Candidate list starts with '/', and each candidate is concatinated by | # Candidate list starts with '/', and each candidate is concatinated by | ||||
# '/' (e.g., "/c1/c2/".) Each candidate may have a comment just after | # '/' (e.g., "/c1/c2/".) Each candidate may have a comment just after | ||||
# the candidate, leading a marker character ';' (e.g. /c3;comment/). | # the candidate, leading a marker character ';' (e.g. /c3;comment/). | ||||
do-patch: | do-patch: | ||||
.for type in ${SKK_JISYO_TYPE} | .for type in ${SKK_JISYO_TYPE} | ||||
${REINPLACE_CMD} -e '/^[^;]/s,;[^/]*/,/,g' -e '/^>/d' \ | ${REINPLACE_CMD} -e '/^[^;]/s,;[^/]*/,/,g' -e '/^>/d' \ | ||||
${WRKDIR}/SKK-JISYO.${type}.${PORTVERSION} | ${WRKSRC}/SKK-JISYO.${type}.${PORTVERSION} | ||||
.endfor | .endfor | ||||
.endif | .endif | ||||
.if defined(WITH_SKKJISYO_CDB) | .if defined(WITH_SKKJISYO_CDB) | ||||
# Convert plaintext jisyo data to CDB database by cdbmake. | # Convert plaintext jisyo data to CDB database by cdbmake. | ||||
# Each line consists of "+${klen},${dlen}:${key}->${data}", where klen/dlen | # Each line consists of "+${klen},${dlen}:${key}->${data}", where klen/dlen | ||||
# are length of key/data. A blank line at the end of data is required. | # are length of key/data. A blank line at the end of data is required. | ||||
# See also: <URL:http://cr.yp.to/cdb/cdbmake.html>. | # See also: <URL:http://cr.yp.to/cdb/cdbmake.html>. | ||||
do-build: | do-build: | ||||
.for type in ${SKK_JISYO_TYPE} | .for type in ${SKK_JISYO_TYPE} | ||||
LC_ALL=C ${AWK} '/^[^;]/ { \ | LC_ALL=C ${AWK} '/^[^;]/ { \ | ||||
s = substr($$0, index($$0, " ") + 1); \ | s = substr($$0, index($$0, " ") + 1); \ | ||||
print "+" length($$1) "," length(s) ":" $$1 "->" s; \ | print "+" length($$1) "," length(s) ":" $$1 "->" s; \ | ||||
} \ | } \ | ||||
END { \ | END { \ | ||||
print ""; \ | print ""; \ | ||||
}' \ | }' \ | ||||
< ${WRKDIR}/SKK-JISYO.${type}.${PORTVERSION} | \ | < ${WRKSRC}/SKK-JISYO.${type}.${PORTVERSION} | \ | ||||
${LOCALBASE}/bin/cdb -c -t - \ | ${LOCALBASE}/bin/cdb -c -t - \ | ||||
${WRKDIR}/SKK-JISYO.${type}.${PORTVERSION}${CDBSUFFIX} | ${WRKSRC}/SKK-JISYO.${type}.${PORTVERSION}${CDBSUFFIX} | ||||
.endfor | .endfor | ||||
.endif | .endif | ||||
do-install: | do-install: | ||||
${MKDIR} ${STAGEDIR}${PREFIX}/${SKKDIR} | ${MKDIR} ${STAGEDIR}${PREFIX}/${SKKDIR} | ||||
.for type in ${SKK_JISYO_TYPE} | .for type in ${SKK_JISYO_TYPE} | ||||
${INSTALL_DATA} ${WRKSRC}/SKK-JISYO.${type}.${PORTVERSION}${CDBSUFFIX} \ | ${INSTALL_DATA} ${WRKSRC}/SKK-JISYO.${type}.${PORTVERSION}${CDBSUFFIX} \ | ||||
${STAGEDIR}${PREFIX}/${SKKDIR}/SKK-JISYO.${type}${CDBSUFFIX} | ${STAGEDIR}${PREFIX}/${SKKDIR}/SKK-JISYO.${type}${CDBSUFFIX} | ||||
.endfor | .endfor | ||||
.include <bsd.port.mk> | .include <bsd.port.mk> |