source: trunk/dports/java/mecab-java/Portfile @ 81621

Last change on this file since 81621 was 81621, checked in by hum@…, 9 years ago

java/mecab-java: 0.98pre3_1

  • abort an installation if mecab +utf8 is not installed.

See http://lists.macosforge.org/pipermail/macports-dev/2011-August/015476.html
Thanks to Ryan.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.6 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 81621 2011-08-03 02:38:15Z hum@macports.org $
3
4PortSystem          1.0
5
6name                mecab-java
7version             0.98pre3
8revision            1
9categories          java textproc japanese
10platforms           darwin
11maintainers         nomaintainer
12license             GPL-2 LGPL-2.1 BSD
13
14description         a Java module for MeCab
15long_description    ${name} is ${description}.
16
17homepage            http://mecab.sourceforge.net/
18master_sites        sourceforge:mecab/${name}/${version}
19
20checksums           sha1    dcd5c636f76cf7040f7c3ec0380d45b6851dce03 \
21                    rmd160  9214b1e3b2f24334709bdd3adc69da076c892c67
22
23# This port requires mecab+utf8 althought the default character encoding of
24# mecab is not utf-8 but euc-jp.
25# It will just check the encoding of mecab in the pre-fetch phase instead of
26# depends_lib, because depends_lib could not specify a variant.
27#depends_lib         port:mecab
28
29pre-fetch {
30    catch {exec $prefix/bin/mecab -D} dict_info
31    if {![regexp {charset:\s+utf\-8} $dict_info]} {
32        ui_error "mecab-java requires MeCab for UTF-8.\
33                  Please install mecab +utf8 first.\
34                  If another encoding version of MeCab is already installed,\
35                  you should uninstall mecab beforehand."
36        return -code error "MeCab for UTF-8 is missing"
37    }
38}
39
40patchfiles          patch-Makefile.diff \
41                    patch-test.java.diff
42
43post-patch {
44    reinplace "s|@java_library_path@|${prefix}/lib|g" ${worksrcpath}/test.java
45}
46
47use_configure       no
48
49variant universal {}
50if {[variant_isset universal]} {
51    set archflags ${configure.universal_cxxflags}
52} else {
53    set archflags ${configure.cxx_archflags}
54}
55
56build.args          CXX="${configure.cxx}" \
57                    CXXFLAGS="${configure.cxxflags} ${archflags}"
58
59test.run            yes
60
61destroot    {
62    xinstall -m 755 -d \
63        ${destroot}${prefix}/share/java \
64        ${destroot}${prefix}/share/doc/${name}
65    xinstall -m 644 -W ${worksrcpath} \
66        AUTHORS BSD COPYING GPL LGPL bindings.html test.java \
67        ${destroot}${prefix}/share/doc/${name}
68    xinstall -m 644 ${worksrcpath}/mecab.jar \
69        ${destroot}${prefix}/share/java
70    xinstall -m 644 ${worksrcpath}/lib${name}.dylib \
71        ${destroot}${prefix}/lib
72}
73
74# a distfile folder for a newer version 0.98 exists, but is empty.
75livecheck.type      none
76#livecheck.type      regex
77#livecheck.url       http://sourceforge.net/projects/mecab/files/mecab-java
78#livecheck.regex     /${name}\/(\[0-9.\]+)/
Note: See TracBrowser for help on using the repository browser.