OSDN Git Service

cmigemo 1.3c_7
[splhack/MacPorts.git] / textproc / cmigemo / Portfile
1 # $Id:  $
2
3 PortSystem 1.0
4 name                    cmigemo
5 version                 1.3c
6 revision                7
7 categories              textproc
8 depends_lib             bin:iconv:libiconv bin:nkf:nkf
9 maintainers             nomaintainer
10 description             C/Migemo is a Japanese incremental search tool.
11 long_description        \
12         C/Migemo is a set of a library and an application to search \
13         Japanese words incrementally, or a C version of Migemo originally \
14         written in Ruby.
15 patchfiles              patch-config.mk.in.diff \
16                                 patch-config_default.mk.diff patch-dict.mk.diff \
17                                 patch-Make_osx.mk.diff \
18                                 patch-romaji.c patch-mnode.c
19 extract.suffix  tar.bz2
20 use_bzip2               yes
21 set dicver              20041227
22 distfiles               ${distname}${extract.suffix}:src \
23                                 SKK-JISYO-${dicver}.L.gz:dic
24 homepage                http://www.kaoriya.net/
25 master_sites    http://www.kaoriya.net/dist/var:src \
26                                 http://www.lapangan.net/pc/tarball:dic
27 checksums               ${distname}${extract.suffix} md5 \
28                                         0b9d2feff4cfdc673cc1947fe54191ed \
29                                 SKK-JISYO-${dicver}.L.gz md5 \
30                                         0016d039378e85e1489c7e8f9a5969c7
31 extract.only    ${distname}${extract.suffix}
32 post-extract    {file copy ${distpath}/SKK-JISYO-${dicver}.L.gz \
33                                           ${worksrcpath}/dict/SKK-JISYO.L.gz}
34 build.env                       CC=cc
35 build.target            osx osx-dict
36
37 set dics                        {han2zen.dat hira2kata.dat migemo-dict roma2hira.dat zen2han.dat}
38 set tools                       {skk2migemo.pl optimize-dict.pl}
39
40 post-patch                      {
41         reinplace "s|/usr/local|${prefix}|" \
42                 ${worksrcpath}/compile/config.mk.in  \
43                 ${worksrcpath}/compile/config_default.mk \
44                 ${worksrcpath}/tools/migemo.vim
45         foreach TOOL ${tools} {
46                 reinplace "s|/usr/bin/|/usr/bin/env |" ${worksrcpath}/tools/${TOOL}
47         }
48 }
49
50 destroot                        {
51         # bin
52         xinstall -d -m 755 ${destroot}${prefix}/bin
53         xinstall -m 755 ${worksrcpath}/build/cmigemo \
54                         ${destroot}${prefix}/bin
55         # include
56         xinstall -d -m 755 ${destroot}${prefix}/include
57         xinstall -m 644 ${worksrcpath}/src/migemo.h \
58                         ${destroot}${prefix}/include
59         # doc
60         xinstall -d -m 755 ${destroot}${prefix}/share/doc/migemo
61         xinstall -m 644 ${worksrcpath}/doc/README_j.txt \
62                         ${destroot}${prefix}/share/doc/migemo
63         # dict
64         xinstall -d -m 755 ${destroot}${prefix}/share/migemo/euc-jp
65         xinstall -d -m 755 ${destroot}${prefix}/share/migemo/cp932
66         foreach DIC ${dics} {
67                 xinstall -m 644 ${worksrcpath}/dict/${DIC} \
68                         ${destroot}${prefix}/share/migemo/cp932
69                 xinstall -m 644 ${worksrcpath}/dict/euc-jp.d/${DIC} \
70                         ${destroot}${prefix}/share/migemo/euc-jp
71         }
72         # tools
73         xinstall -d -m 755 ${destroot}${prefix}/share/migemo/tools
74         xinstall -m 644 ${worksrcpath}/tools/migemo.vim \
75                 ${destroot}${prefix}/share/migemo/tools
76         foreach TOOL ${tools} {
77                 xinstall -m 644 ${worksrcpath}/tools/${TOOL} \
78                         ${destroot}${prefix}/share/migemo/tools
79         }
80         # lib
81         xinstall -d -m 755 ${destroot}${prefix}/lib
82         xinstall -m 755 ${worksrcpath}/libmigemo.1.1.0.dylib \
83                 ${destroot}${prefix}/lib
84         foreach dylib {libmigemo.1 libmigemo} { 
85                 system "ln -s ./libmigemo.1.1.0.dylib ${destroot}${prefix}/lib/${dylib}.dylib"
86         }
87 }
88
89 variant utf8 {
90         post-build {
91                 system "mkdir dict/utf-8.d"
92                 foreach DIC ${dics} {
93                         system "nkf -w < dict/${DIC} > dict/utf-8.d/${DIC}"
94                 }
95         }
96
97         post-destroot {
98                 xinstall -d -m 755 ${destroot}${prefix}/share/migemo/utf-8
99                 foreach DIC ${dics} {
100                         xinstall -m 644 ${worksrcpath}/dict/utf-8.d/${DIC} \
101                         ${destroot}${prefix}/share/migemo/utf-8
102                 }
103         }
104 }
105
106 variant universal {
107         patchfiles-append       patch-universal
108 }