# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils subversion # This is the svn version of the Sunflow ebuild. IUSE="blender doc examples gnome" # blender: Install blender exporter. # doc: Copy additional javadoc to /usr/sunflow/javadoc (plus README and LICENSE to the doc directory) # examples: Install examples. Because they aren't always released with a sunflow version, they can be found at media-gfx/sunflow-examples. # Not setting this flag means we need to patch the ant buildfile. # gnome: calls GNOME reinitialization after installation/uninstallation ESVN_REPO_URI="http://sunflow.svn.sourceforge.net/svnroot/sunflow/trunk" DESCRIPTION="a rendering system written in Java" HOMEPAGE="http://sunflow.sf.net/" SRC_URI="" SLOT="0" LICENSE="MIT" KEYWORDS="~amd64 ~ppc ~x86" RDEPEND=">=virtual/jre-1.5" DEPEND="${RDEPEND} >=virtual/jdk-1.5 dev-java/ant-core blender? ( media-gfx/blender ) examples? ( media-gfx/sunflow-examples )" S=${WORKDIR}/${PN} src_unpack() { subversion_src_unpack } src_compile() { ant || sunflow_tryPatch # Create sunflow start script which cds into /usr/share/sunflow echo -e '#!/bin/sh\nmem=1G\n\ncd /usr/share/sunflow\nexec java -Xmx$mem -server -jar sunflow.jar $*\n' > ${S}/sunflow || die } sunflow_tryPatch() { ewarn "The current svn version (311) breaks because of a wrong buildfile." ewarn "Trying to patch ..." epatch ${FILESDIR}/sunflow-svn-rev311-builderror.patch || die ant || die } src_install() { dodir /usr/share/${PN} insinto /usr/share/${PN} doins ${S}/release/sunflow.jar || die doins ${S}/release/janino.jar || die exeinto /usr/bin/ doexe ${S}/sunflow || die if use blender; then insinto /usr/share/blender/scripts doins ${S}/exporters/blender/sunflow_export.py || die fi insinto /usr/share/pixmaps doins ${FILESDIR}/${PN}.svg doins ${FILESDIR}/${PN}.png insinto /usr/share/applications doins ${FILESDIR}/${PN}.desktop if use doc; then dodoc ${S}/LICENSE ${S}/README cp -r "${S}/release/javadoc" "${D}/usr/share/${PN}/javadoc" || die fi } pkg_postinst() { use gnome && gnome2_pkg_postinst if use doc; then if [ -f "/usr/share/${PN}/javadoc/index.html" ]; then einfo "javadoc was installed to /usr/share/${PN}/javadoc" else ewarn "The javadoc main file /usr/share/${PN}/javadoc/index.html could not be found." ewarn "Please check the ant output." fi fi } pkg_postrm() { use gnome && gnome2_pkg_postrm }