# -*- 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 75619 2011-02-01 17:26:41Z rmstonecipher@macports.org $

PortSystem          1.0

name                libebml
version             1.2.0
categories          textproc
maintainers         nomaintainer
description         EBML (Extensible Binary Meta Language), sort of binary version of XML.
long_description    EBML (Extensible Binary Meta Language), a binary derivative of \
                    XML. EBML enables the Matroska Development Team to gain \
                    significant advantages in terms of future format \
                    extensibility, without breaking file support in old parsers.
homepage            http://www.matroska.org/
platforms           darwin
master_sites        http://dl.matroska.org/downloads/${name}/
use_bzip2           yes

checksums           md5     26fbaa556bb497c1134d33b84ab34443 \
                    sha1    4107fd6496b5aae3f0e7a96cb3008341a5b224bc \
                    rmd160  213b7f9e18cf71f250d83d278ebd7e27220cdebc

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

use_configure       no

variant universal {}
if {[variant_isset universal]} {
    set archflags ${configure.universal_cxxflags}
} else {
    set archflags ${configure.cxx_archflags}
}

build.dir           ${worksrcpath}/make/darwin
build.args          prefix=${prefix} \
                    CXX=${configure.cxx} \
                    CXXFLAGS="${archflags}"

# 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.
livecheck.type      regex
livecheck.url       http://www.bunkus.org/videotools/mkvtoolnix/source.html
livecheck.regex     ${name} (\[0-9.\]+)
