# -*- 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
# $Id: Portfile 84038 2011-09-15 16:21:51Z hum@macports.org $

PortSystem          1.0

name                liblinear
version             1.8

categories          math
maintainers         hum openmaintainer
license             BSD
platforms           darwin

description         A simple package for solving large-scale regularized linear classification.

long_description    LIBLINEAR is a simple package for solving large-scale regularized \
                    linear classification. It currently supports L2-regularized logistic \
                    regression/L2-loss support vector classification/L1-loss support vector \
                    classification, and L1-regularized L2-loss support vector classification/ \
                    logistic regression.

homepage            http://www.csie.ntu.edu.tw/~cjlin/liblinear/
master_sites        ${homepage}

checksums           sha1    26f4a47ed1546996eaac21f5282e1cc42b59a623 \
                    rmd160  7f97f336709c1418550bc60013b9daf99a507c07

patchfiles          patch-Makefile.diff

use_configure       no

# /usr/bin/ranlib: archive member: liblinear.a(blas.a) fat file for cputype (16777223) cpusubtype (3) is not an object file (bad magic number)
universal_variant   no

set libver          ${version}.0
build.target        all
build.args          CC="${configure.cc} ${configure.cc_archflags}" \
                    CXX="${configure.cxx} ${configure.cxx_archflags}" \
                    PREFIX=${prefix} \
                    VERSION=${libver}

destroot {
    xinstall -m 755 -W ${worksrcpath} train predict ${destroot}${prefix}/bin
    xinstall -m 644 -W ${worksrcpath} liblinear.a liblinear.${libver}.dylib ${destroot}${prefix}/lib
    xinstall -m 644 -W ${worksrcpath} linear.h tron.h ${destroot}${prefix}/include

    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 heart_scale ${docs}
}

livecheck.type          regex
livecheck.regex         {Version *([0-9.]+) *}
