# -*- 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 91754 2012-04-09 19:40:20Z jeremyhu@macports.org $

PortSystem              1.0
PortGroup               muniversal 1.0

name			libmpeg2
version			0.5.1
revision                2
categories		multimedia
license			GPL-2+
maintainers		nomaintainer
homepage		http://libmpeg2.sourceforge.net/
description		A free library for decoding mpeg-2 and mpeg-1 video streams.
long_description        libmpeg2 is a free library for decoding \
				mpeg-2 and mpeg-1 video streams.  The main \
				goals in libmpeg2 development are \
				conformance, speed, portability, and reuseability.
platforms		darwin
master_sites		${homepage}files/

checksums               md5     0f92c7454e58379b4a5a378485bbd8ef \
                        sha1    0f9163d8fd52db5f577ebe45636f674252641fd7 \
                        rmd160  00b2d669655ed3f7a176f5eecc925045159a0301

depends_lib		path:lib/pkgconfig/sdl.pc:libsdl \
                        port:xorg-libXv

patchfiles              universal.patch
patch.pre_args          -p1

configure.args          --enable-shared \
                        --mandir=${prefix}/share/man \
                        --x-includes=${prefix}/include \
                        --x-libraries=${prefix}/lib

variant no_sdl description {Don't use libsdl} {
	depends_lib-delete	path:lib/pkgconfig/sdl.pc:libsdl
	configure.args-append --disable-sdl
}

variant no_x11 {
        configure.args-append --without-x
        configure.args-delete --x-includes=${prefix}/include
        configure.args-delete --x-libraries=${prefix}/lib
        depends_lib-delete port:xorg-libXv
}

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