# -*- 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 117996 2014-03-18 18:31:19Z jeremyhu@macports.org $

PortSystem      1.0

name            libdvdread
version         4.2.1
categories      devel multimedia
platforms       darwin
# nav_print.c and nav_types.h do not allow "any later version"
license         GPL-2
maintainers     nomaintainer
description     simple foundation for reading DVD-Video images

long_description \
    libdvdread provides a simple foundation for reading DVD-Video \
    images. It offers DVD applications: \
    1. A simple abstraction for reading the files on a DVD image \
       (dvd_reader.h). \
    2. A simple library for parsing the information (IFO) files \
       (ifo_read.h/ifo_types.h). \
    3. A simple library for parsing the navigation (NAV) packets \
       (nav_read.h/nav_types.h).

homepage        http://dvdnav.mplayerhq.hu/
master_sites    ${homepage}releases/

use_xz              yes
checksums           rmd160  50ae1afbbabc5a8640dbf065184f52af38d0ef6d \
                    sha256  af9b98f049580a6521d56c978b736d3d609562dd12955e11d50e26d97542dcd4

depends_build   port:autoconf port:automake port:libtool
depends_lib     port:libdvdcss

patchfiles      patch-src_dvd_input.c.diff
post-patch {
    reinplace -locale C "s|@@PREFIX@@|${prefix}|" ${worksrcpath}/src/dvd_input.c
}

configure.cmd   ./autogen.sh

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