source: trunk/dports/textproc/canna/Portfile @ 127155

Last change on this file since 127155 was 127155, checked in by jmr@…, 5 years ago

canna, kinput2: remove workarounds now that imake is fixed

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.4 KB
Line 
1# $Id: Portfile 127155 2014-10-22 02:47:40Z jmr@macports.org $
2
3PortSystem      1.0
4
5name            canna
6version         3.7p3
7set dicversion  0.95c
8revision        3
9categories      textproc japanese
10maintainers     takanori openmaintainer
11description     Kana-Kanji conversion system
12long_description \
13                ${description}
14platforms       darwin
15license         Restrictive/Distributable BSD-old GPL-2+ MIT
16homepage        http://canna.sourceforge.jp/
17master_sites    sourceforge_jp:${name}/9565/:canna \
18                http://cannadic.oucrc.org/:cannadic
19distname        "Canna[string map {"." ""} ${version}]"
20use_bzip2       yes
21distfiles       ${distname}${extract.suffix}:canna \
22                cannadic-${dicversion}.tar.gz:cannadic
23patchfiles      patch-Canna.conf.diff \
24                patch-canna_widedef.h.diff \
25                patch-doc_man_guide_tex_Imakefile.diff \
26                patch-lib_canna_lisp.c.diff \
27                patch-server_util.c.diff \
28                patch-cmd_catdic_Imakefile.diff \
29                patch-lib_RK_ncache.c.diff \
30                patch-server_comm.c.diff \
31                \
32                patch-dic_ideo_words_dics.dir.diff \
33                patch-misc_default.ca.diff
34checksums       ${distname}${extract.suffix} md5 0b8c241f63ab4cd3c0b9be569456dc33 \
35                                             sha1 e39eece7c70c669dd46dd74b26121a60a2496fde \
36                                             rmd160 33e5eb9e2dc144835db838612897e652acbc60ed \
37                cannadic-${dicversion}.tar.gz md5 2a7fc1be5a50e0ca5dd6e5721be4371a \
38                                              sha1 a8e452a509ea38643197b21ec6c10739c8dd9e4b \
39                                              rmd160 d0920e718d35d038fff930ac50ebe049a322174d
40
41extract.only    ${distname}${extract.suffix}
42post-extract {
43    system "cd ${workpath} && gzip -dc ${distpath}/cannadic-${dicversion}.tar.gz | tar --no-same-owner -xf -"
44}
45
46post-patch {
47    reinplace -locale C "s|__PREFIX__|${prefix}|" ${worksrcpath}/Canna.conf
48}
49
50use_xmkmf       yes
51
52pre-build {
53    build.target    canna
54    if {[variant_isset universal]} {
55        build.post_args CDEBUGFLAGS=\"${configure.cflags} ${configure.universal_cflags}\" SHLIBGLOBALSFLAGS=\"${configure.universal_cflags}\"
56    } else {
57        build.post_args CDEBUGFLAGS=\"${configure.cflags}\"
58    }
59}
60use_parallel_build  no
61post-build {
62    system "cd ${workpath}/cannadic-${dicversion} && ${worksrcpath}/cmd/crxdic/crxdic -D ${worksrcpath}/dic/ideo/grammar/cnj.bits -m -o gcanna.cbd gcanna.ctd"
63    system "cd ${workpath}/cannadic-${dicversion} && ${worksrcpath}/cmd/crfreq/crfreq -div 512 gcanna.cbd gcanna.mwd"
64}
65
66destroot.target install install.man
67destroot.keepdirs ${destroot}${prefix}/var/db/canna/dic/user \
68                  ${destroot}${prefix}/var/db/canna/dic/group
69pre-destroot {
70    addgroup canna
71    adduser canna gid=[existsgroup canna]
72}
73post-destroot {
74    foreach f {gcanna.cbd gcanna.cld gcannaf.ctd} {
75        xinstall -m 664 -o canna -g canna ${workpath}/cannadic-${dicversion}/${f} ${destroot}${prefix}/var/db/canna/dic/canna
76    }
77    xinstall -m 775 -o canna -g canna -d ${destroot}${prefix}/var/db/canna/dic/user
78    xinstall -m 775 -o canna -g canna -d ${destroot}${prefix}/var/db/canna/dic/group
79    xinstall -m 755 ${worksrcpath}/misc/rc.canna ${destroot}${prefix}/etc
80}
81post-destroot {
82    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
83    foreach f {COPYRIGHT ChangeLog INSTALL README WHATIS *.jp} {
84        eval xinstall -m 644 [glob ${worksrcpath}/${f}] ${destroot}${prefix}/share/doc/${name}
85    }
86}
87
88pre-install {
89    addgroup canna
90    adduser canna gid=[existsgroup canna]
91}
92
93startupitem.create      yes
94startupitem.name        canna
95startupitem.start       "${prefix}/etc/rc.canna start"
96startupitem.stop        "${prefix}/etc/rc.canna stop"
97
98variant universal {}
99
100variant inet description {Accept TCP 5680 incoming connections from clients. (Possible security risk.)} {
101    post-patch {
102        reinplace "s|-syslog|-syslog -inet|" ${worksrcpath}/misc/rc.canna
103    }
104}
105
106variant pdfdoc description {Create PDF documents using pTeX.} {
107    depends_build-append port:pTeX port:ghostscript port:ghostscript-fonts-hiragino
108    post-build {
109        system "cd ${worksrcpath}/doc/man/guide/tex && xmkmf && make canna.pdf"
110
111        # These two files are written in LaTeX 2.09!
112        system "cd ${worksrcpath}/doc/intern && platex -kanji=euc proto12.tex && platex -kanji=euc proto12.tex && dvipdfmx proto12.dvi"
113        system "cd ${worksrcpath}/doc/intern && platex -kanji=euc protocol.tex && platex -kanji=euc protocol.tex && dvipdfmx protocol.dvi"
114
115        system "cd ${worksrcpath}/doc/lisp && platex -kanji=euc canlisp.tex && platex -kanji=euc canlisp.tex && dvipdfmx canlisp.dvi"
116    }
117    post-destroot {
118        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/guide
119        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/intern
120        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/lisp
121
122        xinstall -m 644 ${worksrcpath}/doc/man/guide/tex/canna.pdf ${destroot}${prefix}/share/doc/${name}/guide
123        xinstall -m 644 ${worksrcpath}/doc/intern/proto12.pdf ${destroot}${prefix}/share/doc/${name}/intern
124        xinstall -m 644 ${worksrcpath}/doc/intern/protocol.pdf ${destroot}${prefix}/share/doc/${name}/intern
125        xinstall -m 644 ${worksrcpath}/doc/lisp/canlisp.pdf ${destroot}${prefix}/share/doc/${name}/lisp
126    }
127}
128
129livecheck.type  regex
130livecheck.regex Canna (\[0-9.a-z\]+)
Note: See TracBrowser for help on using the repository browser.