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

EAPI=2

DESCRIPTION="LaTeX to Grace format convertor."
HOMEPAGE="http://faraday.fc.up.pt/cfp/Members/vpereira/linux-projects/grace-latex-strings/"
SRC_URI="http://faraday.fc.up.pt/cfp/Members/vpereira/linux-projects/grace-latex-strings/${PN}-${PV/\./-}-tar.gz"

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

DEPEND="sci-visualization/grace
	dev-tex/dvi2gr
	dev-python/PyQt"
RDEPEND="${DEPEND}"

src_unpack() {
	tar -C "${WORKDIR}" -xzf ${DISTDIR}/${A} || die "failed to unpack $i"
}

src_install() {
	cd ${S}
	mv ${PN}.py ${PN} || die 'Can not renave file!'
	dobin ${PN} || die
	dodoc README
}

pkg_postinst() {
	einfo "1) Make sure that you have correctly configured the dvi2gr."
	einfo "2) Create a fifo file:"
	einfo "   $ mkfifo ~/.grace_pipe"
	einfo "3) Then you cat start mxgrace with the following command:"
	einfo "   $ xmgrace -npipe ~/.grace_pipe"
}