/[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.2 Revision 1.54
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.54 2007/01/29 18:37:24 betelgeuse Exp $
9 10
10 11
11# ----------------------------------------------------------------------------- 12# -----------------------------------------------------------------------------
12# @eclass-begin 13# @eclass-begin
13# @eclass-shortdesc Java Utility eclass 14# @eclass-shortdesc Java Utility eclass
14# @eclass-maintainer java@gentoo.org 15# @eclass-maintainer java@gentoo.org
15# 16#
16# This eclass provides functionality which is used by 17# This eclass provides functionality which is used by
17# java-pkg.eclass and java-pkg-opt.eclass as well as from ebuilds. 18# java-pkg.eclass and java-pkg-opt.eclass as well as from ebuilds.
18# 19#
19# @warning 20# @warning
20# You probably don't want to inherit this directly from an ebuild. Instead, 21# You probably don't want to inherit this directly from an ebuild. Instead,
21# you should inherit java-ant for Ant-based Java packages, java-pkg for other 22# you should inherit java-ant for Ant-based Java packages, java-pkg for other
22# Java packages, or java-pkg-opt for packages that have optional Java support. 23# Java packages, or java-pkg-opt for packages that have optional Java support.
23# 24#
24# ----------------------------------------------------------------------------- 25# -----------------------------------------------------------------------------
25 26
26inherit eutils versionator multilib 27inherit eutils versionator multilib
28
29IUSE="elibc_FreeBSD"
27 30
28# ----------------------------------------------------------------------------- 31# -----------------------------------------------------------------------------
29# @section-begin variables 32# @section-begin variables
30# @section-title Variables 33# @section-title Variables
31# 34#
34 37
35# Make sure we use java-config-2 38# Make sure we use java-config-2
36export WANT_JAVA_CONFIG="2" 39export WANT_JAVA_CONFIG="2"
37 40
38# ----------------------------------------------------------------------------- 41# -----------------------------------------------------------------------------
42# @variable-external WANT_ANT_TASKS
43# @variable-default ""
44#
45# An $IFS separated list of ant tasks.
46# Ebuild can specify this variable before inheriting java-ant-2 eclass to
47# determine ANT_TASKS it needs. They will be automatically translated to
48# DEPEND variable and ANT_TASKS variable. JAVA_PKG_FORCE_ANT_TASKS can override
49# ANT_TASKS set by WANT_ANT_TASKS, but not the DEPEND due to caching.
50# Ebuilds that need to depend conditionally on certain tasks and specify them
51# differently for different eant calls can't use this simplified approach.
52# You also cannot specify version or anything else than ant-*.
53#
54# @example WANT_ANT_TASKS="ant-junit ant-trax"
55#
56# @seealso JAVA_PKG_FORCE_ANT_TASKS
57# -----------------------------------------------------------------------------
58#WANT_ANT_TASKS
59
60# @variable-internal JAVA_PKG_PORTAGE_DEP
61#
62# The version of portage we need to function properly. At this moment it's
63# portage with phase hooks support.
64# -----------------------------------------------------------------------------
65JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1_pre1"
66
67# -----------------------------------------------------------------------------
39# @variable-internal JAVA_PKG_E_DEPEND 68# @variable-internal JAVA_PKG_E_DEPEND
40# 69#
41# This is a convience variable to be used from the other java eclasses. This is 70# This is a convience variable to be used from the other java eclasses. This is
42# the version of java-config we want to use. We also need a recent version 71# the version of java-config we want to use. We also need a recent version
43# portage, that includes phase hooks. 72# portage, that includes phase hooks.
44# ----------------------------------------------------------------------------- 73# -----------------------------------------------------------------------------
45JAVA_PKG_E_DEPEND=">=dev-java/java-config-2.0.19-r1 >=sys-apps/portage-2.1_pre1" 74JAVA_PKG_E_DEPEND=">=dev-java/java-config-2.0.19-r1 ${JAVA_PKG_PORTAGE_DEP}"
46 75
47# ----------------------------------------------------------------------------- 76# -----------------------------------------------------------------------------
48# @variable-external JAVA_PKG_ALLOW_VM_CHANGE 77# @variable-external JAVA_PKG_ALLOW_VM_CHANGE
49# @variable-default yes 78# @variable-default yes
50# 79#
97# ----------------------------------------------------------------------------- 126# -----------------------------------------------------------------------------
98 127
99# ----------------------------------------------------------------------------- 128# -----------------------------------------------------------------------------
100# @variable-internal JAVA_PKG_COMPILER_DIR 129# @variable-internal JAVA_PKG_COMPILER_DIR
101# @default /usr/share/java-config-2/compiler 130# @default /usr/share/java-config-2/compiler
102# 131#
103# Directory where compiler settings are saved, without trailing slash. 132# Directory where compiler settings are saved, without trailing slash.
104# Probably shouldn't touch this variable. 133# Probably shouldn't touch this variable.
105# ----------------------------------------------------------------------------- 134# -----------------------------------------------------------------------------
106JAVA_PKG_COMPILER_DIR=${JAVA_PKG_COMPILER_DIR:="/usr/share/java-config-2/compiler"} 135JAVA_PKG_COMPILER_DIR=${JAVA_PKG_COMPILER_DIR:="/usr/share/java-config-2/compiler"}
107 136
117 146
118# ----------------------------------------------------------------------------- 147# -----------------------------------------------------------------------------
119# @variable-external JAVA_PKG_FORCE_COMPILER 148# @variable-external JAVA_PKG_FORCE_COMPILER
120# 149#
121# Explicitly set a list of compilers to use. This is normally read from 150# Explicitly set a list of compilers to use. This is normally read from
122# JAVA_PKG_COMPILERS_CONF. 151# JAVA_PKG_COMPILERS_CONF.
123# 152#
124# @note This should only be used internally or for testing. 153# @note This should only be used internally or for testing.
125# @example Use jikes and javac, in that order 154# @example Use jikes and javac, in that order
126# JAVA_PKG_FORCE_COMPILER="jikes javac" 155# JAVA_PKG_FORCE_COMPILER="jikes javac"
127# ----------------------------------------------------------------------------- 156# -----------------------------------------------------------------------------
128 157
158# -----------------------------------------------------------------------------
159# @variable-external JAVA_PKG_FORCE_ANT_TASKS
160#
161# An $IFS separated list of ant tasks. Can be set in environment before calling
162# emerge/ebuild to override variables set in ebuild, mainly for testing before
163# putting the resulting (WANT_)ANT_TASKS into ebuild. Affects only ANT_TASKS in
164# eant() call, not the dependencies specified in WANT_ANT_TASKS.
165#
166# @example JAVA_PKG_FORCE_ANT_TASKS="ant-junit ant-trax" \
167# ebuild foo.ebuild compile
168#
169# @seealso WANT_ANT_TASKS
170# -----------------------------------------------------------------------------
171
129# TODO document me 172# TODO document me
130JAVA_PKG_QA_VIOLATIONS=0 173JAVA_PKG_QA_VIOLATIONS=0
131 174
132# ----------------------------------------------------------------------------- 175# -----------------------------------------------------------------------------
133# @section-end variables 176# @section-end variables
147# @ebuild-function java-pkg_dojar 190# @ebuild-function java-pkg_dojar
148# 191#
149# Installs any number of jars. 192# Installs any number of jars.
150# Jar's will be installed into /usr/share/${PN}(-${SLOT})/lib/ by default. 193# Jar's will be installed into /usr/share/${PN}(-${SLOT})/lib/ by default.
151# You can use java-pkg_jarinto to change this path. 194# You can use java-pkg_jarinto to change this path.
152# You should never install a jar with a package version in the filename. 195# You should never install a jar with a package version in the filename.
153# Instead, use java-pkg_newjar defined below. 196# Instead, use java-pkg_newjar defined below.
154# 197#
155# @example 198# @example
156# java-pkg_dojar dist/${PN}.jar dist/${PN}-core.jar 199# java-pkg_dojar dist/${PN}.jar dist/${PN}-core.jar
157# 200#
168 # Create JARDEST if it doesn't exist 211 # Create JARDEST if it doesn't exist
169 dodir ${JAVA_PKG_JARDEST} 212 dodir ${JAVA_PKG_JARDEST}
170 213
171 local jar 214 local jar
172 # for each jar 215 # for each jar
173 for jar in "$@"; do 216 for jar in "${@}"; do
174 local jar_basename=$(basename "${jar}") 217 local jar_basename=$(basename "${jar}")
175 218
176 java-pkg_check-versioned-jar ${jar_basename} 219 java-pkg_check-versioned-jar ${jar_basename}
177 220
178 # check if it exists 221 # check if it exists
179 if [[ -e "${jar}" ]] ; then 222 if [[ -e "${jar}" ]] ; then
223 # Don't overwrite if jar has already been installed with the same
224 # name
225 local dest="${D}${JAVA_PKG_JARDEST}/${jar_basename}"
226 if [[ -e "${dest}" ]]; then
227 ewarn "Overwriting ${dest}"
228 fi
229
180 # install it into JARDEST if it's a non-symlink 230 # install it into JARDEST if it's a non-symlink
181 if [[ ! -L "${jar}" ]] ; then 231 if [[ ! -L "${jar}" ]] ; then
182 INSDESTTREE="${JAVA_PKG_JARDEST}" \ 232 INSDESTTREE="${JAVA_PKG_JARDEST}" \
183 doins "${jar}" || die "failed to install ${jar}" 233 doins "${jar}" || die "failed to install ${jar}"
184 java-pkg_append_ JAVA_PKG_CLASSPATH "${JAVA_PKG_JARDEST}/${jar_basename}" 234 java-pkg_append_ JAVA_PKG_CLASSPATH "${JAVA_PKG_JARDEST}/${jar_basename}"
197 247
198 java-pkg_do_write_ 248 java-pkg_do_write_
199} 249}
200 250
201 251
252# ------------------------------------------------------------------------------
253# @internal-function depend-java-query
254#
255# Wrapper for the depend-java-query binary to enable passing USE in env.
256# Using env variables keeps this eclass working with java-config versions that
257# do not handle use flags.
258# ------------------------------------------------------------------------------
259
260depend-java-query() {
261 USE="${USE}" $(which depend-java-query) "${@}"
262}
202 263
203# ------------------------------------------------------------------------------ 264# ------------------------------------------------------------------------------
204# @ebuild-function java-pkg_regjar 265# @ebuild-function java-pkg_regjar
205# 266#
206# Records an already installed jar in the package.env 267# Records an already installed jar in the package.env
207# This would mostly be used if the package has make or a custom script to 268# This would mostly be used if the package has make or a custom script to
208# install things. 269# install things.
209# 270#
210# Example: 271# Example:
211# java-pkg-regjar ${D}/opt/foo/lib/foo.jar 272# java-pkg_regjar ${D}/opt/foo/lib/foo.jar
273#
274# WARNING:
275# if you want to use shell expansion, you have to use ${D}/... as the for in
276# this function will not be able to expand the path, here's an example:
277#
278# java-pkg_regjar /opt/my-java/lib/*.jar
279#
280# will not work, because:
281# * the `for jar in "$@"` can't expand the path to jar file names, as they
282# don't exist yet
283# * all `if ...` inside for will fail - the file '/opt/my-java/lib/*.jar'
284# doesn't exist
285#
286# you have to use it as:
287#
288# java-pkg_regjar ${D}/opt/my-java/lib/*.jar
212# 289#
213# @param $@ - jars to record 290# @param $@ - jars to record
214# ------------------------------------------------------------------------------ 291# ------------------------------------------------------------------------------
215# TODO fix me! 292# TODO should we be making sure the jar is present on ${D} or wherever?
216java-pkg_regjar() { 293java-pkg_regjar() {
217 debug-print-function ${FUNCNAME} $* 294 debug-print-function ${FUNCNAME} $*
218 295
219 java-pkg_check-phase install 296 java-pkg_check-phase install
220 297
221 [[ ${#} -lt 1 ]] && die "at least one argument needed" 298 [[ ${#} -lt 1 ]] && die "at least one argument needed"
222 299
223 java-pkg_init_paths_ 300 java-pkg_init_paths_
224 301
225 local jar jar_dir jar_file 302 local jar jar_dir jar_file
226 for jar in "$@"; do 303 for jar in "${@}"; do
227 # TODO use java-pkg_check-versioned-jar 304 # TODO use java-pkg_check-versioned-jar
228 if [[ -e "${jar}" ]]; then
229 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar}"
230 elif [[ -e "${D}${jar}" ]]; then 305 if [[ -e "${jar}" || -e "${D}${jar}" ]]; then
306 [[ -d "${jar}" || -d "${D}${jar}" ]] \
307 && die "Called ${FUNCNAME} on a directory $*"
308 # nelchael: we should strip ${D} in this case too, here's why:
309 # imagine such call:
310 # java-pkg_regjar ${D}/opt/java/*.jar
311 # such call will fall into this case (-e ${jar}) and will
312 # record paths with ${D} in package.env
231 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}" 313 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}"
232 else 314 else
233 die "${jar} does not exist" 315 die "${jar} does not exist"
234 fi 316 fi
235 done 317 done
236 318
237 java-pkg_do_write_ 319 java-pkg_do_write_
238} 320}
239 321
240
241# ------------------------------------------------------------------------------ 322# ------------------------------------------------------------------------------
242# @ebuild-function java-pkg_newjar 323# @ebuild-function java-pkg_newjar
243# 324#
244# Installs a jar with a new name 325# Installs a jar with a new name
245# 326#
255 local original_jar="${1}" 336 local original_jar="${1}"
256 local new_jar="${2:-${PN}.jar}" 337 local new_jar="${2:-${PN}.jar}"
257 local new_jar_dest="${T}/${new_jar}" 338 local new_jar_dest="${T}/${new_jar}"
258 339
259 [[ -z ${original_jar} ]] && die "Must specify a jar to install" 340 [[ -z ${original_jar} ]] && die "Must specify a jar to install"
260 [[ ! -f ${original_jar} ]] && die "${new_jar} does not exist!" 341 [[ ! -f ${original_jar} ]] \
342 && die "${original_jar} does not exist or is not a file!"
261 343
262 rm -f "${new_jar_dest}" || die "Failed to remove ${new_jar_dest}" 344 rm -f "${new_jar_dest}" || die "Failed to remove ${new_jar_dest}"
263 cp "${original_jar}" "${new_jar_dest}" \ 345 cp "${original_jar}" "${new_jar_dest}" \
264 || die "Failed to copy ${original_jar} to ${new_jar_dest}" 346 || die "Failed to copy ${original_jar} to ${new_jar_dest}"
265 java-pkg_dojar "${new_jar_dest}" 347 java-pkg_dojar "${new_jar_dest}"
266} 348}
267 349
268
269# ------------------------------------------------------------------------------ 350# ------------------------------------------------------------------------------
270# @ebuild-function java-pkg_addcp 351# @ebuild-function java-pkg_addcp
271# 352#
272# Add something to the package's classpath. For jars, you should use dojar, 353# Add something to the package's classpath. For jars, you should use dojar,
273# newjar, or regjar. This is typically used to add directories to the classpath. 354# newjar, or regjar. This is typically used to add directories to the classpath.
278java-pkg_addcp() { 359java-pkg_addcp() {
279 java-pkg_append_ JAVA_PKG_CLASSPATH "${@}" 360 java-pkg_append_ JAVA_PKG_CLASSPATH "${@}"
280 java-pkg_do_write_ 361 java-pkg_do_write_
281} 362}
282 363
283
284# ------------------------------------------------------------------------------ 364# ------------------------------------------------------------------------------
285# @ebuild-function java-pkg_doso 365# @ebuild-function java-pkg_doso
286# 366#
287# Installs any number of JNI libraries 367# Installs any number of JNI libraries
288# They will be installed into /usr/lib by default, but java-pkg_sointo 368# They will be installed into /usr/lib by default, but java-pkg_sointo
289# can be used change this path 369# can be used change this path
290# 370#
291# Example: 371# Example:
346 java-pkg_check-phase install 426 java-pkg_check-phase install
347 427
348 [[ ${#} -lt 1 ]] && "at least one argument needed" 428 [[ ${#} -lt 1 ]] && "at least one argument needed"
349 429
350 java-pkg_init_paths_ 430 java-pkg_init_paths_
351 431
352 local lib target_dir 432 local lib target_dir
353 for lib in "$@" ; do 433 for lib in "$@" ; do
354 # Check the absolute path of the lib 434 # Check the absolute path of the lib
355 if [[ -e "${lib}" ]] ; then 435 if [[ -e "${lib}" ]] ; then
356 target_dir="$(java-pkg_expand_dir_ ${lib})" 436 target_dir="$(java-pkg_expand_dir_ ${lib})"
404# ------------------------------------------------------------------------------ 484# ------------------------------------------------------------------------------
405java-pkg_dohtml() { 485java-pkg_dohtml() {
406 debug-print-function ${FUNCNAME} $* 486 debug-print-function ${FUNCNAME} $*
407 487
408 [[ ${#} -lt 1 ]] && die "At least one argument required for ${FUNCNAME}" 488 [[ ${#} -lt 1 ]] && die "At least one argument required for ${FUNCNAME}"
409 # TODO-nichoj find out what exactly -f package-list does 489
490 # from /usr/lib/portage/bin/dohtml -h
491 # -f Set list of allowed extensionless file names.
410 dohtml -f package-list "$@" 492 dohtml -f package-list "$@"
493
411 # this probably shouldn't be here but it provides 494 # this probably shouldn't be here but it provides
412 # a reasonable way to catch # docs for all of the 495 # a reasonable way to catch # docs for all of the
413 # old ebuilds. 496 # old ebuilds.
414 java-pkg_recordjavadoc 497 java-pkg_recordjavadoc
415} 498}
416 499
417# TODO document 500# ------------------------------------------------------------------------------
501# @ebuild-function java-pkg_dojavadoc
502#
503# Installs javadoc documentation. This should be controlled by the doc use flag.
504#
505# @param $1: - The javadoc root directory.
506#
507# @example:
508# java-pkg_dojavadoc docs/api
509#
510# ------------------------------------------------------------------------------
418java-pkg_dojavadoc() { 511java-pkg_dojavadoc() {
419 local dir="$1" 512 local dir="$1"
420 513
421 java-pkg_check-phase install 514 java-pkg_check-phase install
422 515
434} 527}
435 528
436# ------------------------------------------------------------------------------ 529# ------------------------------------------------------------------------------
437# @ebuild-function java-pkg_dosrc 530# @ebuild-function java-pkg_dosrc
438# 531#
439# Installs a zip containing the source for a package, so it can used in 532# Installs a zip containing the source for a package, so it can used in
440# from IDEs like eclipse and netbeans. 533# from IDEs like eclipse and netbeans.
441# 534#
442# Ebuild needs to DEPEND on app-arch/zip to use this. 535# Ebuild needs to DEPEND on app-arch/zip to use this.
443# 536#
444# It also should be controlled by USE=source. 537# It also should be controlled by USE=source.
445# 538#
446# @example: 539# @example:
447# java-pkg_dosrc src/* 540# java-pkg_dosrc src/*
448# 541#
449# ------------------------------------------------------------------------------ 542# ------------------------------------------------------------------------------
450# TODO change so it the arguments it takes are the base directories containing 543# TODO change so it the arguments it takes are the base directories containing
451# source -nichoj 544# source -nichoj
452# TODO should we be able to handle multiple calls to dosrc? -nichoj 545# TODO should we be able to handle multiple calls to dosrc? -nichoj
453# TODO maybe we can take an existing zip/jar? -nichoj 546# TODO maybe we can take an existing zip/jar? -nichoj
454# FIXME apparently this fails if you give it an empty directories 547# FIXME apparently this fails if you give it an empty directories
455java-pkg_dosrc() { 548java-pkg_dosrc() {
456 debug-print-function ${FUNCNAME} $* 549 debug-print-function ${FUNCNAME} $*
457 550
458 [ ${#} -lt 1 ] && die "At least one argument needed" 551 [ ${#} -lt 1 ] && die "At least one argument needed"
459 if ! hasq source ${IUSE}; then 552 if ! hasq source ${IUSE}; then
460 echo "Java QA Notice: ${FUNCNAME} called without source in IUSE" 553 echo "Java QA Notice: ${FUNCNAME} called without source in IUSE"
461 fi 554 fi
462 555
463 java-pkg_check-phase install 556 java-pkg_check-phase install
464 557
465 [[ ${#} -lt 1 ]] && die "At least one argument needed" 558 [[ ${#} -lt 1 ]] && die "At least one argument needed"
466 559
467 java-pkg_init_paths_ 560 java-pkg_init_paths_
468 561
469 local zip_name="${PN}-src.zip" 562 local zip_name="${PN}-src.zip"
470 local zip_path="${T}/${zip_name}" 563 local zip_path="${T}/${zip_name}"
471 local dir 564 local dir
472 for dir in ${@}; do 565 for dir in "${@}"; do
473 local dir_parent=$(dirname "${dir}") 566 local dir_parent=$(dirname "${dir}")
474 local dir_name=$(basename "${dir}") 567 local dir_name=$(basename "${dir}")
475 pushd ${dir_parent} > /dev/null || die "problem entering ${dir_parent}" 568 pushd ${dir_parent} > /dev/null || die "problem entering ${dir_parent}"
476 zip -q -r ${zip_path} ${dir_name} -i '*.java' 569 zip -q -r ${zip_path} ${dir_name} -i '*.java'
477 local result=$? 570 local result=$?
494# @ebuild-function java-pkg_dolauncher 587# @ebuild-function java-pkg_dolauncher
495# 588#
496# Make a wrapper script to lauch/start this package 589# Make a wrapper script to lauch/start this package
497# If necessary, the wrapper will switch to the appropriate VM. 590# If necessary, the wrapper will switch to the appropriate VM.
498# 591#
592# Can be called without parameters if the package installs only one jar
593# that has the Main-class attribute set. The wrapper will be named ${PN}.
594#
499# @param $1 - filename of launcher to create 595# @param $1 - filename of launcher to create
500# @param $2 - options, as follows: 596# @param $2 - options, as follows:
501# --main the.main.class.too.start 597# --main the.main.class.too.start
502# --jar /the/jar/too/launch.jar 598# --jar /the/jar/too/launch.jar or just <name>.jar
503# --java_args 'Extra arguments to pass too jave' 599# --java_args 'Extra arguments to pass to java'
504# --pkg_args 'extra arguments too pass too the package' 600# --pkg_args 'Extra arguments to pass to the package'
505# --pwd 601# --pwd Directory the launcher changes to before executing java
506# -into 602# -into Directory to install the launcher to, instead of /usr/bin
507# -pre 603# -pre Prepend contents of this file to the launcher
508# ------------------------------------------------------------------------------ 604# ------------------------------------------------------------------------------
509java-pkg_dolauncher() { 605java-pkg_dolauncher() {
510 debug-print-function ${FUNCNAME} $* 606 debug-print-function ${FUNCNAME} $*
511 607
512 java-pkg_check-phase install 608 java-pkg_check-phase install
513
514 [[ ${#} -lt 1 ]] && die "Need at least one argument"
515
516 java-pkg_init_paths_ 609 java-pkg_init_paths_
517 610
611 if [[ ${#} = 0 ]]; then
612 local name="${PN}"
613 else
518 local name="${1}" 614 local name="${1}"
615 shift
616 fi
617
519 # TODO rename to launcher 618 # TODO rename to launcher
520 local target="${T}/${name}" 619 local target="${T}/${name}"
620 local var_tmp="${T}/launcher_variables_tmp"
521 local target_dir pre 621 local target_dir pre
522 shift
523 622
524 echo "#!/bin/bash" > "${target}" 623 # Process the other the rest of the arguments
525 while [[ -n "${1}" && -n "${2}" ]]; do 624 while [[ -n "${1}" && -n "${2}" ]]; do
526 local var=${1} value=${2} 625 local var="${1}" value="${2}"
527 if [[ "${var:0:2}" == "--" ]]; then 626 if [[ "${var:0:2}" == "--" ]]; then
627 local var=${var:2}
528 echo "gjl_${var:2}=\"${value}\"" >> "${target}" 628 echo "gjl_${var}=\"${value}\"" >> "${var_tmp}"
629 local gjl_${var}="${value}"
529 elif [[ "${var}" == "-into" ]]; then 630 elif [[ "${var}" == "-into" ]]; then
530 target_dir="${value}" 631 target_dir="${value}"
531 elif [[ "${var}" == "-pre" ]]; then 632 elif [[ "${var}" == "-pre" ]]; then
532 pre="${value}" 633 pre="${value}"
533 fi 634 fi
534 shift 2 635 shift 2
535 done 636 done
637
638 # Test if no --jar and --main arguments were given and
639 # in that case check if the package only installs one jar
640 # and use that jar.
641 if [[ -z "${gjl_jar}" && -z "${gjl_main}" ]]; then
642 local cp="${JAVA_PKG_CLASSPATH}"
643 if [[ "${cp/:}" = "${cp}" && "${cp%.jar}" != "${cp}" ]]; then
644 echo "gjl_jar=\"${JAVA_PKG_CLASSPATH}\"" >> "${var_tmp}"
645 else
646 local msg="Not enough information to create a launcher given."
647 msg="${msg} Please give --jar or --main argument to ${FUNCNAME}."
648 die "${msg}"
649 fi
650 fi
651
652 # Write the actual script
653 echo "#!/bin/bash" > "${target}"
654 if [[ -n "${pre}" ]]; then
655 if [[ -f "${pre}" ]]; then
656 cat "${pre}" >> "${target}"
657 else
658 die "-pre specified file '${pre}' does not exist"
659 fi
660 fi
536 echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}" 661 echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}"
537 [[ -n "${pre}" ]] && [[ -f "${pre}" ]] && cat "${pre}" >> "${target}" 662 cat "${var_tmp}" >> "${target}"
663 rm -f "${var_tmp}"
538 echo "source /usr/share/java-config-2/launcher/launcher.bash" >> "${target}" 664 echo "source /usr/share/java-config-2/launcher/launcher.bash" >> "${target}"
539 665
540 if [[ -n "${into}" ]]; then 666 if [[ -n "${target_dir}" ]]; then
541 DESTTREE="${target_dir}" dobin "${target}" 667 DESTTREE="${target_dir}" dobin "${target}"
542 local ret=$? 668 local ret=$?
543 return ${ret} 669 return ${ret}
544 else 670 else
545 dobin "${target}" 671 dobin "${target}"
573 echo "dowar: warning, skipping directory ${war}" 699 echo "dowar: warning, skipping directory ${war}"
574 continue 700 continue
575 else 701 else
576 warpath="${war}" 702 warpath="${war}"
577 fi 703 fi
578 704
579 # Install those files like you mean it 705 # Install those files like you mean it
580 INSOPTIONS="-m 0644" \ 706 INSOPTIONS="-m 0644" \
581 INSDESTTREE=${JAVA_PKG_WARDEST} \ 707 INSDESTTREE=${JAVA_PKG_WARDEST} \
582 doins ${warpath} 708 doins ${warpath}
583 done 709 done
618# @ebuild-function java-pkg_jar-from 744# @ebuild-function java-pkg_jar-from
619# 745#
620# Makes a symlink to a jar from a certain package 746# Makes a symlink to a jar from a certain package
621# A lot of java packages include dependencies in a lib/ directory 747# A lot of java packages include dependencies in a lib/ directory
622# You can use this function to replace these bundled dependencies. 748# You can use this function to replace these bundled dependencies.
749# The dependency is recorded into package.env DEPEND line, unless "--build-only"
750# is passed as the very first argument, for jars that have to be present only
751# at build time and are not needed on runtime (junit testing etc).
623# 752#
624# Example: get all jars from xerces slot 2 753# Example: get all jars from xerces slot 2
625# java-pkg_jar-from xerces-2 754# java-pkg_jar-from xerces-2
626# Example: get a specific jar from xerces slot 2 755# Example: get a specific jar from xerces slot 2
627# java-pkg_jar-from xerces-2 xml-apis.jar 756# java-pkg_jar-from xerces-2 xml-apis.jar
628# Example get a specific jar from xerces slot 2, and name it diffrently 757# Example: get a specific jar from xerces slot 2, and name it diffrently
629# java-pkg_jar-from xerces-2 xml-apis.jar xml.jar 758# java-pkg_jar-from xerces-2 xml-apis.jar xml.jar
759# Example: get junit.jar which is needed only for building
760# java-pkg_jar-from --build-only junit junit.jar
630# 761#
762# @param $opt
763# --build-only - makes the jar(s) not added into package.env DEPEND line.
764# (assumed automatically when called inside src_test)
765# --with-dependencies - get jars also from requested package's dependencies
766# transitively.
767# --into $dir - symlink jar(s) into $dir (must exist) instead of .
631# @param $1 - Package to get jars from. 768# @param $1 - Package to get jars from.
632# @param $2 - jar from package. If not specified, all jars will be used. 769# @param $2 - jar from package. If not specified, all jars will be used.
633# @param $3 - When a single jar is specified, destination filename of the 770# @param $3 - When a single jar is specified, destination filename of the
634# symlink. Defaults to the name of the jar. 771# symlink. Defaults to the name of the jar.
635# ------------------------------------------------------------------------------ 772# ------------------------------------------------------------------------------
636# TODO could probably be cleaned up a little 773# TODO could probably be cleaned up a little
637java-pkg_jar-from() { 774java-pkg_jar-from() {
638 debug-print-function ${FUNCNAME} $* 775 debug-print-function ${FUNCNAME} $*
639 776
640 local target_pkg="${1}" target_jar="${2}" destjar="${3}" 777 local build_only=""
778 local destdir="."
779 local deep=""
641 780
781 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="true"
782
783 while [[ "${1}" == --* ]]; do
784 if [[ "${1}" = "--build-only" ]]; then
785 build_only="true"
786 elif [[ "${1}" = "--with-dependencies" ]]; then
787 deep="--with-dependencies"
788 elif [[ "${1}" = "--into" ]]; then
789 destdir="${2}"
790 shift
791 else
792 die "java-pkg_jar-from called with unknown parameter: ${1}"
793 fi
794 shift
795 done
796
797 local target_pkg="${1}" target_jar="${2}" destjar="${3}"
798
642 [[ -z ${target_pkg} ]] && die "Must specify a package" 799 [[ -z ${target_pkg} ]] && die "Must specify a package"
643 800
644 # default destjar to the target jar 801 # default destjar to the target jar
645 [[ -z "${destjar}" ]] && destjar="${target_jar}" 802 [[ -z "${destjar}" ]] && destjar="${target_jar}"
646 803
804 local error_msg="There was a problem getting the classpath for ${target_pkg}."
805 local classpath
647 local classpath="$(java-config --classpath=${target_pkg})" 806 classpath="$(java-config ${deep} --classpath=${target_pkg})"
648 [[ $? != 0 ]] && die "There was a problem getting the classpath for ${target_pkg}" 807 [[ $? != 0 ]] && die ${error_msg}
649 808
809 pushd ${destdir} > /dev/null \
810 || die "failed to change directory to ${destdir}"
650 local jar 811 local jar
651 for jar in ${classpath//:/ }; do 812 for jar in ${classpath//:/ }; do
652 local jar_name=$(basename "${jar}") 813 local jar_name=$(basename "${jar}")
653 if [[ ! -f "${jar}" ]] ; then 814 if [[ ! -f "${jar}" ]] ; then
654 debug-print "${jar} from ${target_pkg} does not exist" 815 debug-print "${jar} from ${target_pkg} does not exist"
657 # If no specific target jar was indicated, link it 818 # If no specific target jar was indicated, link it
658 if [[ -z "${target_jar}" ]] ; then 819 if [[ -z "${target_jar}" ]] ; then
659 [[ -f "${target_jar}" ]] && rm "${target_jar}" 820 [[ -f "${target_jar}" ]] && rm "${target_jar}"
660 ln -snf "${jar}" \ 821 ln -snf "${jar}" \
661 || die "Failed to make symlink from ${jar} to ${jar_name}" 822 || die "Failed to make symlink from ${jar} to ${jar_name}"
662 java-pkg_record-jar_ "${target_pkg}" "${jar}" 823 [[ -z "${build_only}" ]] && java-pkg_record-jar_ "${target_pkg}" "${jar}"
663 # otherwise, if the current jar is the target jar, link it 824 # otherwise, if the current jar is the target jar, link it
664 elif [[ "${jar_name}" == "${target_jar}" ]] ; then 825 elif [[ "${jar_name}" == "${target_jar}" ]] ; then
665 [[ -f "${destjar}" ]] && rm "${destjar}" 826 [[ -f "${destjar}" ]] && rm "${destjar}"
666 ln -snf "${jar}" "${destjar}" \ 827 ln -snf "${jar}" "${destjar}" \
667 || die "Failed to make symlink from ${jar} to ${destjar}" 828 || die "Failed to make symlink from ${jar} to ${destjar}"
668 java-pkg_record-jar_ "${target_pkg}" "${jar}" 829 [[ -z "${build_only}" ]] && java-pkg_record-jar_ "${target_pkg}" "${jar}"
830 popd > /dev/null
669 return 0 831 return 0
670 fi 832 fi
671 done 833 done
834 popd > /dev/null
672 # if no target was specified, we're ok 835 # if no target was specified, we're ok
673 if [[ -z "${target_jar}" ]] ; then 836 if [[ -z "${target_jar}" ]] ; then
674 return 0 837 return 0
675 # otherwise, die bitterly 838 # otherwise, die bitterly
676 else 839 else
690# ------------------------------------------------------------------------------ 853# ------------------------------------------------------------------------------
691# @ebuild-function java-pkg_getjars 854# @ebuild-function java-pkg_getjars
692# 855#
693# Get the classpath provided by any number of packages 856# Get the classpath provided by any number of packages
694# Among other things, this can be passed to 'javac -classpath' or 'ant -lib'. 857# Among other things, this can be passed to 'javac -classpath' or 'ant -lib'.
858# The providing packages are recorded as dependencies into package.env DEPEND
859# line, unless "--build-only" is passed as the very first argument, for jars
860# that have to be present only at build time and are not needed on runtime
861# (junit testing etc).
695# 862#
696# Example: Get the classpath for xerces-2, 863# Example: Get the classpath for xerces-2 and xalan,
697# java-pkg_getjars xerces-2 xalan 864# java-pkg_getjars xerces-2,xalan
698# Example Return: 865# Example Return:
699# /usr/share/xerces-2/lib/xml-apis.jar:/usr/share/xerces-2/lib/xmlParserAPIs.jar:/usr/share/xalan/lib/xalan.jar 866# /usr/share/xerces-2/lib/xml-apis.jar:/usr/share/xerces-2/lib/xmlParserAPIs.jar:/usr/share/xalan/lib/xalan.jar
700# 867#
868# @param $opt
869# --build-only - makes the jar(s) not added into package.env DEPEND line.
870# (assumed automatically when called inside src_test)
871# --with-dependencies - get jars also from requested package's dependencies
872# transitively.
701# @param $@ - list of packages to get jars from 873# @param $1 - list of packages to get jars from
874# (passed to java-config --classpath)
702# ------------------------------------------------------------------------------ 875# ------------------------------------------------------------------------------
703java-pkg_getjars() { 876java-pkg_getjars() {
704 debug-print-function ${FUNCNAME} $* 877 debug-print-function ${FUNCNAME} $*
705 878
706 [[ ${#} -lt 1 ]] && die "At least one argument needed" 879 local build_only=""
880 local deep=""
881
882 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="true"
707 883
708 # NOTE could probably just pass $@ to java-config --classpath. and return it 884 while [[ "${1}" == --* ]]; do
709 local classpath pkg 885 if [[ "${1}" = "--build-only" ]]; then
710 for pkg in ${@//,/ }; do 886 build_only="true"
711 #for pkg in $(echo "$@" | tr ',' ' '); do 887 elif [[ "${1}" = "--with-dependencies" ]]; then
712 jars="$(java-config --classpath=${pkg})" 888 deep="--with-dependencies"
713 debug-print "${pkg}:${jars}"
714 # TODO should we ensure jars exist?
715 if [[ -z "${classpath}" ]]; then
716 classpath="${jars}"
717 else 889 else
718 classpath="${classpath}:${jars}" 890 die "java-pkg_jar-from called with unknown parameter: ${1}"
719 fi 891 fi
720 java-pkg_record-jar_ "${pkg}" 892 shift
721 done 893 done
894
895 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --*"
896
897 local classpath pkgs="${1}"
898 jars="$(java-config ${deep} --classpath=${pkgs})"
899 [[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed"
900 debug-print "${pkgs}:${jars}"
901
902 if [[ -z "${classpath}" ]]; then
903 classpath="${jars}"
904 else
905 classpath="${classpath}:${jars}"
906 fi
907
908 # Only record jars that aren't build-only
909 if [[ -z "${build_only}" ]]; then
910 oldifs="${IFS}"
911 IFS=","
912 for pkg in ${pkgs}; do
913 java-pkg_record-jar_ "${pkg}"
914 done
915 IFS="${oldifs}"
916 fi
917
722 echo "${classpath}" 918 echo "${classpath}"
723} 919}
724 920
725# ------------------------------------------------------------------------------ 921# ------------------------------------------------------------------------------
726# @ebuild-function java-pkg_getjar 922# @ebuild-function java-pkg_getjar
727# 923#
728# Get the filename of a single jar from a package 924# Get the filename of a single jar from a package
925# The providing package is recorded as runtime dependency into package.env
926# DEPEND line, unless "--build-only" is passed as the very first argument, for
927# jars that have to be present only at build time and are not needed on runtime
928# (junit testing etc).
729# 929#
730# @example 930# @example
731# java-pkg_getjar xerces-2 xml-apis.jar 931# java-pkg_getjar xerces-2 xml-apis.jar
732# @example-return 932# @example-return
733# /usr/share/xerces-2/lib/xml-apis.jar 933# /usr/share/xerces-2/lib/xml-apis.jar
734# 934#
935# @param $opt
936# --build-only - makes the jar not added into package.env DEPEND line.
735# @param $1 - package to use 937# @param $1 - package to use
736# @param $2 - jar to get 938# @param $2 - jar to get
737# ------------------------------------------------------------------------------ 939# ------------------------------------------------------------------------------
738java-pkg_getjar() { 940java-pkg_getjar() {
739 debug-print-function ${FUNCNAME} $* 941 debug-print-function ${FUNCNAME} $*
942
943 local build_only=""
944
945 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="true"
946
947 while [[ "${1}" == --* ]]; do
948 if [[ "${1}" = "--build-only" ]]; then
949 build_only="true"
950 else
951 die "java-pkg_jar-from called with unknown parameter: ${1}"
952 fi
953 shift
954 done
955
956 [[ ${#} -ne 2 ]] && die "${FUNCNAME} takes only two arguments besides --*"
740 957
741 local pkg="${1}" target_jar="${2}" jar 958 local pkg="${1}" target_jar="${2}" jar
742 [[ -z ${pkg} ]] && die "Must specify package to get a jar from" 959 [[ -z ${pkg} ]] && die "Must specify package to get a jar from"
743 [[ -z ${target_jar} ]] && die "Must specify jar to get" 960 [[ -z ${target_jar} ]] && die "Must specify jar to get"
744 961
745 # TODO check that package is actually installed 962 local error_msg="Could not find classpath for ${pkg}. Are you sure its installed?"
963 local classpath
746 local classpath=$(java-config --classpath=${pkg}) 964 classpath=$(java-config --classpath=${pkg})
747 [[ $? != 0 ]] && die "There could not find classpath for ${pkg}. Are you sure its installed?" 965 [[ $? != 0 ]] && die ${error_msg}
966
748 for jar in ${classpath//:/ }; do 967 for jar in ${classpath//:/ }; do
749 if [[ ! -f "${jar}" ]] ; then 968 if [[ ! -f "${jar}" ]] ; then
750 die "Installation problems with jars in ${pkg} - is it installed?" 969 die "Installation problem with jar ${jar} in ${pkg} - is it installed?"
751 fi 970 fi
752 971
753 if [[ "$(basename ${jar})" == "${target_jar}" ]] ; then 972 if [[ "$(basename ${jar})" == "${target_jar}" ]] ; then
754 java-pkg_record-jar_ "${pkg}" "${jar}" 973 # Only record jars that aren't build-only
974 [[ -z "${build_only}" ]] && java-pkg_record-jar_ "${pkg}" "${jar}"
755 echo "${jar}" 975 echo "${jar}"
756 return 0 976 return 0
757 fi 977 fi
758 done 978 done
759 979
760 die "Could not find ${target_jar} in ${pkg}" 980 die "Could not find ${target_jar} in ${pkg}"
761 return 1 981 return 1
762} 982}
763 983
764# This function reads stdin, and based on that input, figures out how to 984# This function reads stdin, and based on that input, figures out how to
778# line="${line// /}" 998# line="${line// /}"
779# 999#
780# # format: path=jarinfo 1000# # format: path=jarinfo
781# local path=${line%%=*} 1001# local path=${line%%=*}
782# local jarinfo=${line##*=} 1002# local jarinfo=${line##*=}
783# 1003#
784# # format: jar@package 1004# # format: jar@package
785# local jar=${jarinfo%%@*}.jar 1005# local jar=${jarinfo%%@*}.jar
786# local package=${jarinfo##*@} 1006# local package=${jarinfo##*@}
787# if [[ -n ${replace_only} ]]; then 1007# if [[ -n ${replace_only} ]]; then
788# [[ ! -f $path ]] && die "No jar exists at ${path}" 1008# [[ ! -f $path ]] && die "No jar exists at ${path}"
801# @section-end query 1021# @section-end query
802# ------------------------------------------------------------------------------ 1022# ------------------------------------------------------------------------------
803 1023
804# ------------------------------------------------------------------------------ 1024# ------------------------------------------------------------------------------
805# @section-begin helper 1025# @section-begin helper
806# @section-summary Helper functions 1026# @section-summary Helper functions
807# 1027#
808# Various other functions to use from an ebuild 1028# Various other functions to use from an ebuild
809# ------------------------------------------------------------------------------ 1029# ------------------------------------------------------------------------------
810 1030
811# ------------------------------------------------------------------------------ 1031# ------------------------------------------------------------------------------
817# jdbc-stdext 1037# jdbc-stdext
818# jaf 1038# jaf
819# jdbc-rowset 1039# jdbc-rowset
820# jms 1040# jms
821# 1041#
822# @param $1 - Optionally indicate that the dependencies are controlled by 1042# @param $1 - Optionally indicate that the dependencies are controlled by
823# a use flag by specifying '--use' Requires $2. 1043# a use flag by specifying '--use' Requires $2.
824# @param $2 - USE flag which will enable the dependencies. 1044# @param $2 - USE flag which will enable the dependencies.
825# @param $@ - virtual packages to add depenedencies for 1045# @param $@ - virtual packages to add depenedencies for
826# ------------------------------------------------------------------------------ 1046# ------------------------------------------------------------------------------
827# TODO rewrite to parse a line based declaration file instead -- karltk 1047# TODO rewrite to parse a line based declaration file instead -- karltk
883# 1103#
884# export DEPEND="${DEPEND} ${depstr}" 1104# export DEPEND="${DEPEND} ${depstr}"
885# export RDEPEND="${RDEPEND} ${depstr}" 1105# export RDEPEND="${RDEPEND} ${depstr}"
886#} 1106#}
887 1107
1108# ------------------------------------------------------------------------------
1109# @ebuild-function java-pkg_find-normal-jars
1110#
1111# Find the files with suffix .jar file in the given directory or $WORKDIR
1112#
1113# @param $1 - The directory to search for jar files (default: ${WORKDIR})
1114# ------------------------------------------------------------------------------
1115java-pkg_find-normal-jars() {
1116 local dir=$1
1117 [[ "${dir}" ]] || dir="${WORKDIR}"
1118 local found
1119 for jar in $(find "${dir}" -name "*.jar" -type f); do
1120 echo "${jar}"
1121 found="true"
1122 done
1123 [[ "${found}" ]]
1124 return $?
1125}
1126
1127# ------------------------------------------------------------------------------
1128# @ebuild-function java-pkg_ensure-no-bundled-jars
1129#
1130# Try to locate bundled jar files in ${WORKDIR} and die if found.
888# This should be used after S has been populated with symlinks to jars 1131# This function should be called after WORKDIR has been populated with symlink
889# TODO document 1132# to system jar files or bundled jars removed.
1133# ------------------------------------------------------------------------------
890java-pkg_ensure-no-bundled-jars() { 1134java-pkg_ensure-no-bundled-jars() {
891 debug-print-function ${FUNCNAME} $* 1135 debug-print-function ${FUNCNAME} $*
892 pushd ${WORKDIR} >/dev/null 2>/dev/null
893 1136
894 local bundled_jars=$(find . -name "*.jar" -type f) 1137 local bundled_jars=$(java-pkg_find-normal-jars)
895 if [[ -n ${bundled_jars} ]]; then 1138 if [[ -n ${bundled_jars} ]]; then
896 echo "Bundled jars found:" 1139 echo "Bundled jars found:"
897 local jar 1140 local jar
898 for jar in ${bundled_jars}; do 1141 for jar in ${bundled_jars}; do
899 echo $(pwd)${jar/./} 1142 echo $(pwd)${jar/./}
900 done 1143 done
901 die "Bundled jars found!" 1144 die "Bundled jars found!"
902
903 fi 1145 fi
904 popd >/dev/null 2>/dev/null
905} 1146}
906 1147
907# ------------------------------------------------------------------------------ 1148# ------------------------------------------------------------------------------
908# @internal-function java-pkg_ensure-vm-version-sufficient 1149# @internal-function java-pkg_ensure-vm-version-sufficient
909# 1150#
921 fi 1162 fi
922} 1163}
923 1164
924# ------------------------------------------------------------------------------ 1165# ------------------------------------------------------------------------------
925# @internal-function java-pkg_is-vm-version-sufficient 1166# @internal-function java-pkg_is-vm-version-sufficient
926# 1167#
927# @return zero - VM is sufficient 1168# @return zero - VM is sufficient
928# @return non-zero - VM is not sufficient 1169# @return non-zero - VM is not sufficient
929# ------------------------------------------------------------------------------ 1170# ------------------------------------------------------------------------------
930java-pkg_is-vm-version-sufficient() { 1171java-pkg_is-vm-version-sufficient() {
931 debug-print-function ${FUNCNAME} $* 1172 debug-print-function ${FUNCNAME} $*
951 die "Active Java VM too old" 1192 die "Active Java VM too old"
952 fi 1193 fi
953} 1194}
954 1195
955# ------------------------------------------------------------------------------ 1196# ------------------------------------------------------------------------------
956# @internal-function java-pkg_is-vm-version-eq 1197# @internal-function java-pkg_is-vm-version-eq
957# 1198#
958# @param $@ - VM version to compare current VM to 1199# @param $@ - VM version to compare current VM to
959# @return zero - VM versions are equal 1200# @return zero - VM versions are equal
960# @return non-zero - VM version are not equal 1201# @return non-zero - VM version are not equal
961# ------------------------------------------------------------------------------ 1202# ------------------------------------------------------------------------------
962java-pkg_is-vm-version-eq() { 1203java-pkg_is-vm-version-eq() {
992# 1233#
993# @param $@ - VM version to compare current to 1234# @param $@ - VM version to compare current to
994# ------------------------------------------------------------------------------ 1235# ------------------------------------------------------------------------------
995java-pkg_ensure-vm-version-ge() { 1236java-pkg_ensure-vm-version-ge() {
996 debug-print-function ${FUNCNAME} $* 1237 debug-print-function ${FUNCNAME} $*
997 1238
998 if ! java-pkg_is-vm-version-ge "$@" ; then 1239 if ! java-pkg_is-vm-version-ge "$@" ; then
999 debug-print "vm is not suffient" 1240 debug-print "vm is not suffient"
1000 eerror "This package requires a Java VM version >= $@" 1241 eerror "This package requires a Java VM version >= $@"
1001 einfo "Please use java-config -S to set the correct one" 1242 einfo "Please use java-config -S to set the correct one"
1002 die "Active Java VM too old" 1243 die "Active Java VM too old"
1003 fi 1244 fi
1004} 1245}
1005 1246
1006# ------------------------------------------------------------------------------ 1247# ------------------------------------------------------------------------------
1007# @internal-function java-pkg_is-vm-version-ge 1248# @internal-function java-pkg_is-vm-version-ge
1008# 1249#
1009# @param $@ - VM version to compare current VM to 1250# @param $@ - VM version to compare current VM to
1010# @return zero - current VM version is greater than checked version 1251# @return zero - current VM version is greater than checked version
1011# @return non-zero - current VM version is not greater than checked version 1252# @return non-zero - current VM version is not greater than checked version
1012# ------------------------------------------------------------------------------ 1253# ------------------------------------------------------------------------------
1013java-pkg_is-vm-version-ge() { 1254java-pkg_is-vm-version-ge() {
1027 return 1 1268 return 1
1028 fi 1269 fi
1029 fi 1270 fi
1030} 1271}
1031 1272
1273java-pkg_set-current-vm() {
1274 export GENTOO_VM=${1}
1275}
1276
1277java-pkg_get-current-vm() {
1278 echo ${GENTOO_VM}
1279}
1280
1281java-pkg_current-vm-matches() {
1282 hasq $(java-pkg_get-current-vm) ${@}
1283 return $?
1284}
1285
1032# ------------------------------------------------------------------------------ 1286# ------------------------------------------------------------------------------
1033# @ebuild-function java-pkg_get-source 1287# @ebuild-function java-pkg_get-source
1034# 1288#
1035# Determines what source version should be used, for passing to -source. 1289# Determines what source version should be used, for passing to -source.
1036# Unless you want to break things you probably shouldn't set _WANT_SOURCE 1290# Unless you want to break things you probably shouldn't set _WANT_SOURCE
1037# 1291#
1038# @return string - Either the lowest possible source, or JAVA_PKG_WANT_SOURCE 1292# @return string - Either the lowest possible source, or JAVA_PKG_WANT_SOURCE
1039# ------------------------------------------------------------------------------ 1293# ------------------------------------------------------------------------------
1044# ------------------------------------------------------------------------------ 1298# ------------------------------------------------------------------------------
1045# @ebuild-function java-pkg_get-target 1299# @ebuild-function java-pkg_get-target
1046# 1300#
1047# Determines what target version should be used, for passing to -target. 1301# Determines what target version should be used, for passing to -target.
1048# If you don't care about lower versions, you can set _WANT_TARGET to the 1302# If you don't care about lower versions, you can set _WANT_TARGET to the
1049# version of your JDK. 1303# version of your JDK.
1050# Remember doing this will mostly like cause things to break.
1051# Doesn't allow it to be lower then the one in depend.
1052# Doesn't allow it to be higher then the active vm.
1053# 1304#
1054# @return string - Either the lowest possible target, or JAVA_PKG_WANT_TARGET 1305# @return string - Either the lowest possible target, or JAVA_PKG_WANT_TARGET
1055# ------------------------------------------------------------------------------ 1306# ------------------------------------------------------------------------------
1056java-pkg_get-target() { 1307java-pkg_get-target() {
1057 local min=$(depend-java-query --get-lowest "${DEPEND} ${RDEPEND}")
1058 if [[ -n "${JAVA_PKG_WANT_TARGET}" ]]; then
1059 local max="$(java-config --select-vm "${GENTOO_VM}" -g PROVIDES_VERSION)"
1060 if version_is_at_least "${min}" "${JAVA_PKG_WANT_TARGET}" && version_is_at_least "${JAVA_PKG_WANT_TARGET}" "${max}"; then
1061 echo ${JAVA_PKG_WANT_TARGET}
1062 else
1063 echo ${min}
1064 fi
1065 else
1066 echo ${min}
1067 fi
1068
1069 #echo ${JAVA_PKG_WANT_TARGET:-$(depend-java-query --get-lowest "${DEPEND}")} 1308 echo ${JAVA_PKG_WANT_TARGET:-$(depend-java-query --get-lowest "${DEPEND} ${RDEPEND}")}
1070} 1309}
1071 1310
1072java-pkg_get-javac() { 1311java-pkg_get-javac() {
1073 debug-print-function ${FUNCNAME} $* 1312 debug-print-function ${FUNCNAME} $*
1074 1313
1075 java-pkg_init-compiler_ 1314
1076 local compiler="${GENTOO_COMPILER}" 1315 local compiler="${GENTOO_COMPILER}"
1077 1316
1078 local compiler_executable 1317 local compiler_executable
1079 if [[ "${compiler}" = "javac" ]]; then 1318 if [[ "${compiler}" = "javac" ]]; then
1080 # nothing fancy needs to be done for javac 1319 # nothing fancy needs to be done for javac
1088 unset JAVAC 1327 unset JAVAC
1089 # try to get value of JAVAC 1328 # try to get value of JAVAC
1090 compiler_executable="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${JAVAC})" 1329 compiler_executable="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${JAVAC})"
1091 export JAVAC=${old_javac} 1330 export JAVAC=${old_javac}
1092 1331
1093 [[ -z ${compiler_executable} ]] && die "JAVAC is empty or undefined in ${compiler_env}" 1332 if [[ -z ${compiler_executable} ]]; then
1094 1333 echo "JAVAC is empty or undefined in ${compiler_env}"
1334 return 1
1335 fi
1336
1095 # check that it's executable 1337 # check that it's executable
1096 if [[ ! -x ${compiler_executable} ]]; then 1338 if [[ ! -x ${compiler_executable} ]]; then
1097 eerror "Could not find ${compiler_executable}!"
1098 die "${compiler_executable} doesn't exist, or isn't executable" 1339 echo "${compiler_executable} doesn't exist, or isn't executable"
1340 return 1
1099 fi 1341 fi
1100 else 1342 else
1101 eerror "Could not find environment file for ${compiler}" 1343 echo "Could not find environment file for ${compiler}"
1102 die "Could not find ${compiler_env}" 1344 return 1
1103 fi 1345 fi
1104 fi 1346 fi
1105 echo ${compiler_executable} 1347 echo ${compiler_executable}
1106} 1348}
1107 1349
1108# ------------------------------------------------------------------------------ 1350# ------------------------------------------------------------------------------
1109# @ebuild-function java-pkg_javac-args 1351# @ebuild-function java-pkg_javac-args
1110# 1352#
1111# If an ebuild uses javac directly, instead of using ejavac, it should call this 1353# If an ebuild uses javac directly, instead of using ejavac, it should call this
1112# to know what -source/-target to use. 1354# to know what -source/-target to use.
1113# 1355#
1114# @return string - arguments to pass to javac, complete with -target and -source 1356# @return string - arguments to pass to javac, complete with -target and -source
1117 debug-print-function ${FUNCNAME} $* 1359 debug-print-function ${FUNCNAME} $*
1118 1360
1119 local want_source="$(java-pkg_get-source)" 1361 local want_source="$(java-pkg_get-source)"
1120 local want_target="$(java-pkg_get-target)" 1362 local want_target="$(java-pkg_get-target)"
1121 1363
1122 local source_str="-source ${want_source}" 1364 local source_str="-source ${want_source}"
1123 local target_str="-target ${want_target}" 1365 local target_str="-target ${want_target}"
1124 1366
1125 debug-print "want source: ${want_source}" 1367 debug-print "want source: ${want_source}"
1126 debug-print "want target: ${want_target}" 1368 debug-print "want target: ${want_target}"
1127 1369
1128 if [[ -z "${want_source}" || -z "${want_target}" ]]; then 1370 if [[ -z "${want_source}" || -z "${want_target}" ]]; then
1129 debug-print "could not find valid -source/-target values" 1371 debug-print "could not find valid -source/-target values for javac"
1130 die "Could not find valid -source/-target values" 1372 echo "Could not find valid -source/-target values for javac"
1373 return 1
1131 else 1374 else
1132 if java-pkg_is-vm-version-ge "1.4"; then 1375 if java-pkg_is-vm-version-ge "1.4"; then
1133 echo "${source_str} ${target_str}" 1376 echo "${source_str} ${target_str}"
1134 else 1377 else
1135 echo "${target_str}" 1378 echo "${target_str}"
1139 1382
1140# TODO document 1383# TODO document
1141java-pkg_get-jni-cflags() { 1384java-pkg_get-jni-cflags() {
1142 local flags="-I${JAVA_HOME}/include" 1385 local flags="-I${JAVA_HOME}/include"
1143 1386
1144 # TODO figure out how to cope with other things than linux... 1387 local platform="linux"
1388 use elibc_FreeBSD && platform="freebsd"
1389
1390 # TODO do a check that the directories are valid
1145 flags="${flags} -I${JAVA_HOME}/include/linux" 1391 flags="${flags} -I${JAVA_HOME}/include/${platform}"
1146 1392
1147 echo ${flags} 1393 echo ${flags}
1394}
1395
1396java-pkg_ensure-gcj() {
1397 if ! built_with_use sys-devel/gcc gcj ; then
1398 ewarn
1399 ewarn "You must build gcc with the gcj support to build with gcj"
1400 ewarn
1401 ebeep 5
1402 die "No GCJ support found!"
1403 fi
1404}
1405
1406java-pkg_ensure-test() {
1407 if hasq test ${FEATURES} && ! hasq -test ${FEATURES} \
1408 && hasq test ${IUSE} && ! use test;
1409 then
1410 eerror "You specified FEATURES=test, but USE=test is needed"
1411 eerror "to pull in the additional dependencies for testing"
1412 die "Need USE=test enabled"
1413 fi
1414}
1415
1416# ------------------------------------------------------------------------------
1417# @ebuild-function java-pkg_register-ant-task
1418#
1419# Register this package as ant task, so that ant will load it when no specific
1420# ANT_TASKS are specified. Note that even without this registering, all packages
1421# specified in ANT_TASKS will be loaded. Mostly used by the actual ant tasks
1422# packages, but can be also used by other ebuilds that used to symlink their
1423# .jar into /usr/share/ant-core/lib to get autoloaded, for backwards
1424# compatibility.
1425#
1426# @param --version x.y Register only for ant version x.y (otherwise for any ant
1427# version). Used by the ant-* packages to prevent loading of mismatched
1428# ant-core ant tasks after core was updated, before the tasks are updated,
1429# without a need for blockers.
1430# @param $1 Name to register as. Defaults to JAVA_PKG_NAME ($PN[-$SLOT])
1431# ------------------------------------------------------------------------------
1432java-pkg_register-ant-task() {
1433 local TASKS_DIR="tasks"
1434
1435 # check for --version x.y parameters
1436 while [[ -n "${1}" && -n "${2}" ]]; do
1437 local var="${1#--}"
1438 local val="${2}"
1439 if [[ "${var}" == "version" ]]; then
1440 TASKS_DIR="tasks-${val}"
1441 else
1442 die "Unknown parameter passed to java-pkg_register-ant-tasks: ${1} ${2}"
1443 fi
1444 shift 2
1445 done
1446
1447 local TASK_NAME="${1:-${JAVA_PKG_NAME}}"
1448
1449 dodir /usr/share/ant/${TASKS_DIR}
1450 touch "${D}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}"
1451}
1452
1453# ------------------------------------------------------------------------------
1454# @internal-function java-pkg_ant-tasks-from-deps
1455#
1456# Function to determine ANT_TASKS from DEPEND variable for backwards
1457# compatibility with ebuilds that don't set ANT_TASKS before calling eant() or
1458# WANT_ANT_TASKS before inheriting java-pkg-2. If the DEPEND string contains
1459# "dev-java/ant" or "dev-java/ant-tasks", then it returns "all", otherwise
1460# "none". It's not smart enough to cope with USE flag depends but that shouldn't
1461# be a problem, the worst it can do is activace all tasks when not needed.
1462# Note that this is called only with JAVA_PKG_STRICT=1, to find ebuilds with
1463# insufficient dependencies, otherwise all available tasks are used for
1464# backwards compatilbility.
1465#
1466# @return "all" or "none"
1467# ------------------------------------------------------------------------------
1468java-pkg_ant-tasks-from-deps() {
1469 local found_ant found_ant_tasks
1470
1471 for dep in ${DEPEND}
1472 do
1473 local ant="$(awk '/(dev-java\/ant)/ { if (match($1, "(dev-java/ant)((-[0-9])+|$)", m)) print m[1] }' <<< ${dep})"
1474 [[ "${ant}" == "dev-java/ant" ]] && found_ant=true
1475 [[ "${dep}" == *"ant-tasks"* ]] && found_ant_tasks=true
1476 done
1477
1478 if [[ -n "${found_ant}" || -n "${found_ant_tasks}" ]]; then
1479 java-pkg_announce-qa-violation "The ebuild DEPENDS on deprecated ant or ant-tasks"
1480 echo "all"
1481 else
1482 # ebuild doesn't set ANT_TASKS and doesn't depend on ant-tasks or ant
1483 # so we deactivate all tasks that may be installed
1484 echo "none"
1485 fi
1486}
1487
1488# ------------------------------------------------------------------------------
1489# @internal-function java-pkg_ant-tasks-depend
1490#
1491# Translates the WANT_ANT_TASKS variable into valid dependencies.
1492# ------------------------------------------------------------------------------
1493java-pkg_ant-tasks-depend() {
1494 debug-print-function ${FUNCNAME} ${WANT_ANT_TASKS}
1495
1496 if [[ -n "${WANT_ANT_TASKS}" ]]; then
1497 local DEP=""
1498 for i in ${WANT_ANT_TASKS}
1499 do
1500 if [[ ${i} != ant-* ]]; then
1501 echo "Invalid atom in WANT_ANT_TASKS: ${i}"
1502 return 1
1503 fi
1504 DEP="${DEP}dev-java/${i} "
1505 done
1506 echo ${DEP}
1507 return 0
1508 else
1509 return 0
1510 fi
1148} 1511}
1149 1512
1150# ------------------------------------------------------------------------------ 1513# ------------------------------------------------------------------------------
1151# @section-end helper 1514# @section-end helper
1152# ------------------------------------------------------------------------------ 1515# ------------------------------------------------------------------------------
1161 1524
1162# ------------------------------------------------------------------------------ 1525# ------------------------------------------------------------------------------
1163# @ebuild-function eant 1526# @ebuild-function eant
1164# 1527#
1165# Ant wrapper function. Will use the appropriate compiler, based on user-defined 1528# Ant wrapper function. Will use the appropriate compiler, based on user-defined
1166# compiler. 1529# compiler. Will also set proper ANT_TASKS from the variable ANT_TASKS,
1167# 1530# variables:
1531# EANT_GENTOO_CLASSPATH - calls java-pkg_getjars for the value and adds to the
1532# gentoo.classpath property. Be sure to call
1533# java-ant_rewrite-classpath in src_unpack.
1534# *ANT_TASKS - used to determine ANT_TASKS before calling Ant.
1168# ------------------------------------------------------------------------------ 1535# ------------------------------------------------------------------------------
1169eant() { 1536eant() {
1170 debug-print-function ${FUNCNAME} $* 1537 debug-print-function ${FUNCNAME} $*
1171 1538
1172 local antflags 1539 # FIXME get this working
1540# if is-java-strict && [[ ! ${DEPEND} =~ "dev-java/ant" ]]; then
1541# java-pkg_announce-qa-violation \
1542# "Using eant, but not depending on dev-java/ant or dev-java/ant-core"
1543# fi
1544
1545 if ! hasq java-ant-2 ${INHERITED} && is-java-strict; then
1546 local msg="You should inherit java-ant-2 when using eant"
1547 java-pkg_announce-qa-violation ${msg}
1548 die ${msg}
1549 fi
1550
1551 local antflags="-Dnoget=true -Dmaven.mode.offline=true"
1173 java-pkg_init-compiler_ 1552 java-pkg_init-compiler_
1174 local compiler="${GENTOO_COMPILER}" 1553 local compiler="${GENTOO_COMPILER}"
1175 1554
1176 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}" 1555 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}"
1177 1556
1179 if [[ "${compiler}" != "javac" && -z "${build_compiler}" ]]; then 1558 if [[ "${compiler}" != "javac" && -z "${build_compiler}" ]]; then
1180 die "ANT_BUILD_COMPILER undefined in ${compiler_env}" 1559 die "ANT_BUILD_COMPILER undefined in ${compiler_env}"
1181 fi 1560 fi
1182 1561
1183 if [[ ${compiler} != "javac" ]]; then 1562 if [[ ${compiler} != "javac" ]]; then
1184 antflags="-Dbuild.compiler=${build_compiler}" 1563 antflags="${antflags} -Dbuild.compiler=${build_compiler}"
1185 # Figure out any extra stuff to put on the classpath for compilers aside 1564 # Figure out any extra stuff to put on the classpath for compilers aside
1186 # from javac 1565 # from javac
1187 # ANT_BUILD_COMPILER_DEPS should be something that could be passed to 1566 # ANT_BUILD_COMPILER_DEPS should be something that could be passed to
1188 # java-config -p 1567 # java-config -p
1189 local build_compiler_deps="$(source ${JAVA_PKG_COMPILER_DIR}/${compiler} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER_DEPS})" 1568 local build_compiler_deps="$(source ${JAVA_PKG_COMPILER_DIR}/${compiler} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER_DEPS})"
1190 if [[ -n ${build_compiler_deps} ]]; then 1569 if [[ -n ${build_compiler_deps} ]]; then
1191 antflags="${antflags} -lib $(java-config -p ${build_compiler_deps})" 1570 antflags="${antflags} -lib $(java-config -p ${build_compiler_deps})"
1192 fi 1571 fi
1193 fi 1572 fi
1194 1573
1195 if [[ -n ${JAVA_PKG_DEBUG} ]]; then 1574 if is-java-strict; then
1196 antflags="${antflags} -debug" 1575 einfo "Disabling system classpath for ant"
1576 antflags="${antflags} -Dbuild.sysclasspath=ignore"
1577 fi
1578
1579 for arg in "${@}"; do
1580 if [[ ${arg} = -lib ]]; then
1581 if is-java-strict; then
1582 eerror "You should not use the -lib argument to eant because it will fail"
1583 eerror "with JAVA_PKG_STRICT. Please use for example java-pkg_jar-from"
1584 eerror "or ant properties to make dependencies available."
1585 eerror "For ant tasks use WANT_ANT_TASKS or ANT_TASKS from."
1586 eerror "split ant (>=dev-java/ant-core-1.7)."
1587 die "eant -lib is deprecated/forbidden"
1588 else
1589 echo "eant -lib is deprecated. Turn JAVA_PKG_STRICT on for"
1590 echo "more info."
1591 fi
1197 fi 1592 fi
1198 1593 done
1594
1595 if has_version ">=dev-java/ant-core-1.7.0"; then
1596 # default ANT_TASKS to WANT_ANT_TASKS, if ANT_TASKS is not set explicitly
1597 ANT_TASKS="${ANT_TASKS:-${WANT_ANT_TASKS}}"
1598
1599 # override ANT_TASKS with JAVA_PKG_FORCE_ANT_TASKS if it's set
1600 ANT_TASKS="${JAVA_PKG_FORCE_ANT_TASKS:-${ANT_TASKS}}"
1601
1602 if is-java-strict; then
1603 # if ant-tasks were not set by ebuild or forced, try to determine them from depends
1604 if [[ -z "${ANT_TASKS}" ]]; then
1605 ANT_TASKS="$(java-pkg_ant-tasks-from-deps)"
1606 fi
1607 else
1608 # if ant-tasks is not set by ebuild or forced, activate all of them
1609 ANT_TASKS="${ANT_TASKS:-all}"
1610 fi
1611
1612 # at this point, ANT_TASKS should be "all", "none" or explicit list
1613 if [[ "${ANT_TASKS}" == "all" ]]; then
1614 einfo "Using all available ANT_TASKS"
1615 elif [[ "${ANT_TASKS}" == "none" ]]; then
1616 einfo "Disabling all optional ANT_TASKS"
1617 else
1618 einfo "Using following ANT_TASKS: ${ANT_TASKS}"
1619 fi
1620
1621 export ANT_TASKS
1622 fi
1623
1624 [[ -n ${JAVA_PKG_DEBUG} ]] && antflags="${antflags} --execdebug -debug"
1625 [[ -n ${PORTAGE_QUIET} ]] && antflags="${antflags} -q"
1626
1627 local gcp="${EANT_GENTOO_CLASSPATH}"
1628
1629 if [[ "${gcp}" ]]; then
1630 local cp="$(java-pkg_getjars ${gcp})"
1631 # It seems ant does not like single quotes around ${cp}
1632 antflags="${antflags} -Dgentoo.classpath=\"${cp}\""
1633 fi
1634
1199 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ant ${antflags} "${@}" 1635 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ant ${antflags} "${@}"
1636 debug-print "Calling ant: ${antflags} ${@}"
1200 ant ${antflags} "${@}" || die "eant failed" 1637 ant ${antflags} "${@}" || die "eant failed"
1201 1638
1202} 1639}
1203 1640
1204# ------------------------------------------------------------------------------ 1641# ------------------------------------------------------------------------------
1205# @ebuild-function ejavac 1642# @ebuild-function ejavac
1206# 1643#
1207# Javac wrapper function. Will use the appropriate compiler, based on 1644# Javac wrapper function. Will use the appropriate compiler, based on
1208# /etc/java-config/compilers.conf 1645# /etc/java-config/compilers.conf
1209# 1646#
1210# @param $@ - Arguments to be passed to the compiler 1647# @param $@ - Arguments to be passed to the compiler
1211# ------------------------------------------------------------------------------ 1648# ------------------------------------------------------------------------------
1212ejavac() { 1649ejavac() {
1213 debug-print-function ${FUNCNAME} $* 1650 debug-print-function ${FUNCNAME} $*
1214 1651
1652 java-pkg_init-compiler_
1653
1654 local compiler_executable
1215 local compiler_executable=$(java-pkg_get-javac) 1655 compiler_executable=$(java-pkg_get-javac)
1656 if [[ ${?} != 0 ]]; then
1657 eerror "There was a problem determining compiler: ${compiler_executable}"
1658 die "get-javac failed"
1659 fi
1216 1660
1661 local javac_args
1662 javac_args="$(java-pkg_javac-args)"
1663 if [[ ${?} != 0 ]]; then
1664 eerror "There was a problem determining JAVACFLAGS: ${javac_args}"
1665 die "java-pkg_javac-args failed"
1666 fi
1667
1217 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} $(java-pkg_javac-args) "${@}" 1668 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} ${javac_args} "${@}"
1218 ${compiler_executable} $(java-pkg_javac-args) "${@}" || die "ejavac failed" 1669 ${compiler_executable} ${javac_args} "${@}" || die "ejavac failed"
1219} 1670}
1220 1671
1221# ------------------------------------------------------------------------------ 1672# ------------------------------------------------------------------------------
1222# @ebuild-function java-pkg_filter-compiler 1673# @ebuild-function java-pkg_filter-compiler
1223# 1674#
1224# Used to prevent the use of some compilers. Should be used in src_compile. 1675# Used to prevent the use of some compilers. Should be used in src_compile.
1225# Basically, it just appends onto JAVA_PKG_FILTER_COMPILER 1676# Basically, it just appends onto JAVA_PKG_FILTER_COMPILER
1226# 1677#
1227# @param $@ - compilers to filter 1678# @param $@ - compilers to filter
1228# ------------------------------------------------------------------------------ 1679# ------------------------------------------------------------------------------
1229java-pkg_filter-compiler() { 1680java-pkg_filter-compiler() {
1230 JAVA_PKG_FILTER_COMPILER="${JAVA_PKG_FILTER_COMPILER} $@" 1681 JAVA_PKG_FILTER_COMPILER="${JAVA_PKG_FILTER_COMPILER} $@"
1231} 1682}
1232 1683
1233# ------------------------------------------------------------------------------ 1684# ------------------------------------------------------------------------------
1685# @ebuild-function java-pkg_force-compiler
1686#
1687# Used to force the use of particular compilers. Should be used in src_compile.
1688# A common use of this would be to force ecj-3.1 to be used on amd64, to avoid
1689# OutOfMemoryErrors that may come up.
1690#
1691# @param $@ - compilers to force
1692# ------------------------------------------------------------------------------
1693java-pkg_force-compiler() {
1694 JAVA_PKG_FORCE_COMPILER="$@"
1695}
1696
1697# ------------------------------------------------------------------------------
1234# @ebuild-function use_doc 1698# @ebuild-function use_doc
1235# 1699#
1236# Helper function for getting ant to build javadocs. If the user has USE=doc, 1700# Helper function for getting ant to build javadocs. If the user has USE=doc,
1237# then 'javadoc' or the argument are returned. Otherwise, there is no return. 1701# then 'javadoc' or the argument are returned. Otherwise, there is no return.
1238# 1702#
1239# The output of this should be passed to ant. 1703# The output of this should be passed to ant.
1240# 1704#
1241# Example: build javadocs by calling 'javadoc' target 1705# Example: build javadocs by calling 'javadoc' target
1242# eant $(use_doc) 1706# eant $(use_doc)
1243# Example: build javadocs by calling 'apidoc' target 1707# Example: build javadocs by calling 'apidoc' target
1248# ------------------------------------------------------------------------------ 1712# ------------------------------------------------------------------------------
1249use_doc() { 1713use_doc() {
1250 use doc && echo ${@:-javadoc} 1714 use doc && echo ${@:-javadoc}
1251} 1715}
1252 1716
1717
1253# ------------------------------------------------------------------------------ 1718# ------------------------------------------------------------------------------
1254# @section-end build 1719# @section-end build
1255# ------------------------------------------------------------------------------ 1720# ------------------------------------------------------------------------------
1256 1721
1257# ------------------------------------------------------------------------------ 1722# ------------------------------------------------------------------------------
1258# @section-begin internal 1723# @section-begin internal
1259# @section-summary Internal functions 1724# @section-summary Internal functions
1260# 1725#
1261# Do __NOT__ use any of these from an ebuild! These are only to be used from 1726# Do __NOT__ use any of these from an ebuild! These are only to be used from
1262# within the java eclasses. 1727# within the java eclasses.
1263# ------------------------------------------------------------------------------ 1728# ------------------------------------------------------------------------------
1264 1729
1265# ----------------------------------------------------------------------------- 1730# -----------------------------------------------------------------------------
1266# @function-internal java-pkg_init 1731# @function-internal java-pkg_init
1267# 1732#
1268# The purpose of this function, as the name might imply, is to initialize the 1733# The purpose of this function, as the name might imply, is to initialize the
1269# Java environment. It ensures that that there aren't any environment variables 1734# Java environment. It ensures that that there aren't any environment variables
1270# that'll muss things up. It initializes some variables, which are used 1735# that'll muss things up. It initializes some variables, which are used
1271# internally. And most importantly, it'll switch the VM if necessary. 1736# internally. And most importantly, it'll switch the VM if necessary.
1272# 1737#
1284 # TODO we will probably want to set JAVAC and JAVACFLAGS 1749 # TODO we will probably want to set JAVAC and JAVACFLAGS
1285 1750
1286 # Do some QA checks 1751 # Do some QA checks
1287 java-pkg_check-jikes 1752 java-pkg_check-jikes
1288 1753
1289 # When users have crazy classpaths some packages can fail to compile. 1754 # When users have crazy classpaths some packages can fail to compile.
1290 # and everything should work with empty CLASSPATH. 1755 # and everything should work with empty CLASSPATH.
1291 # This also helps prevent unexpected dependencies on random things 1756 # This also helps prevent unexpected dependencies on random things
1292 # from the CLASSPATH. 1757 # from the CLASSPATH.
1293 unset CLASSPATH 1758 unset CLASSPATH
1759
1760 # Unset external ANT_ stuff
1761 unset ANT_TASKS
1762 unset ANT_OPTS
1294} 1763}
1295 1764
1296# ------------------------------------------------------------------------------ 1765# ------------------------------------------------------------------------------
1297# @function-internal java-pkg-init-compiler_ 1766# @function-internal java-pkg-init-compiler_
1298# 1767#
1299# This function attempts to figure out what compiler should be used. It does 1768# This function attempts to figure out what compiler should be used. It does
1300# this by reading the file at JAVA_PKG_COMPILERS_CONF, and checking the 1769# this by reading the file at JAVA_PKG_COMPILERS_CONF, and checking the
1301# COMPILERS variable defined there. 1770# COMPILERS variable defined there.
1302# This can be overridden by a list in JAVA_PKG_FORCE_COMPILER 1771# This can be overridden by a list in JAVA_PKG_FORCE_COMPILER
1303# 1772#
1304# It will go through the list of compilers, and verify that it supports the 1773# It will go through the list of compilers, and verify that it supports the
1305# target and source that are needed. If it is not suitable, then the next 1774# target and source that are needed. If it is not suitable, then the next
1306# compiler is checked. When JAVA_PKG_FORCE_COMPILER is defined, this checking 1775# compiler is checked. When JAVA_PKG_FORCE_COMPILER is defined, this checking
1307# isn't done. 1776# isn't done.
1308# 1777#
1324 if [[ -n ${GENTOO_COMPILER} ]]; then 1793 if [[ -n ${GENTOO_COMPILER} ]]; then
1325 debug-print "GENTOO_COMPILER already set" 1794 debug-print "GENTOO_COMPILER already set"
1326 return 1795 return
1327 fi 1796 fi
1328 1797
1798 local compilers;
1799 if [[ -z ${JAVA_PKG_FORCE_COMPILER} ]]; then
1329 local compilers="$(source ${JAVA_PKG_COMPILERS_CONF} 1>/dev/null 2>&1; echo ${COMPILERS})" 1800 compilers="$(source ${JAVA_PKG_COMPILERS_CONF} 1>/dev/null 2>&1; echo ${COMPILERS})"
1801 else
1802 compilers=${JAVA_PKG_FORCE_COMPILER}
1803 fi
1804
1330 debug-print "Read \"${compilers}\" from ${JAVA_PKG_COMPILERS_CONF}" 1805 debug-print "Read \"${compilers}\" from ${JAVA_PKG_COMPILERS_CONF}"
1331 1806
1332 # Figure out if we should announce what compiler we're using 1807 # Figure out if we should announce what compiler we're using
1333 local compiler 1808 local compiler
1334 for compiler in ${compilers}; do 1809 for compiler in ${compilers}; do
1337 if [[ ${compiler} = "javac" ]]; then 1812 if [[ ${compiler} = "javac" ]]; then
1338 debug-print "Found javac... breaking" 1813 debug-print "Found javac... breaking"
1339 export GENTOO_COMPILER="javac" 1814 export GENTOO_COMPILER="javac"
1340 break 1815 break
1341 fi 1816 fi
1342 1817
1343 if has ${compiler} ${JAVA_PKG_FILTER_COMPILER}; then 1818 if has ${compiler} ${JAVA_PKG_FILTER_COMPILER}; then
1344 if [[ -z ${JAVA_PKG_FORCE_COMPILER} ]]; then 1819 if [[ -z ${JAVA_PKG_FORCE_COMPILER} ]]; then
1345 einfo "Filtering ${compiler}" 1820 einfo "Filtering ${compiler}"
1346 continue 1821 continue
1347 fi 1822 fi
1348 fi 1823 fi
1349 1824
1350 # for non-javac, we need to make sure it supports the right target and 1825 # for non-javac, we need to make sure it supports the right target and
1351 # source 1826 # source
1352 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}" 1827 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}"
1353 if [[ -f ${compiler_env} ]]; then 1828 if [[ -f ${compiler_env} ]]; then
1354 local desired_target="$(java-pkg_get-target)" 1829 local desired_target="$(java-pkg_get-target)"
1436# Writes the package.env out to disk. 1911# Writes the package.env out to disk.
1437# 1912#
1438# ------------------------------------------------------------------------------ 1913# ------------------------------------------------------------------------------
1439# TODO change to do-write, to match everything else 1914# TODO change to do-write, to match everything else
1440java-pkg_do_write_() { 1915java-pkg_do_write_() {
1916 java-pkg_init_paths_
1441 # Create directory for package.env 1917 # Create directory for package.env
1442 dodir "${JAVA_PKG_SHAREPATH}" 1918 dodir "${JAVA_PKG_SHAREPATH}"
1443 if [[ -n "${JAVA_PKG_CLASSPATH}" || -n "${JAVA_PKG_LIBRARY}" || -f "${JAVA_PKG_DEPEND}" ]]; then 1919 if [[ -n "${JAVA_PKG_CLASSPATH}" || -n "${JAVA_PKG_LIBRARY}" || -f "${JAVA_PKG_DEPEND}" ]]; then
1444 # Create package.env 1920 # Create package.env
1445 ( 1921 (
1450 [[ -n "${JAVA_PKG_LIBRARY}" ]] && echo "LIBRARY_PATH=\"${JAVA_PKG_LIBRARY}\"" 1926 [[ -n "${JAVA_PKG_LIBRARY}" ]] && echo "LIBRARY_PATH=\"${JAVA_PKG_LIBRARY}\""
1451 [[ -n "${JAVA_PROVIDE}" ]] && echo "PROVIDES=\"${JAVA_PROVIDE}\"" 1927 [[ -n "${JAVA_PROVIDE}" ]] && echo "PROVIDES=\"${JAVA_PROVIDE}\""
1452 [[ -f "${JAVA_PKG_DEPEND}" ]] && echo "DEPEND=\"$(cat ${JAVA_PKG_DEPEND} | uniq | tr '\n' ':')\"" 1928 [[ -f "${JAVA_PKG_DEPEND}" ]] && echo "DEPEND=\"$(cat ${JAVA_PKG_DEPEND} | uniq | tr '\n' ':')\""
1453 echo "VM=\"$(echo ${RDEPEND} ${DEPEND} | sed -e 's/ /\n/g' | sed -n -e '/virtual\/\(jre\|jdk\)/ { p;q }')\"" # TODO cleanup ! 1929 echo "VM=\"$(echo ${RDEPEND} ${DEPEND} | sed -e 's/ /\n/g' | sed -n -e '/virtual\/\(jre\|jdk\)/ { p;q }')\"" # TODO cleanup !
1454 ) > "${JAVA_PKG_ENV}" 1930 ) > "${JAVA_PKG_ENV}"
1455 1931
1456 # register target/source 1932 # register target/source
1457 local target="$(java-pkg_get-target)" 1933 local target="$(java-pkg_get-target)"
1458 local source="$(java-pkg_get-source)" 1934 local source="$(java-pkg_get-source)"
1459 [[ -n ${target} ]] && echo "TARGET=\"${target}\"" >> "${JAVA_PKG_ENV}" 1935 [[ -n ${target} ]] && echo "TARGET=\"${target}\"" >> "${JAVA_PKG_ENV}"
1460 [[ -n ${source} ]] && echo "SOURCE=\"${source}\"" >> "${JAVA_PKG_ENV}" 1936 [[ -n ${source} ]] && echo "SOURCE=\"${source}\"" >> "${JAVA_PKG_ENV}"
1473 # Strip unnecessary leading and trailing colons 1949 # Strip unnecessary leading and trailing colons
1474 # TODO try to cleanup if possible 1950 # TODO try to cleanup if possible
1475 sed -e "s/=\":/=\"/" -e "s/:\"$/\"/" -i "${JAVA_PKG_ENV}" || die "Did you forget to call java_init ?" 1951 sed -e "s/=\":/=\"/" -e "s/:\"$/\"/" -i "${JAVA_PKG_ENV}" || die "Did you forget to call java_init ?"
1476 fi 1952 fi
1477} 1953}
1478
1479 1954
1480# ------------------------------------------------------------------------------ 1955# ------------------------------------------------------------------------------
1481# @internal-function java-pkg_record-jar_ 1956# @internal-function java-pkg_record-jar_
1482# 1957#
1483# Record a dependency to the package.env 1958# Record a dependency to the package.env
1527 fi 2002 fi
1528} 2003}
1529 2004
1530# ------------------------------------------------------------------------------ 2005# ------------------------------------------------------------------------------
1531# @internal-function java-pkg_expand_dir_ 2006# @internal-function java-pkg_expand_dir_
1532# 2007#
1533# Gets the full path of the file/directory's parent. 2008# Gets the full path of the file/directory's parent.
1534# @param $1 - file/directory to find parent directory for 2009# @param $1 - file/directory to find parent directory for
1535# @return - path to $1's parent directory 2010# @return - path to $1's parent directory
1536# ------------------------------------------------------------------------------ 2011# ------------------------------------------------------------------------------
1537java-pkg_expand_dir_() { 2012java-pkg_expand_dir_() {
1564# ------------------------------------------------------------------------------ 2039# ------------------------------------------------------------------------------
1565java-pkg_setup-vm() { 2040java-pkg_setup-vm() {
1566 debug-print-function ${FUNCNAME} $* 2041 debug-print-function ${FUNCNAME} $*
1567 2042
1568 local vendor="$(java-pkg_get-vm-vendor)" 2043 local vendor="$(java-pkg_get-vm-vendor)"
1569 if [[ "${vendor}" == "sun" ]] && java-pkg_is-vm-version-ge 1 5; then 2044 if [[ "${vendor}" == "sun" ]] && java-pkg_is-vm-version-ge "1.5" ; then
1570 addpredict "/dev/random" 2045 addpredict "/dev/random"
1571 elif [[ "${vendor}" == "ibm" ]]; then 2046 elif [[ "${vendor}" == "ibm" ]]; then
1572 addpredict "/proc/self/maps" 2047 addpredict "/proc/self/maps"
1573 addpredict "/proc/cpuinfo" 2048 addpredict "/proc/cpuinfo"
1574 export LANG="C" LC_ALL="C" 2049 export LANG="C" LC_ALL="C"
1623# @return - The version of the current VM 2098# @return - The version of the current VM
1624# ------------------------------------------------------------------------------ 2099# ------------------------------------------------------------------------------
1625java-pkg_get-vm-version() { 2100java-pkg_get-vm-version() {
1626 debug-print-function ${FUNCNAME} $* 2101 debug-print-function ${FUNCNAME} $*
1627 2102
1628 java-pkg_get-current-vm | sed -e "s/.*-\([0-9.]\+\).*/\1/" 2103 java-config -g PROVIDES_VERSION
1629} 2104}
1630 2105
1631# ------------------------------------------------------------------------------ 2106# ------------------------------------------------------------------------------
1632# @internal-function java-pkg_switch-vm 2107# @internal-function java-pkg_switch-vm
1633# 2108#
1634# Switch VM if we're allowed to (controlled by JAVA_PKG_ALLOW_VM_CHANGE), and 2109# Switch VM if we're allowed to (controlled by JAVA_PKG_ALLOW_VM_CHANGE), and
1635# verify that the current VM is sufficient. 2110# verify that the current VM is sufficient.
1636# Setup the environment for the VM being used. 2111# Setup the environment for the VM being used.
1637# ------------------------------------------------------------------------------ 2112# ------------------------------------------------------------------------------
1638java-pkg_switch-vm() { 2113java-pkg_switch-vm() {
2114 debug-print-function ${FUNCNAME} $*
2115
1639 if java-pkg_needs-vm; then 2116 if java-pkg_needs-vm; then
1640 # Use the VM specified by JAVA_PKG_FORCE_VM 2117 # Use the VM specified by JAVA_PKG_FORCE_VM
1641 if [[ -n ${JAVA_PKG_FORCE_VM} ]]; then 2118 if [[ -n "${JAVA_PKG_FORCE_VM}" ]]; then
1642 # If you're forcing the VM, I hope you know what your doing... 2119 # If you're forcing the VM, I hope you know what your doing...
2120 debug-print "JAVA_PKG_FORCE_VM used: ${JAVA_PKG_FORCE_VM}"
1643 export GENTOO_VM="${JAVA_PKG_FORCE_VM}" 2121 export GENTOO_VM="${JAVA_PKG_FORCE_VM}"
1644 # if we're allowed to switch the vm... 2122 # if we're allowed to switch the vm...
1645 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then 2123 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then
1646 debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}" 2124 debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}"
1647 if [[ -n ${JAVA_PKG_VNEED} ]]; then 2125 if [[ -n ${JAVA_PKG_VNEED} ]]; then
1648 export GENTOO_VM="$(depend-java-query --need-virtual "${JAVA_PKG_VNEED}" --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")" 2126 GENTOO_VM="$(depend-java-query --need-virtual "${JAVA_PKG_VNEED}" --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")"
1649 else 2127 else
1650 export GENTOO_VM="$(depend-java-query --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")" 2128 GENTOO_VM="$(depend-java-query --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")"
2129 fi
2130 if [[ -z "${GENTOO_VM}" || "${GENTOO_VM}" == "None" ]]; then
2131 eerror "Unable to determine VM for building from dependencies:"
2132 echo "NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}}"
2133 echo "VNEED: ${JAVA_PKG_VNEED}"
2134 die "Failed to determine VM for building."
2135 else
2136 export GENTOO_VM
1651 fi 2137 fi
1652 # otherwise just make sure the current VM is sufficient 2138 # otherwise just make sure the current VM is sufficient
1653 else 2139 else
1654 java-pkg_ensure-vm-version-sufficient 2140 java-pkg_ensure-vm-version-sufficient
1655 fi 2141 fi
1656 debug-print "Using: $(java-config -f)" 2142 debug-print "Using: $(java-config -f)"
1657 2143
1658 java-pkg_setup-vm 2144 java-pkg_setup-vm
1659 2145
2146 export JAVA=$(java-config --java)
2147 export JAVAC=$(java-config --javac)
1660 export JAVACFLAGS="$(java-pkg_javac-args)" 2148 JAVACFLAGS="$(java-pkg_javac-args)"
2149 if [[ ${?} != 0 ]]; then
2150 eerror "There was a problem determining JAVACFLAGS: ${JAVACFLAGS}"
2151 die "java-pkg_javac-args failed"
2152 fi
1661 [[ -n ${JAVACFLAGS_EXTRA} ]] && export JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}" 2153 [[ -n ${JAVACFLAGS_EXTRA} ]] && JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}"
2154 export JAVACFLAGS
1662 2155
1663 export JAVA_HOME="$(java-config -g JAVA_HOME)" 2156 export JAVA_HOME="$(java-config -g JAVA_HOME)"
1664 export JDK_HOME=${JAVA_HOME} 2157 export JDK_HOME=${JAVA_HOME}
1665 2158
1666 #TODO If you know a better solution let us know. 2159 #TODO If you know a better solution let us know.
1667 java-pkg_append_ LD_LIBRARY_PATH "$(java-config -g LDPATH)" 2160 java-pkg_append_ LD_LIBRARY_PATH "$(java-config -g LDPATH)"
1668 2161
1669 local tann="${T}/announced-vm" 2162 local tann="${T}/announced-vm"
1670 if [[ -n "${JAVA_PKG_DEBUG}" ]] || [[ ! -f "${tann}" ]] ; then 2163 if [[ -n "${JAVA_PKG_DEBUG}" ]] || [[ ! -f "${tann}" ]] ; then
1671 # Add a check for setup/preinst phase... to avoid duplicate outputs 2164 # Add a check for setup/preinst phase... to avoid duplicate outputs
1672 # for when FEATURES=buildpkg 2165 # for when FEATURES=buildpkg
1673 if [[ ${EBUILD_PHASE} != "setup" && ${EBUILD_PHASE} != "preinst" && ${EBUILD_PHASE} != "postinst" ]]; 2166 if [[ ${EBUILD_PHASE} != "setup" && ${EBUILD_PHASE} != "preinst" && ${EBUILD_PHASE} != "postinst" ]];
1698 echo "GENTOO_VM=${GENTOO_VM} CLASSPATH=\"${CLASSPATH}\" JAVA_HOME=\"${JAVA_HOME}\"" >&2 2191 echo "GENTOO_VM=${GENTOO_VM} CLASSPATH=\"${CLASSPATH}\" JAVA_HOME=\"${JAVA_HOME}\"" >&2
1699 echo "JAVACFLAGS=\"${JAVACFLAGS}\" COMPILER=\"${GENTOO_COMPILER}\"" >&2 2192 echo "JAVACFLAGS=\"${JAVACFLAGS}\" COMPILER=\"${GENTOO_COMPILER}\"" >&2
1700 echo "and of course, the output of emerge --info" >&2 2193 echo "and of course, the output of emerge --info" >&2
1701} 2194}
1702 2195
2196
2197# TODO document
2198# List jars in the source directory, ${S}
2199java-pkg_jar-list() {
2200 if [[ -n "${JAVA_PKG_DEBUG}" ]]; then
2201 einfo "Linked Jars"
2202 find "${S}" -type l -name '*.jar' -print0 | xargs -0 -r -n 500 ls -ald | sed -e "s,${WORKDIR},\${WORKDIR},"
2203 einfo "Jars"
2204 find "${S}" -type f -name '*.jar' -print0 | xargs -0 -r -n 500 ls -ald | sed -e "s,${WORKDIR},\${WORKDIR},"
2205 einfo "Classes"
2206 find "${S}" -type f -name '*.class' -print0 | xargs -0 -r -n 500 ls -ald | sed -e "s,${WORKDIR},\${WORKDIR},"
2207 fi
2208}
2209
2210# TODO document
2211# Verify that the classes were compiled for the right source / target
2212java-pkg_verify-classes() {
2213 ebegin "Verifying java class versions"
2214 #$(find ${D} -type f -name '*.jar' -o -name '*.class')
2215 class-version-verify.py -t $(java-pkg_get-target) -r ${D}
2216 result=$?
2217 eend ${result}
2218 if [[ ${result} == 0 ]]; then
2219 einfo "All good"
2220 else
2221 ewarn "Possible problem"
2222 die "Bad class files found"
2223 fi
2224}
2225
1703# ------------------------------------------------------------------------------ 2226# ------------------------------------------------------------------------------
1704# @section-end internal 2227# @section-end internal
1705# ------------------------------------------------------------------------------ 2228# ------------------------------------------------------------------------------
1706 2229
1707java-pkg_check-phase() { 2230java-pkg_check-phase() {
1708 local phase=${1} 2231 local phase=${1}
1709 local funcname=${2} 2232 local funcname=${2}
1710 # TODO add check for java-stricter
1711 if [[ ${EBUILD_PHASE} != ${phase} ]]; then 2233 if is-java-strict && [[ ${EBUILD_PHASE} != ${phase} ]]; then
1712 java-pkg_announce-qa-violation \ 2234 java-pkg_announce-qa-violation \
1713 "${funcname} used outside of src_${phase}" 2235 "${funcname} used outside of src_${phase}"
1714 fi 2236 fi
1715} 2237}
1716 2238
1727 java-pkg_announce-qa-violation "deprecated USE flag 'jikes' in IUSE" 2249 java-pkg_announce-qa-violation "deprecated USE flag 'jikes' in IUSE"
1728 fi 2250 fi
1729} 2251}
1730 2252
1731java-pkg_announce-qa-violation() { 2253java-pkg_announce-qa-violation() {
1732 if hasq java-strict ${FEATURES}; then 2254 if is-java-strict; then
1733 echo "Java QA Notice: $@" >&2 2255 echo "Java QA Notice: $@" >&2
1734 increment-qa-violations 2256 increment-qa-violations
1735 fi 2257 fi
1736} 2258}
1737 2259
1738increment-qa-violations() { 2260increment-qa-violations() {
1739 let "JAVA_PKG_QA_VIOLATIONS+=1" 2261 let "JAVA_PKG_QA_VIOLATIONS+=1"
1740 export JAVA_PKG_QA_VIOLATIONS 2262 export JAVA_PKG_QA_VIOLATIONS
1741} 2263}
1742 2264
2265is-java-strict() {
2266 [[ -n ${JAVA_PKG_STRICT} ]]
2267 return $?
2268}
2269
1743# ------------------------------------------------------------------------------ 2270# ------------------------------------------------------------------------------
1744# @eclass-end 2271# @eclass-end
1745# ------------------------------------------------------------------------------ 2272# ------------------------------------------------------------------------------

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

  ViewVC Help
Powered by ViewVC 1.1.20