# $Id: Portfile,v 1.4 2005/04/21 15:58:12 jberry Exp $

PortSystem 1.0
PortGroup python24 1.0

name			py-mad
version			0.5.1
revision		2
categories		python audio
platforms		darwin
maintainers		mww@opendarwin.org
description		python interface to the MPEG Audio Decoder library
long_description	pymad is a Python module that allows Python programs \
				to use the MPEG Audio Decoder library. pymad provides \
				a high-level API, similar to the pyogg module, which \
				makes reading PCM data from MPEG audio streams a piece \
				of cake.

homepage		http://spacepants.org/src/pymad/
master_sites	${homepage}/download/
distname		pymad-${version}
checksums		md5 9b9a6c77d1b7a7706e77fd2e7e964c01

depends_lib-append	lib:libmad:libmad \
				port:py-ao

patch	{
	reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/config_unix.py
}

use_configure	yes
configure.cmd	${python.bin} config_unix.py

post-destroot	{
	xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING NEWS README THANKS \
		${destroot}${prefix}/share/doc/${name}
	cd ${destroot}${prefix}/lib/python2.4/site-packages/
	file rename madmodule.so mad.so
}
