# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 68352 2010-06-02 00:52:48Z jmr@macports.org $

PortSystem 1.0

name		libid3tag
version		0.15.1b
revision	1
categories	audio
maintainers	nomaintainer
description	id3 tag manipulation library
long_description	libid3tag is a library for reading and \
	writing ID3 tags, bothID3v1 \
	and the various versions of ID3v2.
platforms	darwin freebsd
homepage	http://www.underbit.com/products/mad/
master_sites	ftp://ftp.mars.org/pub/mpeg/ sourceforge:mad
checksums	sha1 4d867e8a8436e73cd7762fe0e85958e35f1e4306
depends_lib	port:zlib

patchfiles	patch-id3tag.diff
post-patch {
	reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/id3tag.pc
	reinplace "s|@VERSION@|${version}|g" ${worksrcpath}/id3tag.pc
}

post-configure {
	if {[variant_isset universal]} {
		reinplace "s|CC -dynamiclib|CC -dynamiclib ${configure.universal_ldflags}|g" ${worksrcpath}/libtool
	}
}

post-destroot {
	xinstall -m 0644 ${worksrcpath}/id3tag.pc \
 		${destroot}${prefix}/lib/pkgconfig
}

livecheck.type  regex
livecheck.url   ftp://ftp.mars.org/pub/mpeg/
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*\[a-z\])${extract.suffix}"
