# $Id: Portfile 61914 2009-12-23 21:36:13Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           kde4    1.0

name                amarok-devel
version             git-20090927
categories          kde kde4
maintainers         illogic-al openmaintainer
description         Amarok, the world-renowned media player.
long_description    Amarok is a music player and manager with an intuitive \
                    interface. It provides a variety of feature which helps \
                    to discover and manage your music.
platforms           darwin
homepage            http://amarok.kde.org
master_sites        http://gitorious.org/amarok
# The following are placeholders for official beta releases
#master_sites	    http://ftp.kde.org/unstable/${name}/${version}/src/
#use_bzip2           yes
#checksums           md5 410863050e5de95df82106cc9dfe486a
distname            amarok
fetch.type          git
git.url             git://gitorious.org/amarok/amarok.git
git.branch          33f852d6e293aa4632a4381d3468c7cf89224380
worksrcdir          amarok

depends_build-append port:git-core

depends_lib-append  port:kdebase4-runtime port:kdelibs4 \
                    port:qtscriptgenerator port:liblastfm \
                    port:taglib port:taglib-extras \
                    port:loudmouth \
                    path:bin/mysql_config5:mysql5

pre-configure {
    if {![file exists ${prefix}/lib/mysql5/mysql/libmysqld.a]} {
        ui_error "${name} cannot be installed because MySQL was not installed with the libmysqld embedded server."
        return -code error "incompatible MySQL installation"
    }
}

configure.env           QTDIR=${prefix}/libexec/qt4-mac
configure.args-append	../${distname}

default_variants-append    +debug

post-destroot {
    # Place bundle icons in correct location
	system "mv ${destroot}${prefix}/bin/amarok.app/Contents/Resources/* ${destroot}${applications_dir}/KDE4/Amarok.app/Contents/Resources/"
	system "rm -rf ${destroot}${prefix}/bin"
}

