diff options
author | matusita <matusita@FreeBSD.org> | 2004-10-30 22:20:21 +0800 |
---|---|---|
committer | matusita <matusita@FreeBSD.org> | 2004-10-30 22:20:21 +0800 |
commit | dc26b3103c0ad9fd1f70087511d5b164a4a08eff (patch) | |
tree | c91d14f54eff96a9781854dd9be4ac0522499830 /japanese | |
parent | c9dc5f89ec8b06f715e74d7a86c2df4fdc0cc056 (diff) | |
download | freebsd-ports-gnome-dc26b3103c0ad9fd1f70087511d5b164a4a08eff.tar.gz freebsd-ports-gnome-dc26b3103c0ad9fd1f70087511d5b164a4a08eff.tar.zst freebsd-ports-gnome-dc26b3103c0ad9fd1f70087511d5b164a4a08eff.zip |
Take MAINTAINERship from ports@FreeBSD.org (again; I was the MAINTAINER
of this port), and completely rewrite this port in order to install
latest version of dictionaries with less costs.
Major changes are as follows:
* Set DISTFILES to my directory of MASTER_SITE_LOCAL. This directory
will contain monthly jisyo snapshot from the original distribution,
<URL:http://openlab.jp/skk/skk/dic/>. For less traffic, dictionary
files are bzip2(1)ed. Thanks to cron(8), I can update my MASTER_SITE_LOCAL
directory automatically -- you can see 200411 version of dictionary file
at Nov/01/2004 (yeah!).
* You can choose which size of dictionary files to be installed. Set
SKK_JISYO_TYPE to L, M, S, or any combination of these chars. Default
to 'L M S' so no files are disappeared with this commit.
* Introduce WITH_SKKJISYO_DELCOMMENTS, to delete annotations of any
dictionaries (at this time, only SKK-JISYO.L have annotations).
If you 1) don't want any annotations, 2) want to save disk space, or
3) have a client which doesn't aware annotations, use this option:
i.e., "make WITH_SKKJISYO_DELCOMMENTS=yes".
* Introduce WITH_SKKJISYO_CDB, to build CDB version of dictionaries.
In previsous version of ports, it is assumed that CDB version is
already made. However, it seems that the maintenance cost is not
so cheap; ports/japanese/skk-jisyo-cdb is broken at least two months.
I'm trying to contact the MAINTAINER of ports/japanese/skk-jisyo-cdb;
with this change, ports/japanese/skk-jisyo-cdb can be changed more
simple one.
* While I'm here, employ PLIST_FILES to simplify pkg-plist.
I've tested as much as possible including option combinations, "make
package", and pkg_add/delete. But if you find that I made a mistake,
please let me know.
Tested by: rushani
Suggestion from: nork
Diffstat (limited to 'japanese')
-rw-r--r-- | japanese/skk-jisyo/Makefile | 89 | ||||
-rw-r--r-- | japanese/skk-jisyo/distinfo | 12 | ||||
-rw-r--r-- | japanese/skk-jisyo/pkg-plist | 5 |
3 files changed, 78 insertions, 28 deletions
diff --git a/japanese/skk-jisyo/Makefile b/japanese/skk-jisyo/Makefile index f77fd180e47e..e26697624bb8 100644 --- a/japanese/skk-jisyo/Makefile +++ b/japanese/skk-jisyo/Makefile @@ -5,36 +5,89 @@ # $FreeBSD$ # -PORTNAME?= skk-jisyo -PORTVERSION?= 200408 +PORTNAME= skk-jisyo +PORTVERSION= 200410 CATEGORIES= japanese -MASTER_SITES?= http://www.tkd.ne.jp/~toru/skk/ -DISTFILES?= SKK-JISYO.L.${PORTVERSION}${SKK_JISYO_SUFFIX}.gz \ - SKK-JISYO.M.${PORTVERSION}${SKK_JISYO_SUFFIX}.gz \ - SKK-JISYO.S.${PORTVERSION}${SKK_JISYO_SUFFIX}.gz +MASTER_SITES= ${MASTER_SITE_LOCAL} +MASTER_SITE_SUBDIR= matusita/${PORTNAME} +.if defined(WITH_SKKJISYO_CDB) +PKGNAMESUFFIX= -cdb +.endif DIST_SUBDIR= skk-jisyo -MAINTAINER?= ports@FreeBSD.org +MAINTAINER?= matusita@FreeBSD.org COMMENT?= Jisyo (dictionary) files for the SKK Japanese-input software -NO_WRKSUBDIR= yes -NO_BUILD= yes -EXTRACT_CMD= ${CP} +.if defined(WITH_SKKJISYO_CDB) +BUILD_DEPENDS= ${LOCALBASE}/bin/cdbmake:${PORTSDIR}/databases/cdb +.endif + +SKKDIR?= share/skk +SKK_JISYO_TYPE?=L M S + +USE_BZIP2= yes +NO_WRKSUBDIR= yes +EXTRACT_CMD= ${CP} EXTRACT_BEFORE_ARGS= -p EXTRACT_AFTER_ARGS= ${WRKDIR} +PLIST_SUB+= SKKDIR=${SKKDIR} +.for type in ${SKK_JISYO_TYPE} +DISTFILES+= SKK-JISYO.${type}.${PORTVERSION}.bz2 +PLIST_FILES+= ${SKKDIR}/SKK-JISYO.${type}${CDBSUFFIX} +.endfor +.if defined(WITH_SKKJISYO_DELCOMMENTS) +USE_REINPLACE= yes +.endif -SKKDIR?= share/skk -SKK_JISYO_TYPE?= L M S -SKK_JISYO_SUFFIX?= # empty - -PLIST_SUB= SKKDIR=${SKKDIR} JISYO_SUFFIX=${SKK_JISYO_SUFFIX} +.if defined(WITH_SKKJISYO_CDB) +CDBSUFFIX= .cdb +.else +CDBSUFFIX= #empty +NO_BUILD= yes +.endif post-extract: - @(cd ${WRKDIR}; ${GUNZIP_CMD} *.gz) + @(cd ${WRKDIR}; ${BZIP2_CMD} -d *.bz2) + +.if defined(WITH_SKKJISYO_DELCOMMENTS) +# Strip comments in transtation candidates list. +# Candidate list starts with '/', and each candidate is concatinated by +# '/' (e.g., "/c1/c2/".) Each candidate may have a comment just after +# the candidate, leading a marker character ';' (e.g. /c3;comment/). +do-patch: +.for type in ${SKK_JISYO_TYPE} + ${REINPLACE_CMD} -e '/^[^;]/s,;[^/]*/,/,g' \ + ${WRKDIR}/SKK-JISYO.${type}.${PORTVERSION} +.endfor +.endif + +.if defined(WITH_SKKJISYO_CDB) +# Convert plaintext jisyo data to CDB database by cdbmake. +# 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. +# See also: <URL:http://cr.yp.to/cdb/cdbmake.html>. +do-build: +.for type in ${SKK_JISYO_TYPE} + ${AWK} '/^[^;]/ { \ + k = $$1; didx = index($$0, $$2); \ + d = substr($$0, didx); \ + print "+" length(k) "," length(d) ":" k "->" d; \ + } \ + END { \ + print ""; \ + }' \ + < ${WRKDIR}/SKK-JISYO.${type}.${PORTVERSION} | \ + ${LOCALBASE}/bin/cdbmake \ + ${WRKDIR}/SKK-JISYO.${type}.${PORTVERSION}${CDBSUFFIX} \ + ${WRKDIR}/SKK-JISYO.${type}.${PORTVERSION}.tmp +.endfor +.endif + do-install: ${MKDIR} ${PREFIX}/${SKKDIR} -.for i in ${SKK_JISYO_TYPE} - ${INSTALL_DATA} ${WRKSRC}/SKK-JISYO.${i}.${PORTVERSION}${SKK_JISYO_SUFFIX} ${PREFIX}/${SKKDIR}/SKK-JISYO.${i}${SKK_JISYO_SUFFIX} +.for type in ${SKK_JISYO_TYPE} + ${INSTALL_DATA} ${WRKSRC}/SKK-JISYO.${type}.${PORTVERSION}${CDBSUFFIX} \ + ${PREFIX}/${SKKDIR}/SKK-JISYO.${type}${CDBSUFFIX} .endfor .include <bsd.port.mk> diff --git a/japanese/skk-jisyo/distinfo b/japanese/skk-jisyo/distinfo index a4a15f78fe57..3d10ae5a45b4 100644 --- a/japanese/skk-jisyo/distinfo +++ b/japanese/skk-jisyo/distinfo @@ -1,6 +1,6 @@ -MD5 (skk-jisyo/SKK-JISYO.L.200408.gz) = 8ff73f84557c7de2de709723b6ea7e21 -SIZE (skk-jisyo/SKK-JISYO.L.200408.gz) = 1374640 -MD5 (skk-jisyo/SKK-JISYO.M.200408.gz) = a74a489dff168abc2bf1bd94cb8af325 -SIZE (skk-jisyo/SKK-JISYO.M.200408.gz) = 65385 -MD5 (skk-jisyo/SKK-JISYO.S.200408.gz) = 2b507b98aceab0d896f6a29f9ebc7ac6 -SIZE (skk-jisyo/SKK-JISYO.S.200408.gz) = 28096 +MD5 (skk-jisyo/SKK-JISYO.L.200410.bz2) = 5cbe6dfcbc75128fbd5d0f5772551f21 +SIZE (skk-jisyo/SKK-JISYO.L.200410.bz2) = 1365374 +MD5 (skk-jisyo/SKK-JISYO.M.200410.bz2) = 7a33898e8a5c549def05a0b093d1a782 +SIZE (skk-jisyo/SKK-JISYO.M.200410.bz2) = 62542 +MD5 (skk-jisyo/SKK-JISYO.S.200410.bz2) = 5c0b82c2acc571f4d54f094b5d50601c +SIZE (skk-jisyo/SKK-JISYO.S.200410.bz2) = 25955 diff --git a/japanese/skk-jisyo/pkg-plist b/japanese/skk-jisyo/pkg-plist index 7fee972746ab..8a11bf34d68d 100644 --- a/japanese/skk-jisyo/pkg-plist +++ b/japanese/skk-jisyo/pkg-plist @@ -1,4 +1 @@ -%%SKKDIR%%/SKK-JISYO.L%%JISYO_SUFFIX%% -%%SKKDIR%%/SKK-JISYO.M%%JISYO_SUFFIX%% -%%SKKDIR%%/SKK-JISYO.S%%JISYO_SUFFIX%% -@dirrm %%SKKDIR%% +@unexec rmdir %%SKKDIR%% > /dev/null 2>&1 || true |