[88848] trunk/dports/math/libsvm/Portfile

hum at macports.org hum at macports.org
Fri Jan 13 05:04:43 PST 2012


Revision: 88848
          http://trac.macports.org/changeset/88848
Author:   hum at macports.org
Date:     2012-01-13 05:04:43 -0800 (Fri, 13 Jan 2012)
Log Message:
-----------
libsvm: install documents and other stuffs in ${prefix}/share/libsvm; install sample data and python interface; fix permission of java directory; add python variants; add tools variant.

Modified Paths:
--------------
    trunk/dports/math/libsvm/Portfile

Modified: trunk/dports/math/libsvm/Portfile
===================================================================
--- trunk/dports/math/libsvm/Portfile	2012-01-13 12:58:19 UTC (rev 88847)
+++ trunk/dports/math/libsvm/Portfile	2012-01-13 13:04:43 UTC (rev 88848)
@@ -6,6 +6,7 @@
 name                libsvm
 epoch               1
 version             3.11
+revision            1
 categories          math
 maintainers         hum openmaintainer
 license             BSD
@@ -35,6 +36,8 @@
                     PREFIX=${prefix} \
                     VERSION=${libver}
 
+set libsvm_dir      ${prefix}/share/${name}
+
 destroot {
     xinstall -m 755 -W ${worksrcpath} svm-train svm-predict svm-scale ${destroot}${prefix}/bin
     xinstall -m 644 -W ${worksrcpath} libsvm.a libsvm.${libver}.dylib ${destroot}${prefix}/lib
@@ -42,9 +45,12 @@
 
     ln -sf ${name}.${libver}.dylib ${destroot}${prefix}/lib/${name}.dylib
 
-    set docs ${destroot}${prefix}/share/doc/${name}
-    xinstall -m 755 -d ${docs}
-    xinstall -m 644 -W ${worksrcpath} COPYRIGHT README FAQ.html ${docs}
+    xinstall -m 755 -d ${destroot}${libsvm_dir}
+    xinstall -m 644 -W ${worksrcpath} COPYRIGHT README FAQ.html heart_scale ${destroot}${libsvm_dir}
+
+    # install python interface.
+    xinstall -m 755 -d ${destroot}${libsvm_dir}/python
+    xinstall -m 644 -W ${worksrcpath}/python README svm.py svmutil.py ${destroot}${libsvm_dir}/python
 }
 
 variant java description {Install Java JAR files} {
@@ -52,11 +58,69 @@
 
     post-destroot {
         set jdir ${destroot}${prefix}/share/java
-        xinstall -m 775 -d ${jdir}
+        xinstall -m 755 -d ${jdir}
         file rename ${worksrcpath}/java ${jdir}/${name}
     }
 }
 
+variant python24 description {Install Python 2.4 interface} {
+    depends_lib-append  port:python24
+    post-destroot { install_py 2.4 }
+}
+
+variant python25 description {Install Python 2.5 interface} {
+    depends_lib-append  port:python25
+    post-destroot { install_py 2.5 }
+}
+
+variant python26 description {Install Python 2.6 interface} {
+    depends_lib-append  port:python26
+    post-destroot { install_py 2.6 }
+}
+
+variant python27 description {Install Python 2.7 interface} {
+    depends_lib-append  port:python27
+    post-destroot { install_py 2.7 }
+}
+
+variant python31 description {Install Python 3.1 interface} {
+    depends_lib-append  port:python31
+    post-destroot { install_py 3.1 }
+}
+
+variant python32 description {Install Python 3.2 interface} {
+    depends_lib-append  port:python32
+    post-destroot { install_py 3.2 }
+}
+
+proc install_py {branch} {
+    global frameworks_dir destroot worksrcpath
+    set py_prefix  ${frameworks_dir}/Python.framework/Versions/${branch}
+    set dir        ${destroot}${py_prefix}/lib/python${branch}/site-packages
+    xinstall -m 755 -d ${dir}
+    xinstall -m 644 -W ${worksrcpath}/python svm.py svmutil.py ${dir}
+}            
+
+# TODO: matlab and svm-toy.
+
+variant tools description {Install useful tools} {
+    depends_lib-append  port:gnuplot
+
+    # fselect.py, plotroc.py and gridregression.py are taken from
+    # http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/:
+    # fselect/fselect.py, roc/plotroc.py, gridsvr/gridregression.py
+    post-destroot {
+        file rename ${worksrcpath}/tools ${destroot}${libsvm_dir}
+        xinstall -m 755 -W ${filespath} \
+            fselect.py plotroc.py gridregression.py       ${destroot}${libsvm_dir}/tools
+        foreach py {easy.py grid.py fselect.py plotroc.py gridregression.py} {
+            reinplace "s|\"\\.\\./|\"${prefix}/bin/|g"    ${destroot}${libsvm_dir}/tools/${py}
+            reinplace "s|\"\\./|\"${libsvm_dir}/tools/|g" ${destroot}${libsvm_dir}/tools/${py}
+            reinplace "s|\"/usr/bin/|\"${prefix}/bin/|g"  ${destroot}${libsvm_dir}/tools/${py}
+        }
+    }
+}
+
 default_variants    +java
 
 livecheck.type      regex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120113/da0c95cc/attachment.html>


More information about the macports-changes mailing list