/[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.11 Revision 1.15
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.11 2006/09/10 20:59:11 betelgeuse Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/java-vm-2.eclass,v 1.15 2006/10/20 03:52:24 nichoj Exp $
4 4
5# ----------------------------------------------------------------------------- 5# -----------------------------------------------------------------------------
6# @eclass-begin 6# @eclass-begin
7# @eclass-shortdesc Java Virtual Machine eclass 7# @eclass-shortdesc Java Virtual Machine eclass
8# @eclass-maintainer java@gentoo.org 8# @eclass-maintainer java@gentoo.org
16 16
17DEPEND=" 17DEPEND="
18 =dev-java/java-config-2.0* 18 =dev-java/java-config-2.0*
19 >=sys-apps/portage-2.1" 19 >=sys-apps/portage-2.1"
20RDEPEND=" 20RDEPEND="
21 =dev-java/java-config-2.0*" 21 =dev-java/java-config-2.0*
22
23# If the VM supports generation-1, we need to depend on java-config-1
24if [[ ${JAVA_SUPPORTS_GENERATION_1} == 'true' ]]; then
25 DEPEND="${DEPEND} =dev-java/java-config-1.3*" 22 =dev-java/java-config-1.3*"
26 RDEPEND="${RDEPEND} =dev-java/java-config-1.3*"
27fi
28 23
29export WANT_JAVA_CONFIG=2 24export WANT_JAVA_CONFIG=2
30 25
31if [[ "${SLOT}" != "0" ]]; then 26if [[ "${SLOT}" != "0" ]]; then
32 VMHANDLE=${PN}-${SLOT} 27 VMHANDLE=${PN}-${SLOT}
60 fi 55 fi
61 ewarn "Setting generation-1 system-vm to ${VMHANDLE}" 56 ewarn "Setting generation-1 system-vm to ${VMHANDLE}"
62 java-config-1 --set-system-vm=${P} 2>/dev/null 57 java-config-1 --set-system-vm=${P} 2>/dev/null
63 # dirty check to see if we are upgrading current generation-1 system vm 58 # dirty check to see if we are upgrading current generation-1 system vm
64 elif [[ "${systemvm1}" = ${VMHANDLE}* ]]; then 59 elif [[ "${systemvm1}" = ${VMHANDLE}* ]]; then
65 einfo "Emerging the current generation-1 system-vm..." 60 einfo "Emerging the current generation-1 system-vm..."
66 einfo "Updating its config files." 61 einfo "Updating its config files."
67 java-config-1 --set-system-vm=${P} 2>/dev/null 62 java-config-1 --set-system-vm=${P} 2>/dev/null
68 # dirty check to see if current system vm is a jre - replace it with 63 # dirty check to see if current system vm is a jre - replace it with
69 elif [[ "${systemvm1}" = *jre* ]]; then 64 elif [[ "${systemvm1}" = *jre* ]]; then
70 ewarn "Current generation-1 system-vm is a JRE" 65 ewarn "Current generation-1 system-vm is a JRE"
71 ewarn "For the new and old Java systems to coexist," 66 ewarn "For the new and old Java systems to coexist,"
72 ewarn "the generation-1 system-vm must be a JDK." 67 ewarn "the generation-1 system-vm must be a JDK."
73 ewarn "Setting generation-1 system-vm to ${VMHANDLE}" 68 ewarn "Setting generation-1 system-vm to ${VMHANDLE}"
74 java-config-1 --set-system-vm=${P} 2>/dev/null 69 java-config-1 --set-system-vm=${P} 2>/dev/null
75 fi 70 fi
76 # else... some other VM is being updated, so we don't have to worry 71 # else... some other VM is being updated, so we don't have to worry
77 else 72 else
78 einfo "JREs and 1.5+ JDKs are not supported for use with generation-1." 73 einfo "JREs and 1.5+ JDKs are not supported for use with generation-1."
79 einfo "This is because generation-1 is only for use for building packages." 74 einfo "This is because generation-1 is only for use for building packages."
80 einfo "Only generation-2 should be used by end-users," 75 einfo "Only generation-2 should be used by end-users,"
81 einfo "where all JREs and JDKs will be available" 76 einfo "where all JREs and JDKs will be available"
82 fi 77 fi
83 78
79 echo
80
81 java-vm_check-nsplugin
82 java_mozilla_clean_
83}
84
85java-vm_check-nsplugin() {
86 local libdir
87 if [[ ${VMHANDLE} =~ emul-linux-x86 ]]; then
88 libdir=lib32
89 else
90 libdir=lib
91 fi
84 # Install a default nsplugin if we don't already have one 92 # Install a default nsplugin if we don't already have one
85 if has nsplugin ${IUSE} && use nsplugin; then 93 if has nsplugin ${IUSE} && use nsplugin; then
86 if [[ ! -f /usr/lib/nsbrowser/plugins/javaplugin.so ]]; then 94 if [[ ! -f /usr/${libdir}/nsbrowser/plugins/javaplugin.so ]]; then
87 eselect java-nsplugin set ${VMHANDLE} 95 einfo "No system nsplugin currently set."
96 java-vm_set-nsplugin
97 else
98 einfo "System nsplugin is already set, not changing it."
88 fi 99 fi
100 einfo "You can change nsplugin with eselect java-nsplugin."
101 fi
102}
103
104java-vm_set-nsplugin() {
105 local extra_args
106 if use amd64; then
107 if [[ ${VMHANDLE} =~ emul-linux-x86 ]]; then
108 extra_args="32bit"
109 else
110 extra_args="64bit"
89 fi 111 fi
90 112 einfo "Setting ${extra_args} nsplugin to ${VMHANDLE}"
91 java_mozilla_clean_ 113 else
114 einfo "Setting nsplugin to ${VMHANDLE}..."
115 fi
116 eselect java-nsplugin set ${extra_args} ${VMHANDLE}
92} 117}
93 118
94java-vm-2_pkg_prerm() { 119java-vm-2_pkg_prerm() {
95 if [[ "$(java-config -f 2>/dev/null)" == "${VMHANDLE}" ]]; then 120 if [[ "$(java-config -f 2>/dev/null)" == "${VMHANDLE}" ]]; then
96 ewarn "It appears you are removing your system-vm!" 121 ewarn "It appears you are removing your system-vm!"
135 -e "/^LDPATH=.*lib\\/\\\"/s|\"\\(.*\\)\"|\"\\1${platform}/:\\1${platform}/server/\"|" \ 160 -e "/^LDPATH=.*lib\\/\\\"/s|\"\\(.*\\)\"|\"\\1${platform}/:\\1${platform}/server/\"|" \
136 < ${source_env_file} \ 161 < ${source_env_file} \
137 > ${env_file} || die "sed failed" 162 > ${env_file} || die "sed failed"
138 163
139 echo "VMHANDLE=\"${VMHANDLE}\"" >> ${env_file} 164 echo "VMHANDLE=\"${VMHANDLE}\"" >> ${env_file}
140 165
141 # generation-1 compatibility 166 # generation-1 compatibility
142 # respect both variables for now... 167 # respect both variables for now...
143 if [[ ${JAVA_SUPPORTS_GENERATION_1} == 'true' && ${JAVA_VM_NO_GENERATION1} != 'true' ]]; then 168 if [[ ${JAVA_SUPPORTS_GENERATION_1} == 'true' && ${JAVA_VM_NO_GENERATION1} != 'true' ]]; then
144 einfo "Enabling generation-1 compatibility..." 169 einfo "Enabling generation-1 compatibility..."
145 dodir /etc/env.d/java # generation-1 compatibility 170 dodir /etc/env.d/java # generation-1 compatibility

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.20