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

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

added a new port for dualist version 0.1; #29984

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