# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils multilib

IUSE=""

DESCRIPTION="Convolution plugin for Linux/DSSI."
HOMEPAGE="http://tapas.affenbande.org/?page_id=36"
MY_P="${P/-/_}"
SRC_URI="http://affenbande.org/~tapas/jack_convolve/${MY_P}.tgz"
S=${WORKDIR}/${MY_P}

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

RDEPEND=">=media-libs/libconvolve-0.0.7
	=x11-libs/gtk+-2*
	media-libs/dssi
	=gnome-base/libglade-2*
	media-libs/liblo"

DEPEND="${RDEPEND}
	dev-util/pkgconfig"

MY_PN="${PN/-/_}"
DSSI="/usr/$(get_libdir)/dssi"
DSSI_DIR="${DSSI}/${MY_PN}"

src_compile() {
	sed -i -e 's/\/local//' Makefile
	emake || die
}

src_install() {
	insinto /usr/share/${MY_PN}
	doins *.xpm *.glade
	exeinto ${DSSI}
	doexe *.so
	exeinto ${DSSI_DIR}
	dosym dssi_convolve_gtk ${DSSI_DIR}/dssi_convolve1ch_gtk
	dosym dssi_convolve_gtk ${DSSI_DIR}/dssi_convolve2ch_gtk
	dosym dssi_convolve_gtk ${DSSI_DIR}/dssi_convolve4ch_gtk
	dosym dssi_convolve_gtk ${DSSI_DIR}/dssi_convolve6ch_gtk
	doexe dssi_convolve*_gtk
	dosym ${DSSI_DIR} ${DSSI}/dssi_convolve1ch
	dosym ${DSSI_DIR} ${DSSI}/dssi_convolve2ch
	dosym ${DSSI_DIR} ${DSSI}/dssi_convolve4ch
	dosym ${DSSI_DIR} ${DSSI}/dssi_convolve6ch
	dodoc README TODO
}