Revision: 87366 http://trac.macports.org/changeset/87366 Author: hum@macports.org Date: 2011-11-18 15:08:38 -0800 (Fri, 18 Nov 2011) Log Message: ----------- chasen, chasen-base: downgrade to 2.3.3 due to vulnerability; see http://jvndb.jvn.jp/en/contents/2011/JVNDB-2011-000099.html; add patches for 2.3.3 with clang compiler; fix livecheck. Modified Paths: -------------- trunk/dports/textproc/chasen/Portfile trunk/dports/textproc/chasen-base/Portfile trunk/dports/textproc/chasen-base/files/patch-configure.diff Added Paths: ----------- trunk/dports/textproc/chasen-base/files/chasen-2.3.3.20030821.patch trunk/dports/textproc/chasen-base/files/chasen-2.3.3.20030822.patch trunk/dports/textproc/chasen-base/files/patch-lib.diff trunk/dports/textproc/chasen-base/files/patch-mkchadic.diff Modified: trunk/dports/textproc/chasen/Portfile =================================================================== --- trunk/dports/textproc/chasen/Portfile 2011-11-18 13:34:05 UTC (rev 87365) +++ trunk/dports/textproc/chasen/Portfile 2011-11-18 23:08:38 UTC (rev 87366) @@ -4,8 +4,8 @@ PortSystem 1.0 name chasen -version 2.4.4 -revision 1 +version 2.3.3 +epoch 1 categories textproc japanese platforms darwin maintainers takanori hum openmaintainer Modified: trunk/dports/textproc/chasen-base/Portfile =================================================================== --- trunk/dports/textproc/chasen-base/Portfile 2011-11-18 13:34:05 UTC (rev 87365) +++ trunk/dports/textproc/chasen-base/Portfile 2011-11-18 23:08:38 UTC (rev 87366) @@ -4,7 +4,8 @@ PortSystem 1.0 name chasen-base -version 2.4.4 +version 2.3.3 +epoch 1 categories textproc japanese platforms darwin maintainers takanori hum openmaintainer @@ -17,13 +18,18 @@ dist_subdir chasen distname chasen-${version} -master_sites sourceforge_jp:chasen-legacy/32224 +master_sites sourceforge_jp:chasen-legacy/24339 +checksums rmd160 2f2416f82fb0341023314a4672e442fed86207a9 \ + sha256 a91b422398f30c9c6c2d27fdbcc1aeb8e026ded44d6e729fc060d5d18bfaefdb -checksums rmd160 ceb4a7c064ba5bf0d356d6db0e64b644b88dbc54 \ - sha256 09e41f681097f87ba6c953d3724c34c1826c3cfa590898a2166fb310a006f932 +# chasen-2.3.3-2003082[12].patch are official patches taken from http://chasen.aist-nara.ac.jp/stable/chasen/ +# see http://chasen.naist.jp/hiki/ChaSen/?%A5%D0%A5%B0%BE%F0%CA%F3 +patchfiles chasen-2.3.3.20030821.patch \ + chasen-2.3.3.20030822.patch \ + patch-configure.diff \ + patch-lib.diff \ + patch-mkchadic.diff -patchfiles patch-configure.diff - depends_build port:darts depends_lib port:libiconv @@ -75,5 +81,5 @@ } livecheck.type regex -livecheck.url http://sourceforge.jp/projects/chasen-legacy/releases -livecheck.regex chasen-(\[0-9.a-z\-\]+)\\.tar +livecheck.url ${homepage} +livecheck.regex >chasen-(\[0-9.a-z\-\]+)< Added: trunk/dports/textproc/chasen-base/files/chasen-2.3.3.20030821.patch =================================================================== --- trunk/dports/textproc/chasen-base/files/chasen-2.3.3.20030821.patch (rev 0) +++ trunk/dports/textproc/chasen-base/files/chasen-2.3.3.20030821.patch 2011-11-18 23:08:38 UTC (rev 87366) @@ -0,0 +1,108 @@ +Index: ChangeLog +=================================================================== +RCS file: /cvsroot/chasen/ChangeLog,v +retrieving revision 1.146 +retrieving revision 1.147 +diff -u -r1.146 -r1.147 +--- ChangeLog 13 Aug 2003 13:55:19 -0000 1.146 ++++ ChangeLog 21 Aug 2003 01:14:44 -0000 1.147 +@@ -1,3 +1,7 @@ ++2003-08-21 TAKAOKA Kazuma <kazuma-t@is.aist-nara.ac.jp> ++ ++ * lib/tokenizer.c (cha_tok_parse): Fix for SPACE_POS. ++ + 2003-08-13 TAKAOKA Kazuma <kazuma-t@is.aist-nara.ac.jp> + + * lib/iotool.c (cha_read_registry): Read the registry for the +Index: lib/parse.c +=================================================================== +RCS file: /cvsroot/chasen/lib/parse.c,v +retrieving revision 1.57 +retrieving revision 1.58 +diff -u -r1.57 -r1.58 +--- lib/parse.c 30 Jul 2003 16:06:57 -0000 1.57 ++++ lib/parse.c 21 Aug 2003 01:14:44 -0000 1.58 +@@ -27,7 +27,7 @@ + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: parse.c,v 1.57 2003/07/30 16:06:57 kazuma-t Exp $ ++ * $Id: parse.c,v 1.58 2003/08/21 01:14:44 kazuma-t Exp $ + */ + + #include "chalib.h" +@@ -434,7 +434,7 @@ + int mrph_idx, i; + + /* skip annotations and white space */ +- while (cha_tok_anno_type(Cha_tokenizer, cursor) != 0 ) ++ while (cha_tok_anno_type(Cha_tokenizer, cursor) >= 0) + cursor += cha_tok_char_type_len(Cha_tokenizer, cursor); + if (cursor >= len) + break; +Index: lib/tokenizer.c +=================================================================== +RCS file: /cvsroot/chasen/lib/tokenizer.c,v +retrieving revision 1.14 +retrieving revision 1.16 +diff -u -r1.14 -r1.16 +--- lib/tokenizer.c 8 Jul 2003 17:08:49 -0000 1.14 ++++ lib/tokenizer.c 21 Aug 2003 01:35:07 -0000 1.16 +@@ -27,7 +27,7 @@ + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: tokenizer.c,v 1.14 2003/07/08 17:08:49 kazuma-t Exp $ ++ * $Id: tokenizer.c,v 1.16 2003/08/21 01:35:07 kazuma-t Exp $ + */ + + #include <string.h> +@@ -154,6 +154,7 @@ + int cursor, head; + int state, state0; + anno_info *anno = NULL; ++ int i; + + tok->string = str; + tok->string_len = len; +@@ -165,7 +166,8 @@ + } + + memset(tok->_char_type, 0, sizeof(int) * len); +- memset(tok->_anno_type, 0, sizeof(int) * len); ++ for (i = 0; i < len; i++) ++ tok->_anno_type[i] = -1; + + state0 = state = 0; /* NOSTATE */ + for (cursor = head = 0; cursor < len; +@@ -248,10 +250,9 @@ + * This function returns the type of annotation, if there is + * the begining of annotation on cursor. The type is more than 0. + * +- * And it returns less than 0 value, if the character on cursor is +- * white space. ++ * And it returns 0, if the character on cursor is white space. + * +- * Otherwise it returns 0. ++ * Otherwise it returns less than 0. + */ + int + cha_tok_anno_type(chasen_tok_t *tok, int cursor) +@@ -329,7 +330,7 @@ + ja_char_type_parse(chasen_tok_t *tok, int state, int *state0, int cursor) + { + if (state == JA_SPACE) { +- tok->_anno_type[cursor] = -1; ++ tok->_anno_type[cursor] = 0; + } else if ((state == HALF_LATIN) || + (state == FULL_LATIN)) { + ; /* do nothing */ +@@ -350,7 +351,7 @@ + en_char_type_parse(chasen_tok_t *tok, int state, int *state0, int cursor) + { + if (state == EN_SPACE) { +- tok->_anno_type[cursor] = -1; ++ tok->_anno_type[cursor] = 0; + } else if (state == EN_OTHER) { + *state0 = EN_NOSTATE; + } Added: trunk/dports/textproc/chasen-base/files/chasen-2.3.3.20030822.patch =================================================================== --- trunk/dports/textproc/chasen-base/files/chasen-2.3.3.20030822.patch (rev 0) +++ trunk/dports/textproc/chasen-base/files/chasen-2.3.3.20030822.patch 2011-11-18 23:08:38 UTC (rev 87366) @@ -0,0 +1,85 @@ +Index: ChangeLog +=================================================================== +RCS file: /cvsroot/chasen/ChangeLog,v +retrieving revision 1.147 +diff -u -r1.147 ChangeLog +--- ChangeLog 21 Aug 2003 01:14:44 -0000 1.147 ++++ ChangeLog 22 Aug 2003 05:32:58 -0000 +@@ -1,3 +1,7 @@ ++2003-08-22 TAKAOKA Kazuma <kazuma-t@is.aist-nara.ac.jp> ++ ++ * lib/print.c (extract_yomi1): Fix bug. ++ + 2003-08-21 TAKAOKA Kazuma <kazuma-t@is.aist-nara.ac.jp> + + * lib/tokenizer.c (cha_tok_parse): Fix for SPACE_POS. +Index: lib/print.c +=================================================================== +RCS file: /cvsroot/chasen/lib/print.c,v +retrieving revision 1.53 +diff -u -r1.53 print.c +--- lib/print.c 11 Aug 2003 05:53:36 -0000 1.53 ++++ lib/print.c 22 Aug 2003 05:32:58 -0000 +@@ -579,40 +579,35 @@ + path->start = start; + } + +-#define copy_mbstr(d,s) \ +-do { int len = cha_tok_mblen(Cha_tokenizer, (s), 4 /* XXX */); \ +- while (len-- && *(s)) { *(d)++ = *(s)++; } \ +- s--; /* XXX */\ +-} while (0) +- + static void + extract_yomi1(char *dst, char *src) + { +- int in_brace = 0, is1st = 0; +- char *s, *d; ++ char *d = dst; ++ char *s = src; ++ int state = 0; + +- if (strchr(src, '{') == NULL) { +- if (dst != src) +- strcpy(dst, src); +- return; +- } ++ while (*s) { ++ int i; ++ int len = cha_tok_mblen(Cha_tokenizer, (s), 4 /* XXX */); + +- for (s = src, d = dst; *s; s++) { +- if (!in_brace) { +- if (*s == '{') +- in_brace = is1st = 1; +- else +- copy_mbstr(d, s); +- } else if (*s == '}') +- in_brace = 0; +- else if (is1st) { +- if (*s == '/') +- is1st = 0; +- else +- copy_mbstr(d, s); ++ if (state == 0 && len == 1 && *s == '{') { ++ state = 1; ++ s += len; ++ continue; ++ } else if (state == 1 && len == 1 && *s == '/') { ++ state = 2; ++ s += len; ++ continue; ++ } else if (state == 2) { ++ if (len == 1 && *s == '}') ++ state = 0; ++ s += len; ++ continue; + } +- } + ++ for (i = 0; i < len; i++) ++ *d++ = *s++; ++ } + *d = '\0'; + } + Modified: trunk/dports/textproc/chasen-base/files/patch-configure.diff =================================================================== --- trunk/dports/textproc/chasen-base/files/patch-configure.diff 2011-11-18 13:34:05 UTC (rev 87365) +++ trunk/dports/textproc/chasen-base/files/patch-configure.diff 2011-11-18 23:08:38 UTC (rev 87366) @@ -1,27 +1,31 @@ ---- configure.orig 2008-07-23 13:15:55.000000000 +0900 -+++ configure 2011-10-02 20:57:04.000000000 +0900 -@@ -22780,8 +22780,8 @@ +--- configure.orig 2003-08-15 13:00:58.000000000 +0900 ++++ configure 2011-11-18 02:23:20.000000000 +0900 +@@ -8497,8 +8497,8 @@ + fi; - --{ echo "$as_me:$LINENO: checking for iconv in -liconv" >&5 --echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6; } -+{ echo "$as_me:$LINENO: checking for libiconv in -liconv" >&5 -+echo $ECHO_N "checking for libiconv in -liconv... $ECHO_C" >&6; } +-echo "$as_me:$LINENO: checking for iconv in -liconv" >&5 +-echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for libiconv in -liconv" >&5 ++echo $ECHO_N "checking for libiconv in -liconv... $ECHO_C" >&6 if test "${ac_cv_lib_iconv_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -@@ -22800,11 +22800,11 @@ - #ifdef __cplusplus - extern "C" +@@ -8514,7 +8514,7 @@ #endif + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ -char iconv (); +char libiconv (); + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" +@@ -8524,7 +8524,7 @@ int main () { --return iconv (); -+return libiconv (); +-iconv (); ++libiconv (); ; return 0; } Added: trunk/dports/textproc/chasen-base/files/patch-lib.diff =================================================================== --- trunk/dports/textproc/chasen-base/files/patch-lib.diff (rev 0) +++ trunk/dports/textproc/chasen-base/files/patch-lib.diff 2011-11-18 23:08:38 UTC (rev 87366) @@ -0,0 +1,201 @@ +--- lib/chalib.c.orig 2003-08-15 12:58:57.000000000 +0900 ++++ lib/chalib.c 2011-11-18 22:36:39.000000000 +0900 +@@ -364,7 +364,7 @@ + char *euc_str; + + euc_str = cha_malloc(strlen(str_in) + 1); +- cha_jistoeuc(str_in, euc_str); ++ cha_jistoeuc((unsigned char*)str_in, (unsigned char*)euc_str); + rc = chasen_sparse_main(euc_str, fp_out); + free(euc_str); + +@@ -405,7 +405,7 @@ + char *euc_str; + + euc_str = cha_malloc(strlen(str_in) + 1); +- cha_jistoeuc(str_in, euc_str); ++ cha_jistoeuc((unsigned char*)str_in, (unsigned char*)euc_str); + + if (chasen_sparse_main(euc_str, NULL)) + return NULL; +--- lib/dartsdic.cpp.orig 2003-07-31 01:06:57.000000000 +0900 ++++ lib/dartsdic.cpp 2011-11-18 22:43:18.000000000 +0900 +@@ -68,7 +68,7 @@ + + da = (darts_t*)cha_malloc(sizeof(darts_t)); + da->da_mmap = cha_mmap_file(daname); +- darts->setArray(cha_mmap_map(da->da_mmap)); ++ darts->set_array(cha_mmap_map(da->da_mmap)); + da->da = darts; + da->lex_mmap = cha_mmap_file(lexname); + da->dat_mmap = cha_mmap_file(datname); +@@ -177,18 +177,18 @@ + lex_indices.push_back(i->second); + } + lens[size] = key.size(); +- (const char*)keys[size] = key.data(); ++ keys[size] = (char*)key.data(); + vals[size] = redump_lex(lens[size], lex_indices, tmpfile, lexfile); + if (vals[size] < 0) { + std::cerr << "Unexpected error at " << key << std::endl; +- cha_exit_perror("build darts file"); ++ cha_exit_perror((char*)"build darts file"); + } + size++; + } + std::cerr << size << " keys" << std::endl; + + DoubleArrayL da; +- da.build(size, keys, lens, vals); ++ da.build(size, (const char**)keys, lens, vals); + da.save(builder->path->c_str(), "wb"); + + return builder->entries->size(); +--- lib/parse.c.orig 2003-07-31 01:06:57.000000000 +0900 ++++ lib/parse.c 2011-11-18 22:49:29.000000000 +0900 +@@ -412,7 +412,7 @@ + int head_path; + static int path0 = -1; + +- cha_tok_parse(Cha_tokenizer, sentence, len + 1); ++ cha_tok_parse(Cha_tokenizer, (unsigned char*)sentence, len + 1); + cha_block_clear(Cha_mrph_block); + + free_chars(); +--- lib/jfgets.c.orig 2003-07-09 02:08:49.000000000 +0900 ++++ lib/jfgets.c 2011-11-19 07:51:01.000000000 +0900 +@@ -166,13 +166,13 @@ + static unsigned char tmp_buf[INNER_BUFSIZE]; + int last; + +- if (fgets(tmp_buf, bufsize, stream) == NULL) ++ if (fgets((char*)tmp_buf, bufsize, stream) == NULL) + return NULL; + + /* + * remove the last extra character + */ +- last = strlen(tmp_buf) - 1; ++ last = strlen((char*)tmp_buf) - 1; + if (iskanji1(tmp_buf, last)) { + ungetc(tmp_buf[last], stream); + tmp_buf[last] = 0; +@@ -185,7 +185,7 @@ + * you must care about string length. + */ + +- cha_jistoeuc(tmp_buf, buffer); ++ cha_jistoeuc(tmp_buf, (unsigned char*)buffer); + + return buffer; + } +@@ -205,7 +205,7 @@ + int kflag; /* kanji flag(0=not found, 1=found) */ + + if (pos == NULL && +- (pos = cha_fget_line(ibuf, sizeof(ibuf), stream)) == NULL) ++ (pos = (unsigned char*)cha_fget_line((char*)ibuf, sizeof(ibuf), stream)) == NULL) + return NULL; + + kflag = 0; +@@ -217,7 +217,7 @@ + * line is end without '\n', long string read more + */ + if (*pos == '\0') +- if ((pos = cha_fget_line(ibuf, sizeof(ibuf), stream)) == NULL) ++ if ((pos = (unsigned char*)cha_fget_line((char*)ibuf, sizeof(ibuf), stream)) == NULL) + break; + + /* +@@ -234,7 +234,7 @@ + /* + * hit delimiter + */ +- if (isterminator(pos - 2, jfgets_delimiter)) { ++ if (isterminator(pos - 2, (unsigned char*)jfgets_delimiter)) { + if (*pos == '\n') + pos++; + break; +@@ -256,7 +256,7 @@ + q--; + + if ((pos = +- cha_fget_line(ibuf, sizeof(ibuf), stream)) == NULL) ++ (unsigned char*)cha_fget_line((char*)ibuf, sizeof(ibuf), stream)) == NULL) + break; + + while (*pos == ' ' || *pos == '\t') +@@ -290,7 +290,7 @@ + /* + * hit delimiter + */ +- if (isterminator(pos - 1, jfgets_delimiter)) { ++ if (isterminator(pos - 1, (unsigned char*)jfgets_delimiter)) { + if (*pos == '\n') + pos++; + break; +--- lib/print.c.orig 2011-11-18 23:18:31.000000000 +0900 ++++ lib/print.c 2011-11-19 07:52:38.000000000 +0900 +@@ -303,7 +303,7 @@ + int len, i; + + while (*s1) { +- len = cha_tok_mblen(Cha_tokenizer, s1, 4 /* XXX */); ++ len = cha_tok_mblen(Cha_tokenizer, (unsigned char*)s1, 4 /* XXX */); + for (i = 0; i < len; i++) + if (s1[i] != s2[i]) + return s1 - s0; +@@ -327,7 +327,7 @@ + int plen, maxplen = 0; + + for (;;) { +- for (; *y; y += cha_tok_mblen(Cha_tokenizer, y, 4 /* XXX */)) { ++ for (; *y; y += cha_tok_mblen(Cha_tokenizer, (unsigned char*)y, 4 /* XXX */)) { + if (stat == 0) { + stat = 1; + if ((plen = comm_prefix_len(m, y)) > 0) { +@@ -340,7 +340,7 @@ + y0 = y; + if (!*m || !*y) + goto end_ruby; +- m += cha_tok_mblen(Cha_tokenizer, m, 4 /* XXX */); ++ m += cha_tok_mblen(Cha_tokenizer, (unsigned char*)m, 4 /* XXX */); + plen = maxplen = 0; + continue; + } +@@ -351,7 +351,7 @@ + } + if (maxplen == 0) { + if (*m) +- m += cha_tok_mblen(Cha_tokenizer, m, 4 /* XXX */); ++ m += cha_tok_mblen(Cha_tokenizer, (unsigned char*)m, 4 /* XXX */); + if (!*m) + ymax = y; + } +@@ -548,7 +548,7 @@ + if (anno_no >= 0 && + (Cha_anno_info[anno_no].hinsi + || Cha_anno_info[anno_no].format)) { +- mrph.headword = Cha_tokenizer->string + pos_end; ++ mrph.headword = (char*)(Cha_tokenizer->string + pos_end); + mrph.headword_len = mrph.stem_len = + cha_tok_char_type_len(Cha_tokenizer, pos_end); + mrph.reading_len = -1; +@@ -588,7 +588,7 @@ + + while (*s) { + int i; +- int len = cha_tok_mblen(Cha_tokenizer, (s), 4 /* XXX */); ++ int len = cha_tok_mblen(Cha_tokenizer, (unsigned char*)s, 4 /* XXX */); + + if (state == 0 && len == 1 && *s == '{') { + state = 1; +@@ -874,7 +874,7 @@ + value *= mrph->weight * Cha_mrph_cost_weight; + break; + case 'S': /* entire sentence */ +- word = Cha_tokenizer->string; ++ word = (char*)Cha_tokenizer->string; + break; + case 'p': /* the information about path */ + if (s[1] == '\0') { Added: trunk/dports/textproc/chasen-base/files/patch-mkchadic.diff =================================================================== --- trunk/dports/textproc/chasen-base/files/patch-mkchadic.diff (rev 0) +++ trunk/dports/textproc/chasen-base/files/patch-mkchadic.diff 2011-11-18 23:08:38 UTC (rev 87366) @@ -0,0 +1,18 @@ +--- mkchadic/makemat.c.orig 2003-06-04 23:19:35.000000000 +0900 ++++ mkchadic/makemat.c 2011-11-18 23:04:27.000000000 +0900 +@@ -539,8 +539,13 @@ + * û\xA4\xA4\xB5\xAC§\xA4ν\xE7\xA4˽\xE8\xCD\xFD + */ + for (rlen = 2; rlen <= rule_len_max; rlen++) { +- fprintf(stderr, rlen == 2 ? "bi%s" : rlen == 3 ? "tri%s" : "%d%s", +- "-gram: ", rlen); ++ if (rlen == 2) { ++ fprintf(stderr, "bi-gram"); ++ } else if (rlen == 3) { ++ fprintf(stderr, "tri-gram"); ++ } else { ++ fprintf(stderr, "%d-gram", rlen); ++ } + for (ln = 0; ln < linenum; ln++) { + if (rule_len[ln] != rlen) + continue;
participants (1)
-
hum@macports.org