# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-java/jython/jython-2.1-r6.ebuild,v 1.3 2005/07/09 16:06:00 axxo Exp $ inherit base java-pkg-2 DESCRIPTION="An implementation of Python written in Java" RESTRICT="nomirror" HOMEPAGE="http://www.jython.org" MY_PV="installer-2.2b1" # uses CPython library from version... PYVER="2.2.3" SRC_URI="http://www.python.org/ftp/python/${PYVER%_*}/Python-${PYVER}.tgz mirror://sourceforge/${PN}/${PN}_${MY_PV}.jar" #SRC_URI="mirror://gentoo/${P}.tar.bz2" S=${WORKDIR} LICENSE="JPython" SLOT="0" KEYWORDS="amd64 ~ia64 ~ppc ~ppc64 ~x86 ~x86-fbsd" IUSE="readline jikes source doc servlet" RDEPEND=">=virtual/jre-1.2 readline? ( >=dev-java/libreadline-java-0.8.0 )" DEPEND=">=virtual/jdk-1.2 dev-java/ant source? ( app-arch/zip ) jikes? ( >=dev-java/jikes-1.18 ) servlet? ( =dev-java/servletapi-2.4* ) ${RDEPEND}" src_compile() { # don't know how to dynamically find a python library local pylib="Python-${PYVER}/Lib" local antflags="--noconfig -Dbase.path=src/java -Dsource.dir=src/java/src -Dpython.lib=${pylib}" use jikes && antflags="${antflags} -Dbuild.compiler=jikes" use readline && antflags="${antflags} -Dreadline.present=yes -Dreadline.jar=$(java-config --classpath libreadline-java)" # not needed 2.4, but java-config will not answer without a slot use servlet && antflags="${antflags} -Dservlet.present=yes -Dservlet.jar=$(java-pkg_getjars servletapi-2.4)" # another one cp -r build.Lib.include.properties Lib src/java # LC_ALL=C prevents java failing in utf-8 filesystems LC_ALL=C ant ${antflags} || die "compile failed" } src_install() { java-pkg_dojar dist/${PN}.jar dodoc README.txt NEWS ACKNOWLEDGMENTS use doc && java-pkg_dohtml -A .css .jpg .gif -r Doc/* java-pkg_dolauncher jythonc \ --main "org.python.util.jython" \ --java_args "-Dpython.home=/usr/share/jython" \ --pkg_args "/usr/share/jython/tools/jythonc/jythonc.py" local launch_args="-Dpython.home=/usr/share/jython -classpath " use readline && launch_args="${launch_args}`java-config --classpath=libreadline-java`:" launch_args="${launch_args}`java-config --classpath=jython`" use readline && launch_args="${launch_args} -Djava.library.path=`java-config --library libreadline-java`" echo java-pkg_dolauncher jython --main org.python.util.jython --java_args "${launch_args}" java-pkg_dolauncher jython --main org.python.util.jython --java_args "${launch_args}" dodir /usr/share/jython/cachedir chmod -R a+rw ${D}/usr/share/jython/cachedir insinto /usr/share/${PN} doins -r dist/Lib Demo registry insinto /usr/share/${PN}/tools doins -r Tools/* use source && java-pkg_dosrc src/java/src/* } pkg_postinst() { if use readline; then einfo "To use readline you need to add the following to your registery" einfo einfo "python.console=org.python.util.ReadlineConsole" einfo "python.console.readlinelib=GnuReadline" einfo einfo "and make sure that java.library.path includes /usr/lib" einfo "/usr/bin/jython will do it." einfo einfo "The global registry can be found in /usr/share/${PN}/registry" einfo "User registry in \$HOME/.jython" einfo "See http://www.jython.org/docs/registry.html for more information" fi }