# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $

IUSE=""

# Fix capitalization used in releases
MY_PN="${PN/m/M}"
MY_P="${MY_PN}-${PV}"

DESCRIPTION="A wxWidgets based iTunes clone"
HOMEPAGE="http://musik.berlios.de/"
SRC_URI="http://download.berlios.de/musik/${MY_P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"

DEPEND=">=dev-util/cmake-1.6.7
	>=media-libs/id3lib-3.8.3-r1
	>=media-libs/libogg-1.0
	>=media-libs/libvorbis-1.0-r2
	>=media-libs/fmod-3.70
	>=x11-libs/wxGTK-2.4.1
	>=dev-db/sqlite-2.8.3"

S=${WORKDIR}/${MY_P}

src_unpack() {
	unpack ${A}
	
	# Patch that sets WM_NAME to wxMusik
	epatch ${FILESDIR}/${MY_P}-WM_NAME.patch || die "WM_NAME patch failed"
	
	# Patch to fix CMakeLists.txt to use CXXFLAGS from make.conf
	epatch ${FILESDIR}/${MY_P}-CMakeLists.patch || die "CMakeLists.txt patch failed"
}

src_compile() {
	cd ${S}
	cmake . || die "cmake failed"
	emake || die "emake failed"
}

src_install () {
	dodir /usr/bin
	cp ${MY_PN} ${D}/usr/bin/${PN}
	dodoc changelog.txt license.txt todo.txt
}