Added
Link Here
|
1 |
PORTNAME= jawiki |
2 |
DISTVERSION= g20240521 |
3 |
CATEGORIES= japanese |
4 |
.if defined(MECAB) |
5 |
PKGNAMEPREFIX= ja-mecab- |
6 |
.else |
7 |
PKGNAMEPREFIX= ja-skk- |
8 |
.endif |
9 |
|
10 |
MAINTAINER= mew14930xvi@inbox.lv |
11 |
COMMENT?= SKK dictionary from Wikipedia (Japanese edition) |
12 |
WWW= https://github.com/tokuhirom/jawiki-kana-kanji-dict |
13 |
|
14 |
LICENSE= MIT |
15 |
|
16 |
.if defined(MECAB) |
17 |
BUILD_DEPENDS= ${LOCALBASE}/libexec/mecab/mecab-dict-index:japanese/mecab \ |
18 |
${LOCALBASE}/${MECABDIR}/dicrc:japanese/mecab-ipadic-utf8 |
19 |
.else |
20 |
BUILD_DEPENDS= ${LOCALBASE}/bin/cdb:databases/tinycdb \ |
21 |
${LOCALBASE}/bin/nkf:japanese/nkf |
22 |
.endif |
23 |
|
24 |
USE_GITHUB= yes |
25 |
GH_ACCOUNT= tokuhirom |
26 |
GH_PROJECT= jawiki-kana-kanji-dict |
27 |
GH_TAGNAME= d62e22e |
28 |
NO_ARCH= yes |
29 |
|
30 |
.if defined(MECAB) |
31 |
MECABDIR= lib/mecab/dic/ipadic/ |
32 |
|
33 |
PLIST_FILES= ${MECABDIR}/${PORTNAME}.dic |
34 |
|
35 |
do-build: |
36 |
${LOCALBASE}/libexec/mecab/mecab-dict-index \ |
37 |
-d ${LOCALBASE}/${MECABDIR} -u ${WRKSRC}/${PORTNAME}.dic \ |
38 |
-f utf-8 -t utf-8 ${WRKSRC}/mecab-userdic.csv |
39 |
|
40 |
do-install: |
41 |
${MKDIR} ${STAGEDIR}${PREFIX}/${MECABDIR} |
42 |
${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.dic \ |
43 |
${STAGEDIR}${PREFIX}/${MECABDIR} |
44 |
.else |
45 |
SKKDIR= share/skk |
46 |
SKKDIC= SKK-JISYO.${PORTNAME} |
47 |
|
48 |
PLIST_FILES= ${SKKDIR}/${SKKDIC} ${SKKDIR}/${SKKDIC}.utf8 \ |
49 |
${SKKDIR}/${SKKDIC}.cdb |
50 |
do-build: |
51 |
${LOCALBASE}/bin/nkf -e --overwrite=.utf8 ${WRKSRC}/${SKKDIC} |
52 |
${AWK} '/^[^;]/ { \ |
53 |
s = substr($$0, index($$0, " ") + 1); \ |
54 |
print "+" length($$1) "," length(s) ":" $$1 "->" s; \ |
55 |
} \ |
56 |
END { \ |
57 |
print ""; \ |
58 |
}' < ${WRKSRC}/${SKKDIC} | \ |
59 |
${LOCALBASE}/bin/cdb -c -t - ${WRKSRC}/${SKKDIC}.cdb |
60 |
|
61 |
do-install: |
62 |
${MKDIR} ${STAGEDIR}${PREFIX}/${SKKDIR} |
63 |
${INSTALL_DATA} ${WRKSRC}/${SKKDIC}* ${STAGEDIR}${PREFIX}/${SKKDIR} |
64 |
.endif |
65 |
|
66 |
.include <bsd.port.mk> |