# $Id: Portfile 59973 2009-10-28 07:05:26Z pguyot@kallisys.net $

PortSystem          1.0

name                libmatroska
version             0.8.1
categories          multimedia
maintainers         nomaintainer
description         Matroska is an extensible open standard audio/video container format.
long_description    \
                    Matroska is an extensible open standard audio/video container \
                    format. This library is there to support this format and has \
                    been written by the Matroska project team.
                
homepage            http://www.matroska.org/
platforms           darwin
master_sites        http://dl.matroska.org/downloads/${name}/
checksums           md5 20cf624ace0c58a54c7752eebfbc0b19 \
                    sha1 8317c3a2a19f27a05c5dd289c3496c21a1d12456 \
                    rmd160 195ca5fcf48653fea56e42ce4074d16447c680ac
use_bzip2           yes

depends_lib         lib:libebml.a:libebml

post-extract {
    system "cd ${worksrcpath}/make && cp -R linux darwin"
}

use_configure       no

build.dir           ${worksrcpath}/make/darwin
build.args          prefix=${prefix} \
                    CXX=${configure.cxx} \
                    LIBEBML_INCLUDE_DIR=${prefix}/include \
                    LIBEBML_LIB_DIR=${prefix}/lib

test.run            yes
test.cmd            ./test6 && ./test8 && ./test9
test.target

# We need -p for install because ld will ask for ranlib if the modification date changes.
destroot.args       INSTALL_OPTS_LIB='-m 644 -p'
destroot.destdir    prefix=${destroot}${prefix}

livecheck.type  regexm
livecheck.url   http://www.bunkus.org/videotools/mkvtoolnix/source.html
livecheck.regex ${name} (\[0-9.\]+)
