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

Last change on this file since 57382 was 57382, checked in by ryandesign@…, 10 years ago

Remove imake dependency from ports using "use_xmkmf yes" because
MacPorts 1.8 adds imake to depends_build automatically when needed
See http://lists.macosforge.org/pipermail/macports-dev/2009-August/009699.html

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