summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Trygve Kalleberg <karltk@gentoo.org>2002-06-25 01:35:16 +0000
committerKarl Trygve Kalleberg <karltk@gentoo.org>2002-06-25 01:35:16 +0000
commit9f86634b3f0af00a0ea58e02171cd32da63ec569 (patch)
tree96834b6090040e1c00dde67d7a2fe7e973d3d94a /eclass/java.eclass
parentNew upstream version (diff)
downloadhistorical-9f86634b3f0af00a0ea58e02171cd32da63ec569.tar.gz
historical-9f86634b3f0af00a0ea58e02171cd32da63ec569.tar.bz2
historical-9f86634b3f0af00a0ea58e02171cd32da63ec569.zip
Partial fix for #3029.
Diffstat (limited to 'eclass/java.eclass')
-rw-r--r--eclass/java.eclass84
1 files changed, 84 insertions, 0 deletions
diff --git a/eclass/java.eclass b/eclass/java.eclass
new file mode 100644
index 000000000000..0a34dc1cb244
--- /dev/null
+++ b/eclass/java.eclass
@@ -0,0 +1,84 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Author: Karl Trygve Kalleberg <karltk@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/eclass/java.eclass,v 1.1 2002/06/25 01:35:16 karltk Exp $
+
+ECLASS=java
+DESCRIPTION="Based on the $ECLASS eclass"
+
+VMHANDLE=${PN}-${PV}
+
+function sed2() {
+ unset filename
+ unset arglist
+ local filename=""
+ local arglist
+ declare -a arglist
+ while test $# -gt 0 ; do
+ case $1 in
+ -e)
+ shift
+ arglist[${#arglist[@]}]="-e"
+ arglist[${#arglist[@]}]="$1"
+ ;;
+ *)
+ if [ -e "$1" ] ; then
+ filename=$1
+ fi
+ ;;
+ esac
+ shift
+ done
+
+ if [ ! -z $filename ] ; then
+ mv "${filename}" "${filename}.orig"
+ sed "${arglist[@]}" < ${filename}.orig > ${filename}
+ return 0
+ else
+ return 1
+ fi
+}
+
+java_pkg_postinst() {
+ if [ -z `java-config --java 2> /dev/null` ] ; then
+ einfo "No default VM found, setting ${VMHANDLE} as default"
+ java-config --set-system-vm=${VMHANDLE}
+ fi
+}
+
+pkg_postinst() {
+ java_pkg_postinst
+}
+
+system_arch() {
+ local sarch
+ sarch=`echo $ARCH | sed -e s/[i]*.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/`
+ if [ -z "$sarch" ] ; then
+ sarch=`uname -m | sed -e s/[i]*.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/`
+ fi
+ echo $sarch
+}
+
+set_java_env() {
+ dodir /etc/env.d/java
+ sed \
+ -e "s/@P@/${P}/g" \
+ -e "s/@PN@/${PN}/g" \
+ -e "s/@PV@/${PV}/g" \
+ -e "s/@PF@/${PF}/g" \
+ < $1 \
+ > ${D}/etc/env.d/java/20`basename $1` || die
+}
+
+install_mozilla_plugin() {
+ local bn
+ bn=`basename $1`
+
+ if [ "`use mozilla`" ] ; then
+ dodir /usr/lib/mozilla/plugins
+ dosym $1 /usr/lib/mozilla/plugins/${bn}
+ fi
+
+
+}
+