# -*- 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 82565 2011-08-15 20:37:25Z ryandesign@macports.org $

PortSystem 1.0

name		libid3tag
version		0.15.1b
revision	2
categories	audio
license		GPL-2+
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 \
		rmd160  31a69b8ad7684aefdb675acc8ebf89bd6f432095
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 {
    reinplace "s|CC -dynamiclib|CC -dynamiclib [get_canonical_archflags]|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}"
