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

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

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

Revision 1.127 Revision 1.128
4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> 4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
5# Copyright (c) 2004-2005, Gentoo Foundation 5# Copyright (c) 2004-2005, Gentoo Foundation
6# 6#
7# Licensed under the GNU General Public License, v2 7# Licensed under the GNU General Public License, v2
8# 8#
9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.127 2009/05/19 21:23:32 caster Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.128 2009/06/02 07:02:01 ali_bush Exp $
10 10
11# ----------------------------------------------------------------------------- 11# -----------------------------------------------------------------------------
12# @eclass-begin 12# @eclass-begin
13# @eclass-shortdesc Java Utility eclass 13# @eclass-shortdesc Java Utility eclass
14# @eclass-maintainer java@gentoo.org 14# @eclass-maintainer java@gentoo.org
1308# 1308#
1309# Various other functions to use from an ebuild 1309# Various other functions to use from an ebuild
1310# ------------------------------------------------------------------------------ 1310# ------------------------------------------------------------------------------
1311 1311
1312# ------------------------------------------------------------------------------ 1312# ------------------------------------------------------------------------------
1313# @ebuild-function java-pkg_need
1314#
1315# Adds virtual dependencies, which can optionally be controlled by a USE flag.
1316# Currently supported virtuals are:
1317# javamail
1318# jdbc-stdext
1319# jaf
1320# jdbc-rowset
1321# jms
1322#
1323# @param $1 - Optionally indicate that the dependencies are controlled by
1324# a use flag by specifying '--use' Requires $2.
1325# @param $2 - USE flag which will enable the dependencies.
1326# @param $@ - virtual packages to add depenedencies for
1327# ------------------------------------------------------------------------------
1328# TODO rewrite to parse a line based declaration file instead -- karltk
1329#java-pkg_need() {
1330# debug-print-function ${FUNCNAME} $*
1331# local useflag
1332# if [[ ${1} == "--use" ]]; then
1333# useflag="${2}"
1334# shift 2
1335# fi
1336#
1337# if [[ -z ${1} ]]; then
1338# die "Must specify at least one virtual package."
1339# fi
1340#
1341# local depstr newdepstr
1342#
1343# for virtual in ${@}; do
1344# if has ${virtual} ${JAVA_PKG_VNEED}; then
1345# debug-print "Already registered virtual ${virtual}"
1346# continue
1347# fi
1348# case ${virtual} in
1349# javamail)
1350# debug-print "java-pkg_need: adding javamail dependencies"
1351# newdepstr="|| ( dev-java/gnu-javamail dev-java/sun-javamail-bin )"
1352# ;;
1353# jdbc-stdext)
1354# debug-print "java-pkg_need: adding jdbc-stdext dependencies"
1355# newdepstr="|| ( >=virtual/jdk-1.4 dev-java/jdbc2-stdext )"
1356# ;;
1357# jaf)
1358# debug-print "java-pkg_need: adding jaf dependencies"
1359# newdepstr="|| ( dev-java/gnu-jaf dev-java/sun-jaf-bin )"
1360# ;;
1361# jdbc-rowset)
1362# debug-print "java-pkg_need: adding jdbc-rowset dependencies"
1363# newdepstr="|| ( >=virtual/jdk-1.5 dev-java/sun-jdbc-rowset )"
1364# ;;
1365# jms)
1366# debug-print "java-pkg_need: adding jms dependencies"
1367# newdepstr="|| ( dev-java/sun-jms dev-java/openjms )"
1368# ;;
1369# *)
1370# die "Invalid virtual: ${virtual}"
1371# esac
1372#
1373# export JAVA_PKG_VNEED="${JAVA_PKG_VNEED} ${virtual}"
1374#
1375# if [[ -n ${useflag} ]]; then
1376# depstr="${depstr} ${useflag}? ( ${newdepstr} )"
1377# else
1378# depstr="${depstr} ${newdepstr}"
1379# fi
1380# done
1381#
1382# [[ -z ${JAVA_PKG_NV_DEPEND} ]] && export JAVA_PKG_NV_DEPEND="${DEPEND}"
1383# [[ -z ${JAVA_PKG_NV_RDEPEND} ]] && export JAVA_PKG_NV_RDEPEND="${RDEPEND}"
1384#
1385# export DEPEND="${DEPEND} ${depstr}"
1386# export RDEPEND="${RDEPEND} ${depstr}"
1387#}
1388
1389# ------------------------------------------------------------------------------
1390# @ebuild-function java-pkg_find-normal-jars 1313# @ebuild-function java-pkg_find-normal-jars
1391# 1314#
1392# Find the files with suffix .jar file in the given directory or $WORKDIR 1315# Find the files with suffix .jar file in the given directory or $WORKDIR
1393# 1316#
1394# @param $1 - The directory to search for jar files (default: ${WORKDIR}) 1317# @param $1 - The directory to search for jar files (default: ${WORKDIR})
2539 # If you're forcing the VM, I hope you know what your doing... 2462 # If you're forcing the VM, I hope you know what your doing...
2540 debug-print "JAVA_PKG_FORCE_VM used: ${JAVA_PKG_FORCE_VM}" 2463 debug-print "JAVA_PKG_FORCE_VM used: ${JAVA_PKG_FORCE_VM}"
2541 export GENTOO_VM="${JAVA_PKG_FORCE_VM}" 2464 export GENTOO_VM="${JAVA_PKG_FORCE_VM}"
2542 # if we're allowed to switch the vm... 2465 # if we're allowed to switch the vm...
2543 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then 2466 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then
2544 debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}" 2467 debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}}"
2545 if [[ -n ${JAVA_PKG_VNEED} ]]; then
2546 GENTOO_VM="$(depend-java-query --need-virtual "${JAVA_PKG_VNEED}" --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")"
2547 else
2548 GENTOO_VM="$(depend-java-query --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")" 2468 GENTOO_VM="$(depend-java-query --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")"
2549 fi
2550 if [[ -z "${GENTOO_VM}" || "${GENTOO_VM}" == "None" ]]; then 2469 if [[ -z "${GENTOO_VM}" || "${GENTOO_VM}" == "None" ]]; then
2551 eerror "Unable to determine VM for building from dependencies:" 2470 eerror "Unable to determine VM for building from dependencies:"
2552 echo "NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}}" 2471 echo "NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}}"
2553 echo "VNEED: ${JAVA_PKG_VNEED}"
2554 die "Failed to determine VM for building." 2472 die "Failed to determine VM for building."
2555 else 2473 else
2556 export GENTOO_VM 2474 export GENTOO_VM
2557 fi 2475 fi
2558 # otherwise just make sure the current VM is sufficient 2476 # otherwise just make sure the current VM is sufficient

Legend:
Removed from v.1.127  
changed lines
  Added in v.1.128

  ViewVC Help
Powered by ViewVC 1.1.20