/[gentoo-x86]/eclass/java-vm-2.eclass
Gentoo

Diff of /eclass/java-vm-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.8
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/java-vm-2.eclass,v 1.2 2006/06/25 16:28:09 nichoj Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/java-vm-2.eclass,v 1.8 2006/08/31 01:03:11 nichoj Exp $
4# 4#
5# Author: Karl Trygve Kalleberg <karltk@gentoo.org> 5# Author: Karl Trygve Kalleberg <karltk@gentoo.org>
6 6
7inherit eutils 7inherit eutils
8 8
9DEPEND=" 9DEPEND="
10 =dev-java/java-config-2.0* 10 =dev-java/java-config-2.0*
11 =dev-java/java-config-1.3*" 11 =dev-java/java-config-1.3*
12 >=sys-apps/portage-2.1"
12RDEPEND=" 13RDEPEND="
13 =dev-java/java-config-2.0* 14 =dev-java/java-config-2.0*
14 =dev-java/java-config-1.3*" 15 =dev-java/java-config-1.3*"
15 16
16export WANT_JAVA_CONFIG=2 17export WANT_JAVA_CONFIG=2
31 if [[ -z "$(java-config-2 -f)" ]]; then 32 if [[ -z "$(java-config-2 -f)" ]]; then
32 java_set_default_vm_ 33 java_set_default_vm_
33 fi 34 fi
34 35
35 if [[ ${JAVA_VM_NO_GENERATION1} != "true" ]]; then 36 if [[ ${JAVA_VM_NO_GENERATION1} != "true" ]]; then
36 local systemvm1="$(java-config-1 -f)" 37 local systemvm1="$(java-config-1 -f 2>/dev/null)"
37 # no generation-1 system-vm was yet set 38 # no generation-1 system-vm was yet set
38 if [[ -z "${systemvm1}" ]]; then 39 if [[ -z "${systemvm1}" ]]; then
39 einfo "No valid generation-1 system-vm set, setting to ${P}" 40 # if 20java exists, must be using old VM
41 if [[ -f /etc/env.d/20java ]]; then
42 ewarn "The current generation-1 system-vm is using an out-of-date VM,"
43 ewarn "as in, it hasn't been updated for use with the new Java sytem."
44 # othewise, it must not have been set before
45 else
46 ewarn "No generation-1 system-vm previously set."
47 fi
48 ewarn "Setting generation-1 system-vm to ${VMHANDLE}"
40 java-config-1 --set-system-vm=${P} 49 java-config-1 --set-system-vm=${P} 2>/dev/null
41 # dirty check to see if we are upgrading current generation-1 system vm 50 # dirty check to see if we are upgrading current generation-1 system vm
42 elif [[ ${systemvm1} =~ "^${VMHANDLE}" ]]; then 51 elif [[ "${systemvm1}" = ${VMHANDLE}* ]]; then
43 einfo "Upgrading generation-1 system-vm... updating its env file" 52 einfo "Emerging the current generation-1 system-vm..."
53 einfo "Updating its config files."
44 java-config-1 --set-system-vm=${P} 54 java-config-1 --set-system-vm=${P} 2>/dev/null
55 # dirty check to see if current system vm is a jre - replace it with
56 elif [[ "${systemvm1}" = *jre* ]]; then
57 ewarn "Current generation-1 system-vm is a JRE"
58 ewarn "For the new and old Java systems to coexist,"
59 ewarn "the generation-1 system-vm must be a JDK."
60 ewarn "Setting generation-1 system-vm to ${VMHANDLE}"
61 java-config-1 --set-system-vm=${P} 2>/dev/null
45 fi 62 fi
46 # else... some other VM is being updated, so we don't have to worry 63 # else... some other VM is being updated, so we don't have to worry
64 fi
65
66 if has nsplugin ${IUSE} && use nsplugin; then
67 if [[ ! -f /usr/lib/nsbrowser/plugins/javaplugin.so ]]; then
68 eselect java-nsplugin set ${VMHANDLE}
69 fi
47 fi 70 fi
48 71
49 java_mozilla_clean_ 72 java_mozilla_clean_
50} 73}
51 74
127 150
128 if [ ! -f "${D}/${plugin}" ] ; then 151 if [ ! -f "${D}/${plugin}" ] ; then
129 die "Cannot find mozilla plugin at ${D}/${plugin}" 152 die "Cannot find mozilla plugin at ${D}/${plugin}"
130 fi 153 fi
131 154
132 local plugin_dir=$(java_get_plugin_dir_) 155 local plugin_dir=/usr/share/java-config-2/nsplugin
133 dodir ${plugin_dir} 156 dodir ${plugin_dir}
134 dosym ${plugin} ${plugin_dir}/javaplugin.so 157 dosym ${plugin} ${plugin_dir}/${VMHANDLE}-javaplugin.so
135} 158}
136 159
137java_mozilla_clean_() { 160java_mozilla_clean_() {
138 # Because previously some ebuilds installed symlinks outside of pkg_install 161 # Because previously some ebuilds installed symlinks outside of pkg_install
139 # and are left behind, which forces you to manualy remove them to select the 162 # and are left behind, which forces you to manualy remove them to select the

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20