/[gentoo-x86]/eclass/java-pkg.eclass
Gentoo

Diff of /eclass/java-pkg.eclass

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

Revision 1.35 Revision 1.36
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/Attic/java-pkg.eclass,v 1.35 2006/05/22 01:26:51 nichoj Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/java-pkg.eclass,v 1.36 2006/06/24 18:36:59 nichoj Exp $
4 4
5inherit multilib
5 6
6# Skeleton pkg_setup, needed to provide compatibility for migration-overlay. 7JAVA_CONFIG_DEP="|| ( =dev-java/java-config-1.3* =dev-java/java-config-1.2* )"
8DEPEND="${JAVA_CONFIG_DEP}"
9RDEPEND="${JAVA_CONFIG_DEP}"
10
11
12EXPORT_FUNCTIONS pkg_setup
13
14# We need to do a few things to add compatibility between
15# generation-1 and generation-2.
16
17# First we make sure java-config-1 will be used
18export WANT_JAVA_CONFIG="1"
19
20# VMHANDLE is defined in /etc/env.d/20java. This is the handle java-config-2
21# uses for determining which VM to use.
22#
23# We set GENTOO_VM to this, to ensure that /usr/bin/java and company are using
24# the right VM.
25export GENTOO_VM="${VMHANDLE}"
26
27# During pkg_setup, we need to live some crumb trails that we're using
28# in a mixed generation-1/generation-2 environment
29# TODO need to make sure everything that inherits java-pkg and has a pkg_setup
30# uses java-pkg_pkg_setup
7java-pkg_pkg_setup() { 31java-pkg_pkg_setup() {
8 :; 32 java-pkg_announce-qa-violation "using deprecated eclass java-pkg"
33
34 # We need to do a little magic if java-config-2 is around
35 if has_version "=dev-java/java-config-2*"; then
36 ebegin "Enabling generation-2 compatibility"
37 if [[ -n ${GENTOO_VM} ]]; then
38 einfo "Using ${GENTOO_VM}"
39 eend 0
40 else
41 eerror "There was a problem determining which VM to use for Generation-1"
42 eerror "See the list of available VMs by using: java-config-1 -L"
43 eerror "Then select on of those by using: java-config-1 -S <selected vm>"
44 eerror "And once that is done, run: env-update && source /etc/profile"
45 eerror "Then to continue the emerge: emerge --resume"
46 eend 1
47 die "Couldn't determine VM for generation-1"
48 fi
49 fi
9} 50}
51
10 52
11pkglistpath="${T}/java-pkg-list" 53pkglistpath="${T}/java-pkg-list"
12 54
13java-pkg_doclass() 55java-pkg_doclass()
14{ 56{
20{ 62{
21 debug-print-function ${FUNCNAME} $* 63 debug-print-function ${FUNCNAME} $*
22 64
23 if [ -z "${JARDESTTREE}" ] ; then 65 if [ -z "${JARDESTTREE}" ] ; then
24 JARDESTTREE="lib" 66 JARDESTTREE="lib"
25 SODESTTREE="lib" 67 SODESTTREE=$(get_libdir)
26 fi 68 fi
27 69
28 # Set install paths 70 # Set install paths
29 sharepath="${DESTTREE}/share" 71 sharepath="${DESTTREE}/share"
30 if [ "$SLOT" == "0" ] ; then 72 if [ "$SLOT" == "0" ] ; then
50 debug-print "sharepath=${sharepath}" 92 debug-print "sharepath=${sharepath}"
51 debug-print "shareroot=${shareroot}" 93 debug-print "shareroot=${shareroot}"
52 debug-print "jardest=${jardest}" 94 debug-print "jardest=${jardest}"
53 debug-print "sodest=${sodest}" 95 debug-print "sodest=${sodest}"
54 debug-print "package_env=${package_env}" 96 debug-print "package_env=${package_env}"
97
55} 98}
56 99
57java-pkg_do_write_() 100java-pkg_do_write_()
58{ 101{
59 # Create directory for package.env 102 # Create directory for package.env
60 if [ ! -d "${D}${shareroot}" ] ; then 103 dodir "${shareroot}"
61 install -d "${D}${shareroot}"
62 fi
63 104
64 # Create package.env 105 # Create package.env
65 echo "DESCRIPTION=${DESCRIPTION}" > "${package_env}" 106 echo "DESCRIPTION=${DESCRIPTION}" > "${package_env}"
107 echo "GENERATION=1" >> "${package_env}"
66 if [ -n "${cp_pkg}" ]; then 108 if [ -n "${cp_pkg}" ]; then
67 echo "CLASSPATH=${cp_prepend}:${cp_pkg}:${cp_append}" >> "${package_env}" 109 echo "CLASSPATH=${cp_prepend}:${cp_pkg}:${cp_append}" >> "${package_env}"
68 fi 110 fi
69 if [ -n "${lp_pkg}" ]; then 111 if [ -n "${lp_pkg}" ]; then
70 echo "LIBRARY_PATH=${lp_prepend}:${lp_pkg}:${lp_append}" >> "${package_env}" 112 echo "LIBRARY_PATH=${lp_prepend}:${lp_pkg}:${lp_append}" >> "${package_env}"
173 if [ -z "$*" ] ; then 215 if [ -z "$*" ] ; then
174 die "at least one argument needed" 216 die "at least one argument needed"
175 fi 217 fi
176 218
177 # Make sure directory is created 219 # Make sure directory is created
178 if [ ! -d "${D}${jardest}" ] ; then 220 dodir ${jardest}
179 install -d "${D}${jardest}"
180 fi
181 221
182 for i in $* ; do 222 for i in $* ; do
183 mysrc=$(java-pkg_do_getsrc_) 223 mysrc=$(java-pkg_do_getsrc_)
184 224
185 # Install files 225 # Install files
372 dodir ${target} 412 dodir ${target}
373 install ${INSOPTIONS} "${T}/${PN}-src.zip" "${D}${target}" \ 413 install ${INSOPTIONS} "${T}/${PN}-src.zip" "${D}${target}" \
374 || die "failed to install sources" 414 || die "failed to install sources"
375} 415}
376 416
377EXPORT_FUNCTIONS pkg_setup 417
418java-pkg_announce-qa-violation() {
419 if hasq java-strict ${FEATURES}; then
420 echo "Java QA Notice: $@" >&2
421 fi
422}

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.20