source: trunk/dports/java/dualist/Portfile @ 81620

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

java/dualist: 0.1_1

  • added "math" category.
  • added "supported_archs noarch".
  • replaced system "chmod" and "ln" with tcl commands.
  • moved notes outside the phases to run "port notes".
  • quoted the argument variable "$@" in scripts.

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

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.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 81620 2011-08-03 02:30:47Z hum@macports.org $
3
4PortSystem          1.0
5
6name                dualist
7version             0.1
8revision            1
9categories          java math textproc
10platforms           darwin
11maintainers         hum openmaintainer
12license             Apache-2.0
13
14description         An interactive machine learning system for building classifiers quickly.
15
16long_description    DUALIST is an interactive machine learning system for building classifiers \
17                    quickly. It does so by asking \"questions\" of the user in the form of both data \
18                    instances (e.g., text documents) and features (e.g., words or phrases). It \
19                    utilizes active and semi-supervised learning to quickly train a multinomial \
20                    naive Bayes classifier for this setting.
21
22homepage            http://code.google.com/p/dualist/
23master_sites        googlecode:${name}
24
25checksums           sha1    7a2fc1fd432c71e2575a1514a946bbf68652fdfa \
26                    rmd160  8b4ca3fcd3ec42eeda43235c246390f07a849998
27
28depends_run         port:play
29
30use_zip             yes
31worksrcdir          ${name}
32
33set java_home       /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
34
35pre-configure {
36    if {![file exists ${java_home}]} {
37        ui_error "Java 1.6 is required, but not located at ${java_home}"
38        return -code error "Java 1.6 missing"
39    }
40}
41
42use_configure       no
43supported_archs     noarch
44
45build.cmd           true
46
47set share_java_dir  ${prefix}/share/java
48set dualist_dir     ${share_java_dir}/${worksrcdir}
49
50destroot {
51    # Copy the distribution.
52    xinstall -m 755 -d  ${destroot}${share_java_dir}
53    copy ${worksrcpath} ${destroot}${share_java_dir}
54
55    # Configure working directories.
56    xinstall -m 1777 -d ${destroot}${dualist_dir}/tmp
57    file attributes     ${destroot}${dualist_dir}/public/results -permissions 01777
58    destroot.keepdirs   ${destroot}${dualist_dir}/tmp \
59                        ${destroot}${dualist_dir}/public/results
60
61    # Install an extra script for this port.
62    xinstall -m 755 ${filespath}/dualist     ${destroot}${prefix}/bin
63    reinplace "s|@prefix@|${prefix}|g"       ${destroot}${prefix}/bin/dualist
64    reinplace "s|@java_home@|${java_home}|g" ${destroot}${prefix}/bin/dualist
65}
66
67notes "To try DUALIST, run 'dualist' and open http://localhost:9000/."
68
69post-deactivate {
70    ui_msg "To revert the system after uninstalling the port,"
71    ui_msg "delete the dualist directory:"
72    ui_msg "  $ sudo rm -rf ${dualist_dir}"
73}
74
75variant mecab description {Use MeCab to analyze Japanese texts} {
76    depends_lib-append port:mecab-java
77    patchfiles-append  patch-mecab.diff
78
79    post-extract {
80        xinstall -m 644 -W ${filespath} \
81            Makefile \
82            SimpleMecabPipe.java \
83            ${worksrcpath}
84        file link -symbolic ${worksrcpath}/lib/mecab.jar ${prefix}/share/java/mecab.jar
85    }
86
87    post-patch {
88        reinplace "s|@java_home@|${java_home}|g" ${worksrcpath}/Makefile
89    }
90       
91    build.cmd  make
92
93    post-destroot {
94        # Install an extra script for this variant.
95        xinstall -m 755 ${filespath}/dualist-mecab ${destroot}${prefix}/bin
96        reinplace "s|@prefix@|${prefix}|g"         ${destroot}${prefix}/bin/dualist-mecab
97        reinplace "s|@java_home@|${java_home}|g"   ${destroot}${prefix}/bin/dualist-mecab
98    }
99
100    notes-append "For Japanese texts, run 'dualist-mecab' instead of 'dualist'."
101}
102
103livecheck.type      regex
104livecheck.url       http://code.google.com/p/dualist/downloads/list
105livecheck.regex     ${name}-(\[0-9.\]+)\.zip
Note: See TracBrowser for help on using the repository browser.