1 # Created by: Shigeyuki FUKUSHIMA <shige@kuis.kyoto-u.ac.jp>
8 MASTER_SITES= LOCAL/matusita/${PORTNAME}
9 .if defined(WITH_SKKJISYO_CDB)
12 DIST_SUBDIR= skk-jisyo
14 MAINTAINER?= ports@FreeBSD.org
15 COMMENT?= Jisyo (dictionary) files for the SKK Japanese-input software
17 .if defined(WITH_SKKJISYO_CDB)
18 BUILD_DEPENDS= ${LOCALBASE}/bin/cdb:databases/tinycdb
27 EXTRACT_BEFORE_ARGS= -p
28 EXTRACT_AFTER_ARGS= ${WRKSRC}
29 PLIST_SUB+= SKKDIR=${SKKDIR}
30 .for type in ${SKK_JISYO_TYPE}
31 DISTFILES+= SKK-JISYO.${type}.${PORTVERSION}.bz2
32 PLIST_FILES+= ${SKKDIR}/SKK-JISYO.${type}${CDBSUFFIX}
35 .if defined(WITH_SKKJISYO_CDB)
43 @(cd ${WRKSRC}; ${BZIP2_CMD} -d *.bz2)
45 .if defined(WITH_SKKJISYO_DELCOMMENTS)
46 # Strip comments in transtation candidates list.
47 # Candidate list starts with '/', and each candidate is concatinated by
48 # '/' (e.g., "/c1/c2/".) Each candidate may have a comment just after
49 # the candidate, leading a marker character ';' (e.g. /c3;comment/).
51 .for type in ${SKK_JISYO_TYPE}
52 ${REINPLACE_CMD} -e '/^[^;]/s,;[^/]*/,/,g' -e '/^>/d' \
53 ${WRKSRC}/SKK-JISYO.${type}.${PORTVERSION}
57 .if defined(WITH_SKKJISYO_CDB)
58 # Convert plaintext jisyo data to CDB database by cdbmake.
59 # Each line consists of "+${klen},${dlen}:${key}->${data}", where klen/dlen
60 # are length of key/data. A blank line at the end of data is required.
61 # See also: <URL:http://cr.yp.to/cdb/cdbmake.html>.
63 .for type in ${SKK_JISYO_TYPE}
64 LC_ALL=C ${AWK} '/^[^;]/ { \
65 s = substr($$0, index($$0, " ") + 1); \
66 print "+" length($$1) "," length(s) ":" $$1 "->" s; \
71 < ${WRKSRC}/SKK-JISYO.${type}.${PORTVERSION} | \
72 ${LOCALBASE}/bin/cdb -c -t - \
73 ${WRKSRC}/SKK-JISYO.${type}.${PORTVERSION}${CDBSUFFIX}
78 ${MKDIR} ${STAGEDIR}${PREFIX}/${SKKDIR}
79 .for type in ${SKK_JISYO_TYPE}
80 ${INSTALL_DATA} ${WRKSRC}/SKK-JISYO.${type}.${PORTVERSION}${CDBSUFFIX} \
81 ${STAGEDIR}${PREFIX}/${SKKDIR}/SKK-JISYO.${type}${CDBSUFFIX}
84 .include <bsd.port.mk>