# -*- 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 68002 2010-05-24 10:09:00Z stromnov@macports.org $

PortSystem          1.0

name                vlfeat
version             0.9.8
revision            1
categories          graphics devel
platforms           darwin
maintainers         stromnov openmaintainer
description         Implementation of SIFT, MSER and other CV algorithms.

long_description \
    The VLFeat open source library implements popular computer vision \
    algorithms including SIFT, MSER, k-means, hierarchical k-means, \
    agglomerative information bottleneck, and quick shift.

homepage            http://vlfeat.org/
master_sites        http://vlfeat.org/download/

checksums           md5     7544962c9c8f4b9bb2f9ee7c01d7aebf \
                    sha1    931ffc0bc96e20e1fa2f970f53142fb248c480a1 \
                    rmd160  baa08a9369fc90b7087e77190e6290600189762b

use_configure       no

post-patch {
    reinplace "s|-install_name @loader_path/|-install_name ${prefix}/lib/|g" ${worksrcpath}/make/dll.mak
}

destroot {
    xinstall -m 755 -W ${worksrcpath}/bin/maci libvl.dylib ${destroot}${prefix}/lib
    xinstall -m 755 -W ${worksrcpath}/bin/maci sift mser ${destroot}${prefix}/bin
    xinstall -d -m 755 ${destroot}${prefix}/include/vl
    foreach header [glob -directory ${worksrcpath}/vl *.h] {
         xinstall -m 644 $header ${destroot}${prefix}/include/vl
    }
}

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
