# -*- 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 106230 2013-05-20 01:41:21Z rmstonecipher@macports.org $

PortSystem          1.0
PortGroup           python27 1.0

name                quodlibet
version             2.5.1
categories-append   audio gnome
maintainers         elelay rmstonecipher openmaintainer
license             GPL-2
platforms           darwin
description         audio library manager and player for GTK+

long_description \
Quod Libet is a GTK+-based audio player written in Python, \
using the Mutagen tagging library and GStreamer for playback.\
It provides several different ways to view your audio library, \
as well as support for Internet radio and audio feeds.\
It has extremely flexible metadata tag editing and searching capabilities.

homepage            http://code.google.com/p/quodlibet/
master_sites        googlecode

distfiles-append    ${name}-plugins-${version}${extract.suffix}

checksums           ${name}-${version}.tar.gz \
                    rmd160  75d61781ee8b92284544243eef614bcfabefbd6f \
                    sha256  39c8b480b4180cfafe573ee12b4f74603b64c41d05411caf295205b2b2e862f8 \
                    ${name}-plugins-${version}.tar.gz \
                    rmd160  8010b2cd0b6594b83ecf978ba2f74e4cf81ebb0b \
                    sha256  3f50057815b80d9597f341e3bdd66f2d298e74e1e4e47d7d740a7dd4f93b3d70

depends_build       port:intltool
depends_lib         port:dbus-python27 \
                    port:gstreamer010-gst-plugins-good \
                    port:py27-gst-python \
                    port:py27-mutagen \
                    port:py27-feedparser \
                    port:python-musicbrainz2

post-patch {
    foreach file { quodlibet.py exfalso.py } {
        reinplace "s|/usr/bin/env python|${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7|g" \
            ${worksrcpath}/${file}
    }
}

post-destroot {
    system "cd ${workpath}/${name}-plugins-${version}/ && cp -vR * ${destroot}/${python.pkgd}/${name}/plugins/"
}

notes "If you want to play mp3 files, don't forget to install gstreamer010-gst-plugins-ugly"

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