source: trunk/dports/math/libsvm/Portfile @ 102224

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

libsvm: update to 3.16.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.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 102224 2013-01-29 15:20:45Z hum@macports.org $
3
4PortSystem          1.0
5
6name                libsvm
7epoch               1
8version             3.16
9categories          math
10maintainers         hum openmaintainer
11license             BSD
12platforms           darwin
13
14description         A free Support Vector Machine implementation.
15
16long_description    ${description} By Chih-Chung Chang and Chih-Jen Lin of       \
17                    National Taiwan University. \"LIBSVM is an integrated        \
18                    software for support vector classification, (C-SVC, nu-SVC), \
19                    regression (epsilon-SVR, nu-SVR) and distribution estimation \
20                    (one-class SVM ). It supports multi-class classification.\"
21
22homepage            http://www.csie.ntu.edu.tw/~cjlin/libsvm/
23master_sites        ${homepage}
24checksums           rmd160  e80a12ae43ecb619362498b75d8cb8089d72bfc9 \
25                    sha256  e04dae319f0622a0f7c4500bb593879f3444cd68b4fc5bd6dff1f2fda9f0db97
26
27patchfiles          patch-Makefile.diff
28
29use_configure       no
30
31set libver          ${version}.0
32build.target        all
33build.args          CXX="${configure.cxx} ${configure.cxx_archflags}" \
34                    PREFIX=${prefix} \
35                    VERSION=${libver}
36
37set docdir          ${prefix}/share/doc/${name}
38set libsvm_dir      ${prefix}/share/${name}
39
40destroot {
41    xinstall -m 755 -W ${worksrcpath} svm-train svm-predict svm-scale ${destroot}${prefix}/bin
42    xinstall -m 644 -W ${worksrcpath} libsvm.a libsvm.${libver}.dylib ${destroot}${prefix}/lib
43    xinstall -m 644 -W ${worksrcpath} svm.h ${destroot}${prefix}/include
44
45    ln -sf ${name}.${libver}.dylib ${destroot}${prefix}/lib/${name}.dylib
46
47    xinstall -m 755 -d ${destroot}${docdir}
48    xinstall -m 755 -d ${destroot}${libsvm_dir}
49    xinstall -m 644 -W ${worksrcpath} COPYRIGHT README FAQ.html ${destroot}${docdir}
50    xinstall -m 644 -W ${worksrcpath} heart_scale               ${destroot}${libsvm_dir}
51
52    # install python interface.
53    xinstall -m 755 -d ${destroot}${libsvm_dir}/python
54    xinstall -m 644 -W ${worksrcpath}/python README svm.py svmutil.py ${destroot}${libsvm_dir}/python
55}
56
57variant java description {Install Java JAR files} {
58    depends_run-append  bin:java:kaffe
59
60    post-destroot {
61        set jdir ${destroot}${prefix}/share/java
62        xinstall -m 755 -d ${jdir}
63        file rename ${worksrcpath}/java ${jdir}/${name}
64    }
65}
66
67variant python24 description {Install Python 2.4 interface} {
68    depends_lib-append  port:python24
69    post-destroot { install_py 2.4 }
70}
71
72variant python25 description {Install Python 2.5 interface} {
73    depends_lib-append  port:python25
74    post-destroot { install_py 2.5 }
75}
76
77variant python26 description {Install Python 2.6 interface} {
78    depends_lib-append  port:python26
79    post-destroot { install_py 2.6 }
80}
81
82variant python27 description {Install Python 2.7 interface} {
83    depends_lib-append  port:python27
84    post-destroot { install_py 2.7 }
85}
86
87variant python31 description {Install Python 3.1 interface} {
88    depends_lib-append  port:python31
89    post-destroot { install_py 3.1 }
90}
91
92variant python32 description {Install Python 3.2 interface} {
93    depends_lib-append  port:python32
94    post-destroot { install_py 3.2 }
95}
96
97proc install_py {branch} {
98    global frameworks_dir destroot worksrcpath
99    set py_prefix  ${frameworks_dir}/Python.framework/Versions/${branch}
100    set dir        ${destroot}${py_prefix}/lib/python${branch}/site-packages
101    xinstall -m 755 -d ${dir}
102    xinstall -m 644 -W ${worksrcpath}/python svm.py svmutil.py ${dir}
103}           
104
105# TODO: matlab and svm-toy.
106
107variant tools description {Install useful tools} {
108#    depends_run-append  port:gnuplot
109
110    # fselect.py, plotroc.py and gridregression.py are taken from
111    # http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/:
112    # fselect/fselect.py, roc/plotroc.py, gridsvr/gridregression.py
113    post-destroot {
114        file rename ${worksrcpath}/tools ${destroot}${libsvm_dir}
115        xinstall -m 755 -W ${filespath} \
116            fselect.py plotroc.py gridregression.py       ${destroot}${libsvm_dir}/tools
117        foreach py {easy.py grid.py fselect.py plotroc.py gridregression.py} {
118            reinplace "s|\"\\.\\./|\"${prefix}/bin/|g"    ${destroot}${libsvm_dir}/tools/${py}
119            reinplace "s|\"\\./|\"${libsvm_dir}/tools/|g" ${destroot}${libsvm_dir}/tools/${py}
120            reinplace "s|\"/usr/bin/|\"${prefix}/bin/|g"  ${destroot}${libsvm_dir}/tools/${py}
121        }
122    }
123}
124
125default_variants    +java +tools
126
127livecheck.type      regex
128livecheck.regex     {Version ([0-9.]+) }
Note: See TracBrowser for help on using the repository browser.