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

DESCRIPTION="Mathmap plugin for the GIMP"
HOMEPAGE="http://www.complang.tuwien.ac.at/schani/mathmap"
SRC_URI="http://www.complang.tuwien.ac.at/schani/mathmap/files/mathmap-${PV}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

DEPEND=">=media-gfx/gimp-2.2
		sci-libs/gsl
		media-libs/jpeg
		media-libs/libpng
		media-libs/giflib"
RDEPEND=""

src_compile() {
	emake || die "Compilation failed"
}

src_install() {
	GIMPDATADIR=`gimptool-2.0 --gimpdatadir`
	GIMPPLUGINDIR=`gimptool-2.0 --gimpplugindir`
	insinto ${GIMPDATADIR}/mathmap
	doins new_template.c opmacros.h 
	doins generators/blender/blender_template.c generators/blender/blender_opmacros.h

	insinto ${GIMPDATADIR}/mathmap/expressions
	doins -r examples

	insinto ${GIMPDATADIR}/mathmap
	doins pixmaps/*.png

	exeinto ${GIMPPLUGINDIR}/plug-ins
	doexe mathmap 

	dodoc README README.blender COPYING BUGS
}