# $Id: Portfile 34602 2008-02-29 04:07:04Z jmr@macports.org $

PortSystem      1.0

name            mp3info	
version         0.8.5a
categories      audio
platforms		darwin
maintainers     nomaintainer
description     MP3 information tool

long_description \
    A small utility to read and write TAG info, as well as retrieve the MP3 \
    Header info. Included is a command-line interface and a gtk-UI.

homepage        http://www.ibiblio.org/mp3info/
master_sites    sunsite:apps/sound/mp3-utils/${name}
extract.suffix  .tgz

checksums       md5 cb7b619a10a40aaac2113b87bb2b2ea2 \
                sha1 54df29eb6c2e581899affc12be698b0a71d91ca6 \
                rmd160 898b566d9ba2f352949d061d991d92f2c8996ec3

depends_lib     port:ncurses

patchfiles      patch-mp3tech.c.diff

configure {
   reinplace -E "s|(LIBS =)|\\1 ${configure.ldflags}|" ${worksrcpath}/Makefile 
}

build.target    mp3info

destroot.target     install-mp3info
destroot.args       INSTALL=/usr/bin/install
destroot.destdir    prefix=${destroot}${prefix} \
                    mandir=${destroot}${prefix}/share/man/man1 \

post-destroot {
    set docdir ${prefix}/share/doc/${name}-${version}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} ChangeLog LICENSE README mp3info.txt mp3info.html \
        ${destroot}${docdir}
}

variant gtk description {Enable GTK user interface} {
    depends_build-append    port:pkgconfig
    depends_lib-append      port:gtk1

    build.target            all
    destroot.target         install
}

variant universal {
    post-configure {
        reinplace -E "/^CFLAGS/s|\$| [join ${configure.universal_cflags} " "]|" ${worksrcpath}/Makefile
    }
}

