source: trunk/dports/textproc/canna/Portfile

Last change on this file was 137633, checked in by mojca@…, 2 years ago

canna: depend on texlive, not pTeX (#41980, #48060)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1# -*- 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
2# $Id: Portfile 137633 2015-06-15 16:26:39Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                canna
7version             3.7p3
8set dicversion      0.95c
9revision            4
10categories          textproc japanese
11maintainers         nomaintainer
12description         Kana-Kanji conversion system
13long_description    ${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
34
35checksums           ${distname}${extract.suffix} \
36                    rmd160  33e5eb9e2dc144835db838612897e652acbc60ed \
37                    sha256  7d98d925043d3af24f99a8a2a09e3b4d6dfe881efc1303ef4a7f495a0f4542a7 \
38                    cannadic-${dicversion}.tar.gz \
39                    rmd160  d0920e718d35d038fff930ac50ebe049a322174d \
40                    sha256  d477889aa54276eeb013f28f4f5a18c26baebbc5de28884421f086e1d38fdb04
41
42extract.only        ${distname}${extract.suffix}
43
44post-extract {
45    system "cd ${workpath} && gzip -dc ${distpath}/cannadic-${dicversion}.tar.gz | tar --no-same-owner -xf -"
46}
47
48post-patch {
49    reinplace -locale C "s|__PREFIX__|${prefix}|" ${worksrcpath}/Canna.conf
50}
51
52use_xmkmf           yes
53
54pre-build {
55    build.target    canna
56    if {[variant_isset universal]} {
57        build.post_args CDEBUGFLAGS=\"${configure.cflags} ${configure.universal_cflags}\" SHLIBGLOBALSFLAGS=\"${configure.universal_cflags}\"
58    } else {
59        build.post_args CDEBUGFLAGS=\"${configure.cflags}\"
60    }
61}
62use_parallel_build  no
63post-build {
64    system "cd ${workpath}/cannadic-${dicversion} && ${worksrcpath}/cmd/crxdic/crxdic -D ${worksrcpath}/dic/ideo/grammar/cnj.bits -m -o gcanna.cbd gcanna.ctd"
65    system "cd ${workpath}/cannadic-${dicversion} && ${worksrcpath}/cmd/crfreq/crfreq -div 512 gcanna.cbd gcanna.mwd"
66}
67
68destroot.target install install.man
69destroot.keepdirs ${destroot}${prefix}/var/db/canna/dic/user \
70                  ${destroot}${prefix}/var/db/canna/dic/group
71pre-destroot {
72    addgroup canna
73    adduser canna gid=[existsgroup canna]
74}
75post-destroot {
76    foreach f {gcanna.cbd gcanna.cld gcannaf.ctd} {
77        xinstall -m 664 -o canna -g canna ${workpath}/cannadic-${dicversion}/${f} ${destroot}${prefix}/var/db/canna/dic/canna
78    }
79    xinstall -m 775 -o canna -g canna -d ${destroot}${prefix}/var/db/canna/dic/user
80    xinstall -m 775 -o canna -g canna -d ${destroot}${prefix}/var/db/canna/dic/group
81    xinstall -m 755 ${worksrcpath}/misc/rc.canna ${destroot}${prefix}/etc
82}
83post-destroot {
84    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
85    foreach f {COPYRIGHT ChangeLog INSTALL README WHATIS *.jp} {
86        eval xinstall -m 644 [glob ${worksrcpath}/${f}] ${destroot}${prefix}/share/doc/${name}
87    }
88}
89
90pre-install {
91    addgroup canna
92    adduser canna gid=[existsgroup canna]
93}
94
95startupitem.create      yes
96startupitem.name        canna
97startupitem.start       "${prefix}/etc/rc.canna start"
98startupitem.stop        "${prefix}/etc/rc.canna stop"
99
100variant universal {}
101
102variant inet description {Accept TCP 5680 incoming connections from clients. (Possible security risk.)} {
103    post-patch {
104        reinplace "s|-syslog|-syslog -inet|" ${worksrcpath}/misc/rc.canna
105    }
106}
107
108variant pdfdoc description {Create PDF documents using pTeX.} {
109    depends_build-append \
110                    port:ghostscript \
111                    port:ghostscript-fonts-hiragino \
112                    port:texlive-lang-japanese \
113                    port:texlive-latex-recommended
114
115    # https://trac.macports.org/ticket/48060
116    post-build {
117        system "cd ${worksrcpath}/doc/man/guide/tex && xmkmf && make canna.pdf"
118
119        # These two files are written in LaTeX 2.09!
120        system "cd ${worksrcpath}/doc/intern && platex -kanji=euc proto12.tex && platex -kanji=euc proto12.tex && dvipdfmx proto12.dvi"
121        system "cd ${worksrcpath}/doc/intern && platex -kanji=euc protocol.tex && platex -kanji=euc protocol.tex && dvipdfmx protocol.dvi"
122
123        system "cd ${worksrcpath}/doc/lisp && platex -kanji=euc canlisp.tex && platex -kanji=euc canlisp.tex && dvipdfmx canlisp.dvi"
124    }
125    post-destroot {
126        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/guide
127        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/intern
128        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/lisp
129
130        xinstall -m 644 ${worksrcpath}/doc/man/guide/tex/canna.pdf ${destroot}${prefix}/share/doc/${name}/guide
131        xinstall -m 644 ${worksrcpath}/doc/intern/proto12.pdf ${destroot}${prefix}/share/doc/${name}/intern
132        xinstall -m 644 ${worksrcpath}/doc/intern/protocol.pdf ${destroot}${prefix}/share/doc/${name}/intern
133        xinstall -m 644 ${worksrcpath}/doc/lisp/canlisp.pdf ${destroot}${prefix}/share/doc/${name}/lisp
134    }
135}
136
137livecheck.type      regex
138livecheck.regex     Canna (\[0-9.a-z\]+)
Note: See TracBrowser for help on using the repository browser.