Ignore:
Timestamp:
Feb 26, 2007, 3:11:44 AM (13 years ago)
Author:
takanori@…
Message:

Add dictionaries for UTF-8 and Shift_JIS support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/textproc/chasen/Portfile

    r19815 r22311  
    11# $Id$
    2 
    3 set ipa ipadic-2.7.0
    42
    53PortSystem        1.0
    64name              chasen
    75version           2.3.3
    8 revision          2
    9 categories        textproc
     6revision          3
     7set ipa           ipadic-2.7.0
     8categories        textproc japanese
    109maintainers       takanori@macports.org
    1110description       Japanese morphological analysis system
     
    4241default_variants  +ipadic
    4342
    44 depends_lib       port:darts lib:libiconv:libiconv
     43depends_lib     port:darts port:libiconv
     44depends_build   port:nkf
    4545
    4646post-extract    {
     
    4949}
    5050
    51 configure.args-append   --libexecdir=${prefix}/lib --with-darts=${prefix}/include --with-libiconv=${prefix}
     51configure.args  --libexecdir=${prefix}/lib --with-darts=${prefix}/include --with-libiconv=${prefix}
     52
     53test.run        yes
     54test.target     check
    5255
    5356post-destroot   {
     
    5962
    6063variant ipadic  {
    61                 # Japanese dictionary for ChaSen
    62                 distfiles-append ${ipa}.tar.gz:ipadic
    63                 extract.only-append ${ipa}.tar.gz
    64                 post-destroot {
    65                               system "cd ${workpath}/${ipa} && ./configure --with-dicdir=${prefix}/lib/chasen/dic --with-mkchadic=${destroot}${prefix}/lib/chasen --with-chasenrc-path=${destroot}${prefix}/etc/chasenrc && DYLD_LIBRARY_PATH=${destroot}${prefix}/lib make && make install DESTDIR=${destroot}"
     64        # Japanese dictionaries for ChaSen
     65        distfiles-append ${ipa}.tar.gz:ipadic
     66        extract.only-append ${ipa}.tar.gz
     67        post-destroot {
     68                foreach {enc c} {UTF-8 w EUC-JP e Shift_JIS s} {
     69                        file mkdir ${workpath}/${ipa}-${enc}
     70                        system "(cd ${workpath}/${ipa}; tar cf - .) | (cd ${workpath}/${ipa}-${enc}; tar xf -)"
     71                        reinplace "s|PACKAGE=ipadic|PACKAGE=ipadic-${enc}|" ${workpath}/${ipa}-${enc}/configure
     72                        reinplace "s|/makemat|/makemat -i ${c}|" ${workpath}/${ipa}-${enc}/Makefile.in
     73                        reinplace "s|/makeda|/makeda -i ${c}|" ${workpath}/${ipa}-${enc}/Makefile.in
     74                        foreach f [glob ${workpath}/${ipa}-${enc}/*.cha ${workpath}/${ipa}-${enc}/*.dic ${workpath}/${ipa}-${enc}/chasenrc.in] {
     75                                system "mv ${f} ${f}_ && ${prefix}/bin/nkf --ic=EUC-JP --oc=${enc} ${f}_ > ${f}"
     76                        }
     77                        system "cd ${workpath}/${ipa}-${enc} && ./configure --with-dicdir=${prefix}/lib/chasen/dic --with-mkchadic=${destroot}${prefix}/lib/chasen --with-chasenrc-path=${destroot}${prefix}/etc/chasenrc-${enc} && DYLD_LIBRARY_PATH=${destroot}${prefix}/lib make && make install DESTDIR=${destroot}"
     78                }
     79                system "ln -sf chasenrc-EUC-JP ${destroot}${prefix}/etc/chasenrc"
    6680
    67                               xinstall -m 755 -d ${destroot}${prefix}/share/doc/ipadic/doc
     81                xinstall -m 755 -d ${destroot}${prefix}/share/doc/ipadic/doc
    6882
    69                               xinstall -m 644 -W ${workpath}/${ipa} AUTHORS COPYING ChangeLog INSTALL INSTALL-ja NEWS README ${destroot}${prefix}/share/doc/ipadic
    70                               xinstall -m 644 ${workpath}/${ipa}/doc/ipadic-ja.pdf ${destroot}${prefix}/share/doc/ipadic/doc
    71                 }
     83                xinstall -m 644 -W ${workpath}/${ipa} AUTHORS COPYING ChangeLog INSTALL INSTALL-ja NEWS README ${destroot}${prefix}/share/doc/ipadic
     84                xinstall -m 644 ${workpath}/${ipa}/doc/ipadic-ja.pdf ${destroot}${prefix}/share/doc/ipadic/doc
     85        }
     86
     87        post-activate   {
     88                ui_msg "\nDue to historical reasons, the default encoding of ChaSen is set to EUC-JP."
     89                ui_msg "If you'd like to handle text files written in UTF-8 or Shift_JIS, you may use -r and -i options.\n"
     90                ui_msg "  UTF-8)     chasen -r ${prefix}/etc/chasenrc-UTF-8 -i w <input>"
     91                ui_msg "  Shift_JIS) chasen -r ${prefix}/etc/chasenrc-Shift_JIS -i s <input>\n"
     92        }
    7293}
     94
     95livecheck.check regex
     96livecheck.url   http://chasen.naist.jp/hiki/ChaSen/?%C3%E3%E4%A5%A4%CE%C7%DB%C9%DB
     97livecheck.regex ${name}-(\[0-9.a-z\]+)\\.tar
Note: See TracChangeset for help on using the changeset viewer.