# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id$ PortSystem 1.0 name canna version 3.7p3 set dicversion 0.95c revision 4 categories textproc japanese maintainers nomaintainer description Kana-Kanji conversion system long_description ${description} platforms darwin license Restrictive/Distributable BSD-old GPL-2+ MIT homepage http://canna.sourceforge.jp/ master_sites sourceforge_jp:${name}/9565/:canna \ http://cannadic.oucrc.org/:cannadic distname "Canna[string map {"." ""} ${version}]" use_bzip2 yes distfiles ${distname}${extract.suffix}:canna \ cannadic-${dicversion}.tar.gz:cannadic patchfiles patch-Canna.conf.diff \ patch-canna_widedef.h.diff \ patch-doc_man_guide_tex_Imakefile.diff \ patch-lib_canna_lisp.c.diff \ patch-server_util.c.diff \ patch-cmd_catdic_Imakefile.diff \ patch-lib_RK_ncache.c.diff \ patch-server_comm.c.diff \ \ patch-dic_ideo_words_dics.dir.diff \ patch-misc_default.ca.diff checksums ${distname}${extract.suffix} \ rmd160 33e5eb9e2dc144835db838612897e652acbc60ed \ sha256 7d98d925043d3af24f99a8a2a09e3b4d6dfe881efc1303ef4a7f495a0f4542a7 \ cannadic-${dicversion}.tar.gz \ rmd160 d0920e718d35d038fff930ac50ebe049a322174d \ sha256 d477889aa54276eeb013f28f4f5a18c26baebbc5de28884421f086e1d38fdb04 extract.only ${distname}${extract.suffix} post-extract { system "cd ${workpath} && gzip -dc ${distpath}/cannadic-${dicversion}.tar.gz | tar --no-same-owner -xf -" } post-patch { reinplace -locale C "s|__PREFIX__|${prefix}|" ${worksrcpath}/Canna.conf } use_xmkmf yes pre-build { build.target canna if {[variant_isset universal]} { build.post_args CDEBUGFLAGS=\"${configure.cflags} ${configure.universal_cflags}\" SHLIBGLOBALSFLAGS=\"${configure.universal_cflags}\" } else { build.post_args CDEBUGFLAGS=\"${configure.cflags}\" } } use_parallel_build no post-build { system "cd ${workpath}/cannadic-${dicversion} && ${worksrcpath}/cmd/crxdic/crxdic -D ${worksrcpath}/dic/ideo/grammar/cnj.bits -m -o gcanna.cbd gcanna.ctd" system "cd ${workpath}/cannadic-${dicversion} && ${worksrcpath}/cmd/crfreq/crfreq -div 512 gcanna.cbd gcanna.mwd" } destroot.target install install.man destroot.keepdirs ${destroot}${prefix}/var/db/canna/dic/user \ ${destroot}${prefix}/var/db/canna/dic/group pre-destroot { addgroup canna adduser canna gid=[existsgroup canna] } post-destroot { foreach f {gcanna.cbd gcanna.cld gcannaf.ctd} { xinstall -m 664 -o canna -g canna ${workpath}/cannadic-${dicversion}/${f} ${destroot}${prefix}/var/db/canna/dic/canna } xinstall -m 775 -o canna -g canna -d ${destroot}${prefix}/var/db/canna/dic/user xinstall -m 775 -o canna -g canna -d ${destroot}${prefix}/var/db/canna/dic/group xinstall -m 755 ${worksrcpath}/misc/rc.canna ${destroot}${prefix}/etc } post-destroot { xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name} foreach f {COPYRIGHT ChangeLog INSTALL README WHATIS *.jp} { eval xinstall -m 644 [glob ${worksrcpath}/${f}] ${destroot}${prefix}/share/doc/${name} } } pre-install { addgroup canna adduser canna gid=[existsgroup canna] } startupitem.create yes startupitem.name canna startupitem.start "${prefix}/etc/rc.canna start" startupitem.stop "${prefix}/etc/rc.canna stop" variant universal {} variant inet description {Accept TCP 5680 incoming connections from clients. (Possible security risk.)} { post-patch { reinplace "s|-syslog|-syslog -inet|" ${worksrcpath}/misc/rc.canna } } variant pdfdoc description {Create PDF documents using pTeX.} { depends_build-append \ port:ghostscript \ port:ghostscript-fonts-hiragino \ port:texlive-lang-japanese \ port:texlive-latex-recommended # https://trac.macports.org/ticket/48060 post-build { system "cd ${worksrcpath}/doc/man/guide/tex && xmkmf && make canna.pdf" # These two files are written in LaTeX 2.09! system "cd ${worksrcpath}/doc/intern && platex -kanji=euc proto12.tex && platex -kanji=euc proto12.tex && dvipdfmx proto12.dvi" system "cd ${worksrcpath}/doc/intern && platex -kanji=euc protocol.tex && platex -kanji=euc protocol.tex && dvipdfmx protocol.dvi" system "cd ${worksrcpath}/doc/lisp && platex -kanji=euc canlisp.tex && platex -kanji=euc canlisp.tex && dvipdfmx canlisp.dvi" } post-destroot { xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/guide xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/intern xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/lisp xinstall -m 644 ${worksrcpath}/doc/man/guide/tex/canna.pdf ${destroot}${prefix}/share/doc/${name}/guide xinstall -m 644 ${worksrcpath}/doc/intern/proto12.pdf ${destroot}${prefix}/share/doc/${name}/intern xinstall -m 644 ${worksrcpath}/doc/intern/protocol.pdf ${destroot}${prefix}/share/doc/${name}/intern xinstall -m 644 ${worksrcpath}/doc/lisp/canlisp.pdf ${destroot}${prefix}/share/doc/${name}/lisp } } livecheck.type regex livecheck.regex Canna (\[0-9.a-z\]+)