/[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.10 Revision 1.62
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.62 2007/03/03 16:51:09 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#
33# ----------------------------------------------------------------------------- 36# -----------------------------------------------------------------------------
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# TODO document 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# -----------------------------------------------------------------------------
39JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1_pre1" 65JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1_pre1"
40 66
41# ----------------------------------------------------------------------------- 67# -----------------------------------------------------------------------------
42# @variable-internal JAVA_PKG_E_DEPEND 68# @variable-internal JAVA_PKG_E_DEPEND
43# 69#
44# 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
45# 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
46# portage, that includes phase hooks. 72# portage, that includes phase hooks.
47# ----------------------------------------------------------------------------- 73# -----------------------------------------------------------------------------
48JAVA_PKG_E_DEPEND=">=dev-java/java-config-2.0.19-r1 ${JAVA_PKG_PORTAGE_DEP}" 74JAVA_PKG_E_DEPEND=">=dev-java/java-config-2.0.31 ${JAVA_PKG_PORTAGE_DEP}"
49 75
50# ----------------------------------------------------------------------------- 76# -----------------------------------------------------------------------------
51# @variable-external JAVA_PKG_ALLOW_VM_CHANGE 77# @variable-external JAVA_PKG_ALLOW_VM_CHANGE
52# @variable-default yes 78# @variable-default yes
53# 79#
100# ----------------------------------------------------------------------------- 126# -----------------------------------------------------------------------------
101 127
102# ----------------------------------------------------------------------------- 128# -----------------------------------------------------------------------------
103# @variable-internal JAVA_PKG_COMPILER_DIR 129# @variable-internal JAVA_PKG_COMPILER_DIR
104# @default /usr/share/java-config-2/compiler 130# @default /usr/share/java-config-2/compiler
105# 131#
106# Directory where compiler settings are saved, without trailing slash. 132# Directory where compiler settings are saved, without trailing slash.
107# Probably shouldn't touch this variable. 133# Probably shouldn't touch this variable.
108# ----------------------------------------------------------------------------- 134# -----------------------------------------------------------------------------
109JAVA_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"}
110 136
120 146
121# ----------------------------------------------------------------------------- 147# -----------------------------------------------------------------------------
122# @variable-external JAVA_PKG_FORCE_COMPILER 148# @variable-external JAVA_PKG_FORCE_COMPILER
123# 149#
124# 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
125# JAVA_PKG_COMPILERS_CONF. 151# JAVA_PKG_COMPILERS_CONF.
126# 152#
127# @note This should only be used internally or for testing. 153# @note This should only be used internally or for testing.
128# @example Use jikes and javac, in that order 154# @example Use jikes and javac, in that order
129# JAVA_PKG_FORCE_COMPILER="jikes javac" 155# JAVA_PKG_FORCE_COMPILER="jikes javac"
130# ----------------------------------------------------------------------------- 156# -----------------------------------------------------------------------------
131 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
132# TODO document me 172# TODO document me
133JAVA_PKG_QA_VIOLATIONS=0 173JAVA_PKG_QA_VIOLATIONS=0
134 174
135# ----------------------------------------------------------------------------- 175# -----------------------------------------------------------------------------
136# @section-end variables 176# @section-end variables
150# @ebuild-function java-pkg_dojar 190# @ebuild-function java-pkg_dojar
151# 191#
152# Installs any number of jars. 192# Installs any number of jars.
153# 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.
154# You can use java-pkg_jarinto to change this path. 194# You can use java-pkg_jarinto to change this path.
155# 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.
156# Instead, use java-pkg_newjar defined below. 196# Instead, use java-pkg_newjar defined below.
157# 197#
158# @example 198# @example
159# java-pkg_dojar dist/${PN}.jar dist/${PN}-core.jar 199# java-pkg_dojar dist/${PN}.jar dist/${PN}-core.jar
160# 200#
171 # Create JARDEST if it doesn't exist 211 # Create JARDEST if it doesn't exist
172 dodir ${JAVA_PKG_JARDEST} 212 dodir ${JAVA_PKG_JARDEST}
173 213
174 local jar 214 local jar
175 # for each jar 215 # for each jar
176 for jar in "$@"; do 216 for jar in "${@}"; do
177 local jar_basename=$(basename "${jar}") 217 local jar_basename=$(basename "${jar}")
178 218
179 java-pkg_check-versioned-jar ${jar_basename} 219 java-pkg_check-versioned-jar ${jar_basename}
180 220
181 # check if it exists 221 # check if it exists
182 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
183 # install it into JARDEST if it's a non-symlink 230 # install it into JARDEST if it's a non-symlink
184 if [[ ! -L "${jar}" ]] ; then 231 if [[ ! -L "${jar}" ]] ; then
232 #but first check class version when in strict mode.
233 is-java-strict && java-pkg_verify-classes "${jar}"
234
185 INSDESTTREE="${JAVA_PKG_JARDEST}" \ 235 INSDESTTREE="${JAVA_PKG_JARDEST}" \
186 doins "${jar}" || die "failed to install ${jar}" 236 doins "${jar}" || die "failed to install ${jar}"
187 java-pkg_append_ JAVA_PKG_CLASSPATH "${JAVA_PKG_JARDEST}/${jar_basename}" 237 java-pkg_append_ JAVA_PKG_CLASSPATH "${JAVA_PKG_JARDEST}/${jar_basename}"
188 debug-print "installed ${jar} to ${D}${JAVA_PKG_JARDEST}" 238 debug-print "installed ${jar} to ${D}${JAVA_PKG_JARDEST}"
189 # make a symlink to the original jar if it's symlink 239 # make a symlink to the original jar if it's symlink
200 250
201 java-pkg_do_write_ 251 java-pkg_do_write_
202} 252}
203 253
204 254
255# ------------------------------------------------------------------------------
256# @internal-function depend-java-query
257#
258# Wrapper for the depend-java-query binary to enable passing USE in env.
259# Using env variables keeps this eclass working with java-config versions that
260# do not handle use flags.
261# ------------------------------------------------------------------------------
262
263depend-java-query() {
264 # Used to have a which call here but it caused endless loops for some people
265 # that had some weird bashrc voodoo for which.
266 USE="${USE}" /usr/bin/depend-java-query "${@}"
267}
205 268
206# ------------------------------------------------------------------------------ 269# ------------------------------------------------------------------------------
207# @ebuild-function java-pkg_regjar 270# @ebuild-function java-pkg_regjar
208# 271#
209# Records an already installed jar in the package.env 272# Records an already installed jar in the package.env
222# will not work, because: 285# will not work, because:
223# * the `for jar in "$@"` can't expand the path to jar file names, as they 286# * the `for jar in "$@"` can't expand the path to jar file names, as they
224# don't exist yet 287# don't exist yet
225# * all `if ...` inside for will fail - the file '/opt/my-java/lib/*.jar' 288# * all `if ...` inside for will fail - the file '/opt/my-java/lib/*.jar'
226# doesn't exist 289# doesn't exist
227# 290#
228# you have to use it as: 291# you have to use it as:
229# 292#
230# java-pkg_regjar ${D}/opt/my-java/lib/*.jar 293# java-pkg_regjar ${D}/opt/my-java/lib/*.jar
231# 294#
232# @param $@ - jars to record 295# @param $@ - jars to record
240 [[ ${#} -lt 1 ]] && die "at least one argument needed" 303 [[ ${#} -lt 1 ]] && die "at least one argument needed"
241 304
242 java-pkg_init_paths_ 305 java-pkg_init_paths_
243 306
244 local jar jar_dir jar_file 307 local jar jar_dir jar_file
245 for jar in "$@"; do 308 for jar in "${@}"; do
246 # TODO use java-pkg_check-versioned-jar 309 # TODO use java-pkg_check-versioned-jar
247 if [[ -e "${jar}" ]]; then 310 if [[ -e "${jar}" || -e "${D}${jar}" ]]; then
311 [[ -d "${jar}" || -d "${D}${jar}" ]] \
312 && die "Called ${FUNCNAME} on a directory $*"
313
314 #check that class version correct when in strict mode
315 is-java-strict && java-pkg_verify-classes "${jar}"
316
248 # nelchael: we should strip ${D} in this case too, here's why: 317 # nelchael: we should strip ${D} in this case too, here's why:
249 # imagine such call: 318 # imagine such call:
250 # java-pkg_regjar ${D}/opt/java/*.jar 319 # java-pkg_regjar ${D}/opt/java/*.jar
251 # such call will fall into this case (-e ${jar}) and will 320 # such call will fall into this case (-e ${jar}) and will
252 # record paths with ${D} in package.env 321 # record paths with ${D} in package.env
253 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}" 322 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}"
254 elif [[ -e "${D}${jar}" ]]; then
255 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}"
256 else 323 else
257 die "${jar} does not exist" 324 die "${jar} does not exist"
258 fi 325 fi
259 done 326 done
260 327
261 java-pkg_do_write_ 328 java-pkg_do_write_
262} 329}
263
264 330
265# ------------------------------------------------------------------------------ 331# ------------------------------------------------------------------------------
266# @ebuild-function java-pkg_newjar 332# @ebuild-function java-pkg_newjar
267# 333#
268# Installs a jar with a new name 334# Installs a jar with a new name
279 local original_jar="${1}" 345 local original_jar="${1}"
280 local new_jar="${2:-${PN}.jar}" 346 local new_jar="${2:-${PN}.jar}"
281 local new_jar_dest="${T}/${new_jar}" 347 local new_jar_dest="${T}/${new_jar}"
282 348
283 [[ -z ${original_jar} ]] && die "Must specify a jar to install" 349 [[ -z ${original_jar} ]] && die "Must specify a jar to install"
284 [[ ! -f ${original_jar} ]] && die "${original_jar} does not exist!" 350 [[ ! -f ${original_jar} ]] \
351 && die "${original_jar} does not exist or is not a file!"
285 352
286 rm -f "${new_jar_dest}" || die "Failed to remove ${new_jar_dest}" 353 rm -f "${new_jar_dest}" || die "Failed to remove ${new_jar_dest}"
287 cp "${original_jar}" "${new_jar_dest}" \ 354 cp "${original_jar}" "${new_jar_dest}" \
288 || die "Failed to copy ${original_jar} to ${new_jar_dest}" 355 || die "Failed to copy ${original_jar} to ${new_jar_dest}"
289 java-pkg_dojar "${new_jar_dest}" 356 java-pkg_dojar "${new_jar_dest}"
290} 357}
291 358
292
293# ------------------------------------------------------------------------------ 359# ------------------------------------------------------------------------------
294# @ebuild-function java-pkg_addcp 360# @ebuild-function java-pkg_addcp
295# 361#
296# Add something to the package's classpath. For jars, you should use dojar, 362# Add something to the package's classpath. For jars, you should use dojar,
297# newjar, or regjar. This is typically used to add directories to the classpath. 363# newjar, or regjar. This is typically used to add directories to the classpath.
302java-pkg_addcp() { 368java-pkg_addcp() {
303 java-pkg_append_ JAVA_PKG_CLASSPATH "${@}" 369 java-pkg_append_ JAVA_PKG_CLASSPATH "${@}"
304 java-pkg_do_write_ 370 java-pkg_do_write_
305} 371}
306 372
307
308# ------------------------------------------------------------------------------ 373# ------------------------------------------------------------------------------
309# @ebuild-function java-pkg_doso 374# @ebuild-function java-pkg_doso
310# 375#
311# Installs any number of JNI libraries 376# Installs any number of JNI libraries
312# They will be installed into /usr/lib by default, but java-pkg_sointo 377# They will be installed into /usr/lib by default, but java-pkg_sointo
313# can be used change this path 378# can be used change this path
314# 379#
315# Example: 380# Example:
340 java-pkg_append_ JAVA_PKG_LIBRARY "${JAVA_PKG_LIBDEST}" 405 java-pkg_append_ JAVA_PKG_LIBRARY "${JAVA_PKG_LIBDEST}"
341 debug-print "Installing ${lib} to ${JAVA_PKG_LIBDEST}" 406 debug-print "Installing ${lib} to ${JAVA_PKG_LIBDEST}"
342 # otherwise make a symlink to the symlink's origin 407 # otherwise make a symlink to the symlink's origin
343 else 408 else
344 # TODO use dosym 409 # TODO use dosym
410 ln -s "$(readlink "${lib}")" \
345 ln -s "$(readlink "${lib}")" "${D}${JAVA_PKG_LIBDEST}/$(basename "${lib}")" 411 "${D}${JAVA_PKG_LIBDEST}/$(basename "${lib}")"
346 debug-print "${lib} is a symlink, linking accordanly" 412 debug-print "${lib} is a symlink, linking accordanly"
347 fi 413 fi
348 # otherwise die 414 # otherwise die
349 else 415 else
350 die "${lib} does not exist" 416 die "${lib} does not exist"
370 java-pkg_check-phase install 436 java-pkg_check-phase install
371 437
372 [[ ${#} -lt 1 ]] && "at least one argument needed" 438 [[ ${#} -lt 1 ]] && "at least one argument needed"
373 439
374 java-pkg_init_paths_ 440 java-pkg_init_paths_
375 441
376 local lib target_dir 442 local lib target_dir
377 for lib in "$@" ; do 443 for lib in "$@" ; do
378 # Check the absolute path of the lib 444 # Check the absolute path of the lib
379 if [[ -e "${lib}" ]] ; then 445 if [[ -e "${lib}" ]] ; then
380 target_dir="$(java-pkg_expand_dir_ ${lib})" 446 target_dir="$(java-pkg_expand_dir_ ${lib})"
428# ------------------------------------------------------------------------------ 494# ------------------------------------------------------------------------------
429java-pkg_dohtml() { 495java-pkg_dohtml() {
430 debug-print-function ${FUNCNAME} $* 496 debug-print-function ${FUNCNAME} $*
431 497
432 [[ ${#} -lt 1 ]] && die "At least one argument required for ${FUNCNAME}" 498 [[ ${#} -lt 1 ]] && die "At least one argument required for ${FUNCNAME}"
433 # TODO-nichoj find out what exactly -f package-list does 499
500 # from /usr/lib/portage/bin/dohtml -h
501 # -f Set list of allowed extensionless file names.
434 dohtml -f package-list "$@" 502 dohtml -f package-list "$@"
503
435 # this probably shouldn't be here but it provides 504 # this probably shouldn't be here but it provides
436 # a reasonable way to catch # docs for all of the 505 # a reasonable way to catch # docs for all of the
437 # old ebuilds. 506 # old ebuilds.
438 java-pkg_recordjavadoc 507 java-pkg_recordjavadoc
439} 508}
440 509
441# TODO document 510# ------------------------------------------------------------------------------
511# @ebuild-function java-pkg_dojavadoc
512#
513# Installs javadoc documentation. This should be controlled by the doc use flag.
514#
515# @param $1: - The javadoc root directory.
516#
517# @example:
518# java-pkg_dojavadoc docs/api
519#
520# ------------------------------------------------------------------------------
442java-pkg_dojavadoc() { 521java-pkg_dojavadoc() {
443 local dir="$1" 522 local dir="$1"
444 523
445 java-pkg_check-phase install 524 java-pkg_check-phase install
446 525
458} 537}
459 538
460# ------------------------------------------------------------------------------ 539# ------------------------------------------------------------------------------
461# @ebuild-function java-pkg_dosrc 540# @ebuild-function java-pkg_dosrc
462# 541#
463# Installs a zip containing the source for a package, so it can used in 542# Installs a zip containing the source for a package, so it can used in
464# from IDEs like eclipse and netbeans. 543# from IDEs like eclipse and netbeans.
465# 544#
466# Ebuild needs to DEPEND on app-arch/zip to use this. 545# Ebuild needs to DEPEND on app-arch/zip to use this.
467# 546#
468# It also should be controlled by USE=source. 547# It also should be controlled by USE=source.
469# 548#
470# @example: 549# @example:
471# java-pkg_dosrc src/* 550# java-pkg_dosrc src/*
472# 551#
473# ------------------------------------------------------------------------------ 552# ------------------------------------------------------------------------------
474# TODO change so it the arguments it takes are the base directories containing 553# TODO change so it the arguments it takes are the base directories containing
475# source -nichoj 554# source -nichoj
476# TODO should we be able to handle multiple calls to dosrc? -nichoj 555# TODO should we be able to handle multiple calls to dosrc? -nichoj
477# TODO maybe we can take an existing zip/jar? -nichoj 556# TODO maybe we can take an existing zip/jar? -nichoj
478# FIXME apparently this fails if you give it an empty directories 557# FIXME apparently this fails if you give it an empty directories
479java-pkg_dosrc() { 558java-pkg_dosrc() {
480 debug-print-function ${FUNCNAME} $* 559 debug-print-function ${FUNCNAME} $*
481 560
482 [ ${#} -lt 1 ] && die "At least one argument needed" 561 [ ${#} -lt 1 ] && die "At least one argument needed"
483 if ! hasq source ${IUSE}; then 562 if ! hasq source ${IUSE}; then
484 echo "Java QA Notice: ${FUNCNAME} called without source in IUSE" 563 echo "Java QA Notice: ${FUNCNAME} called without source in IUSE"
485 fi 564 fi
486 565
487 java-pkg_check-phase install 566 java-pkg_check-phase install
488 567
489 [[ ${#} -lt 1 ]] && die "At least one argument needed" 568 [[ ${#} -lt 1 ]] && die "At least one argument needed"
490 569
491 java-pkg_init_paths_ 570 java-pkg_init_paths_
492 571
493 local zip_name="${PN}-src.zip" 572 local zip_name="${PN}-src.zip"
494 local zip_path="${T}/${zip_name}" 573 local zip_path="${T}/${zip_name}"
495 local dir 574 local dir
496 for dir in ${@}; do 575 for dir in "${@}"; do
497 local dir_parent=$(dirname "${dir}") 576 local dir_parent=$(dirname "${dir}")
498 local dir_name=$(basename "${dir}") 577 local dir_name=$(basename "${dir}")
499 pushd ${dir_parent} > /dev/null || die "problem entering ${dir_parent}" 578 pushd ${dir_parent} > /dev/null || die "problem entering ${dir_parent}"
500 zip -q -r ${zip_path} ${dir_name} -i '*.java' 579 zip -q -r ${zip_path} ${dir_name} -i '*.java'
501 local result=$? 580 local result=$?
518# @ebuild-function java-pkg_dolauncher 597# @ebuild-function java-pkg_dolauncher
519# 598#
520# Make a wrapper script to lauch/start this package 599# Make a wrapper script to lauch/start this package
521# If necessary, the wrapper will switch to the appropriate VM. 600# If necessary, the wrapper will switch to the appropriate VM.
522# 601#
602# Can be called without parameters if the package installs only one jar
603# that has the Main-class attribute set. The wrapper will be named ${PN}.
604#
523# @param $1 - filename of launcher to create 605# @param $1 - filename of launcher to create
524# @param $2 - options, as follows: 606# @param $2 - options, as follows:
525# --main the.main.class.too.start 607# --main the.main.class.too.start
526# --jar /the/jar/too/launch.jar 608# --jar /the/jar/too/launch.jar or just <name>.jar
527# --java_args 'Extra arguments to pass too jave' 609# --java_args 'Extra arguments to pass to java'
528# --pkg_args 'extra arguments too pass too the package' 610# --pkg_args 'Extra arguments to pass to the package'
529# --pwd 611# --pwd Directory the launcher changes to before executing java
530# -into 612# -into Directory to install the launcher to, instead of /usr/bin
531# -pre 613# -pre Prepend contents of this file to the launcher
532# ------------------------------------------------------------------------------ 614# ------------------------------------------------------------------------------
533java-pkg_dolauncher() { 615java-pkg_dolauncher() {
534 debug-print-function ${FUNCNAME} $* 616 debug-print-function ${FUNCNAME} $*
535 617
536 java-pkg_check-phase install 618 java-pkg_check-phase install
537
538 [[ ${#} -lt 1 ]] && die "Need at least one argument"
539
540 java-pkg_init_paths_ 619 java-pkg_init_paths_
541 620
621 if [[ ${#} = 0 ]]; then
622 local name="${PN}"
623 else
542 local name="${1}" 624 local name="${1}"
625 shift
626 fi
627
543 # TODO rename to launcher 628 # TODO rename to launcher
544 local target="${T}/${name}" 629 local target="${T}/${name}"
630 local var_tmp="${T}/launcher_variables_tmp"
545 local target_dir pre 631 local target_dir pre
546 shift
547 632
548 echo "#!/bin/bash" > "${target}" 633 # Process the other the rest of the arguments
549 while [[ -n "${1}" && -n "${2}" ]]; do 634 while [[ -n "${1}" && -n "${2}" ]]; do
550 local var=${1} value=${2} 635 local var="${1}" value="${2}"
551 if [[ "${var:0:2}" == "--" ]]; then 636 if [[ "${var:0:2}" == "--" ]]; then
637 local var=${var:2}
552 echo "gjl_${var:2}=\"${value}\"" >> "${target}" 638 echo "gjl_${var}=\"${value}\"" >> "${var_tmp}"
639 local gjl_${var}="${value}"
553 elif [[ "${var}" == "-into" ]]; then 640 elif [[ "${var}" == "-into" ]]; then
554 target_dir="${value}" 641 target_dir="${value}"
555 elif [[ "${var}" == "-pre" ]]; then 642 elif [[ "${var}" == "-pre" ]]; then
556 pre="${value}" 643 pre="${value}"
557 fi 644 fi
558 shift 2 645 shift 2
559 done 646 done
647
648 # Test if no --jar and --main arguments were given and
649 # in that case check if the package only installs one jar
650 # and use that jar.
651 if [[ -z "${gjl_jar}" && -z "${gjl_main}" ]]; then
652 local cp="${JAVA_PKG_CLASSPATH}"
653 if [[ "${cp/:}" = "${cp}" && "${cp%.jar}" != "${cp}" ]]; then
654 echo "gjl_jar=\"${JAVA_PKG_CLASSPATH}\"" >> "${var_tmp}"
655 else
656 local msg="Not enough information to create a launcher given."
657 msg="${msg} Please give --jar or --main argument to ${FUNCNAME}."
658 die "${msg}"
659 fi
660 fi
661
662 # Write the actual script
663 echo "#!/bin/bash" > "${target}"
664 if [[ -n "${pre}" ]]; then
665 if [[ -f "${pre}" ]]; then
666 cat "${pre}" >> "${target}"
667 else
668 die "-pre specified file '${pre}' does not exist"
669 fi
670 fi
560 echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}" 671 echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}"
561 [[ -n "${pre}" ]] && [[ -f "${pre}" ]] && cat "${pre}" >> "${target}" 672 cat "${var_tmp}" >> "${target}"
673 rm -f "${var_tmp}"
562 echo "source /usr/share/java-config-2/launcher/launcher.bash" >> "${target}" 674 echo "source /usr/share/java-config-2/launcher/launcher.bash" >> "${target}"
563 675
564 if [[ -n "${into}" ]]; then 676 if [[ -n "${target_dir}" ]]; then
565 DESTTREE="${target_dir}" dobin "${target}" 677 DESTTREE="${target_dir}" dobin "${target}"
566 local ret=$? 678 local ret=$?
567 return ${ret} 679 return ${ret}
568 else 680 else
569 dobin "${target}" 681 dobin "${target}"
597 echo "dowar: warning, skipping directory ${war}" 709 echo "dowar: warning, skipping directory ${war}"
598 continue 710 continue
599 else 711 else
600 warpath="${war}" 712 warpath="${war}"
601 fi 713 fi
602 714
603 # Install those files like you mean it 715 # Install those files like you mean it
604 INSOPTIONS="-m 0644" \ 716 INSOPTIONS="-m 0644" \
605 INSDESTTREE=${JAVA_PKG_WARDEST} \ 717 INSDESTTREE=${JAVA_PKG_WARDEST} \
606 doins ${warpath} 718 doins ${warpath}
607 done 719 done
642# @ebuild-function java-pkg_jar-from 754# @ebuild-function java-pkg_jar-from
643# 755#
644# Makes a symlink to a jar from a certain package 756# Makes a symlink to a jar from a certain package
645# A lot of java packages include dependencies in a lib/ directory 757# A lot of java packages include dependencies in a lib/ directory
646# You can use this function to replace these bundled dependencies. 758# You can use this function to replace these bundled dependencies.
759# The dependency is recorded into package.env DEPEND line, unless "--build-only"
760# is passed as the very first argument, for jars that have to be present only
761# at build time and are not needed on runtime (junit testing etc).
647# 762#
648# Example: get all jars from xerces slot 2 763# Example: get all jars from xerces slot 2
649# java-pkg_jar-from xerces-2 764# java-pkg_jar-from xerces-2
650# Example: get a specific jar from xerces slot 2 765# Example: get a specific jar from xerces slot 2
651# java-pkg_jar-from xerces-2 xml-apis.jar 766# java-pkg_jar-from xerces-2 xml-apis.jar
652# Example get a specific jar from xerces slot 2, and name it diffrently 767# Example: get a specific jar from xerces slot 2, and name it diffrently
653# java-pkg_jar-from xerces-2 xml-apis.jar xml.jar 768# java-pkg_jar-from xerces-2 xml-apis.jar xml.jar
769# Example: get junit.jar which is needed only for building
770# java-pkg_jar-from --build-only junit junit.jar
654# 771#
772# @param $opt
773# --build-only - makes the jar(s) not added into package.env DEPEND line.
774# (assumed automatically when called inside src_test)
775# --with-dependencies - get jars also from requested package's dependencies
776# transitively.
777# --into $dir - symlink jar(s) into $dir (must exist) instead of .
655# @param $1 - Package to get jars from. 778# @param $1 - Package to get jars from.
656# @param $2 - jar from package. If not specified, all jars will be used. 779# @param $2 - jar from package. If not specified, all jars will be used.
657# @param $3 - When a single jar is specified, destination filename of the 780# @param $3 - When a single jar is specified, destination filename of the
658# symlink. Defaults to the name of the jar. 781# symlink. Defaults to the name of the jar.
659# ------------------------------------------------------------------------------ 782# ------------------------------------------------------------------------------
660# TODO could probably be cleaned up a little 783# TODO could probably be cleaned up a little
661java-pkg_jar-from() { 784java-pkg_jar-from() {
662 debug-print-function ${FUNCNAME} $* 785 debug-print-function ${FUNCNAME} $*
663 786
787 local build_only=""
788 local destdir="."
789 local deep=""
790
791 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="true"
792
793 while [[ "${1}" == --* ]]; do
794 if [[ "${1}" = "--build-only" ]]; then
795 build_only="true"
796 elif [[ "${1}" = "--with-dependencies" ]]; then
797 deep="--with-dependencies"
798 elif [[ "${1}" = "--into" ]]; then
799 destdir="${2}"
800 shift
801 else
802 die "java-pkg_jar-from called with unknown parameter: ${1}"
803 fi
804 shift
805 done
806
664 local target_pkg="${1}" target_jar="${2}" destjar="${3}" 807 local target_pkg="${1}" target_jar="${2}" destjar="${3}"
665 808
666 [[ -z ${target_pkg} ]] && die "Must specify a package" 809 [[ -z ${target_pkg} ]] && die "Must specify a package"
667 810
668 # default destjar to the target jar 811 # default destjar to the target jar
669 [[ -z "${destjar}" ]] && destjar="${target_jar}" 812 [[ -z "${destjar}" ]] && destjar="${target_jar}"
670 813
814 local error_msg="There was a problem getting the classpath for ${target_pkg}."
815 local classpath
671 local classpath="$(java-config --classpath=${target_pkg})" 816 classpath="$(java-config ${deep} --classpath=${target_pkg})"
672 [[ $? != 0 ]] && die "There was a problem getting the classpath for ${target_pkg}" 817 [[ $? != 0 ]] && die ${error_msg}
818
819 pushd ${destdir} > /dev/null \
820 || die "failed to change directory to ${destdir}"
821
822 # When we have commas this functions is called to bring jars from multiple
823 # packages. This affects recording of dependencencies because that syntax uses :
824 # if we don't change them to : gjl and java-config -d -p break
825 if [[ ${target_pkg} = *,* ]]; then
826 build_only="true"
827 java-pkg_record-jar_ ${target_pkg//,/:}
828 fi
673 829
674 local jar 830 local jar
675 for jar in ${classpath//:/ }; do 831 for jar in ${classpath//:/ }; do
676 local jar_name=$(basename "${jar}") 832 local jar_name=$(basename "${jar}")
677 if [[ ! -f "${jar}" ]] ; then 833 if [[ ! -f "${jar}" ]] ; then
681 # If no specific target jar was indicated, link it 837 # If no specific target jar was indicated, link it
682 if [[ -z "${target_jar}" ]] ; then 838 if [[ -z "${target_jar}" ]] ; then
683 [[ -f "${target_jar}" ]] && rm "${target_jar}" 839 [[ -f "${target_jar}" ]] && rm "${target_jar}"
684 ln -snf "${jar}" \ 840 ln -snf "${jar}" \
685 || die "Failed to make symlink from ${jar} to ${jar_name}" 841 || die "Failed to make symlink from ${jar} to ${jar_name}"
686 java-pkg_record-jar_ "${target_pkg}" "${jar}" 842 [[ -z "${build_only}" ]] && java-pkg_record-jar_ "${target_pkg}" "${jar}"
687 # otherwise, if the current jar is the target jar, link it 843 # otherwise, if the current jar is the target jar, link it
688 elif [[ "${jar_name}" == "${target_jar}" ]] ; then 844 elif [[ "${jar_name}" == "${target_jar}" ]] ; then
689 [[ -f "${destjar}" ]] && rm "${destjar}" 845 [[ -f "${destjar}" ]] && rm "${destjar}"
690 ln -snf "${jar}" "${destjar}" \ 846 ln -snf "${jar}" "${destjar}" \
691 || die "Failed to make symlink from ${jar} to ${destjar}" 847 || die "Failed to make symlink from ${jar} to ${destjar}"
692 java-pkg_record-jar_ "${target_pkg}" "${jar}" 848 [[ -z "${build_only}" ]] && java-pkg_record-jar_ "${target_pkg}" "${jar}"
849 popd > /dev/null
693 return 0 850 return 0
694 fi 851 fi
695 done 852 done
853 popd > /dev/null
696 # if no target was specified, we're ok 854 # if no target was specified, we're ok
697 if [[ -z "${target_jar}" ]] ; then 855 if [[ -z "${target_jar}" ]] ; then
698 return 0 856 return 0
699 # otherwise, die bitterly 857 # otherwise, die bitterly
700 else 858 else
714# ------------------------------------------------------------------------------ 872# ------------------------------------------------------------------------------
715# @ebuild-function java-pkg_getjars 873# @ebuild-function java-pkg_getjars
716# 874#
717# Get the classpath provided by any number of packages 875# Get the classpath provided by any number of packages
718# Among other things, this can be passed to 'javac -classpath' or 'ant -lib'. 876# Among other things, this can be passed to 'javac -classpath' or 'ant -lib'.
877# The providing packages are recorded as dependencies into package.env DEPEND
878# line, unless "--build-only" is passed as the very first argument, for jars
879# that have to be present only at build time and are not needed on runtime
880# (junit testing etc).
719# 881#
720# Example: Get the classpath for xerces-2, 882# Example: Get the classpath for xerces-2 and xalan,
721# java-pkg_getjars xerces-2 xalan 883# java-pkg_getjars xerces-2,xalan
722# Example Return: 884# Example Return:
723# /usr/share/xerces-2/lib/xml-apis.jar:/usr/share/xerces-2/lib/xmlParserAPIs.jar:/usr/share/xalan/lib/xalan.jar 885# /usr/share/xerces-2/lib/xml-apis.jar:/usr/share/xerces-2/lib/xmlParserAPIs.jar:/usr/share/xalan/lib/xalan.jar
724# 886#
887# @param $opt
888# --build-only - makes the jar(s) not added into package.env DEPEND line.
889# (assumed automatically when called inside src_test)
890# --with-dependencies - get jars also from requested package's dependencies
891# transitively.
725# @param $@ - list of packages to get jars from 892# @param $1 - list of packages to get jars from
893# (passed to java-config --classpath)
726# ------------------------------------------------------------------------------ 894# ------------------------------------------------------------------------------
727java-pkg_getjars() { 895java-pkg_getjars() {
728 debug-print-function ${FUNCNAME} $* 896 debug-print-function ${FUNCNAME} $*
729 897
730 [[ ${#} -lt 1 ]] && die "At least one argument needed" 898 local build_only=""
899 local deep=""
731 900
732 # NOTE could probably just pass $@ to java-config --classpath. and return it 901 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="true"
733 local classpath pkg 902
734 for pkg in ${@//,/ }; do 903 while [[ "${1}" == --* ]]; do
735 #for pkg in $(echo "$@" | tr ',' ' '); do 904 if [[ "${1}" = "--build-only" ]]; then
736 jars="$(java-config --classpath=${pkg})" 905 build_only="true"
737 debug-print "${pkg}:${jars}" 906 elif [[ "${1}" = "--with-dependencies" ]]; then
738 # TODO should we ensure jars exist? 907 deep="--with-dependencies"
739 if [[ -z "${classpath}" ]]; then
740 classpath="${jars}"
741 else 908 else
742 classpath="${classpath}:${jars}" 909 die "java-pkg_jar-from called with unknown parameter: ${1}"
743 fi 910 fi
744 java-pkg_record-jar_ "${pkg}" 911 shift
745 done 912 done
913
914 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --*"
915
916 local classpath pkgs="${1}"
917 jars="$(java-config ${deep} --classpath=${pkgs})"
918 [[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed"
919 debug-print "${pkgs}:${jars}"
920
921 if [[ -z "${classpath}" ]]; then
922 classpath="${jars}"
923 else
924 classpath="${classpath}:${jars}"
925 fi
926
927 # Only record jars that aren't build-only
928 if [[ -z "${build_only}" ]]; then
929 oldifs="${IFS}"
930 IFS=","
931 for pkg in ${pkgs}; do
932 java-pkg_record-jar_ "${pkg}"
933 done
934 IFS="${oldifs}"
935 fi
936
746 echo "${classpath}" 937 echo "${classpath}"
747} 938}
748 939
749# ------------------------------------------------------------------------------ 940# ------------------------------------------------------------------------------
750# @ebuild-function java-pkg_getjar 941# @ebuild-function java-pkg_getjar
751# 942#
752# Get the filename of a single jar from a package 943# Get the filename of a single jar from a package
944# The providing package is recorded as runtime dependency into package.env
945# DEPEND line, unless "--build-only" is passed as the very first argument, for
946# jars that have to be present only at build time and are not needed on runtime
947# (junit testing etc).
753# 948#
754# @example 949# @example
755# java-pkg_getjar xerces-2 xml-apis.jar 950# java-pkg_getjar xerces-2 xml-apis.jar
756# @example-return 951# @example-return
757# /usr/share/xerces-2/lib/xml-apis.jar 952# /usr/share/xerces-2/lib/xml-apis.jar
758# 953#
954# @param $opt
955# --build-only - makes the jar not added into package.env DEPEND line.
759# @param $1 - package to use 956# @param $1 - package to use
760# @param $2 - jar to get 957# @param $2 - jar to get
761# ------------------------------------------------------------------------------ 958# ------------------------------------------------------------------------------
762java-pkg_getjar() { 959java-pkg_getjar() {
763 debug-print-function ${FUNCNAME} $* 960 debug-print-function ${FUNCNAME} $*
961
962 local build_only=""
963
964 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="true"
965
966 while [[ "${1}" == --* ]]; do
967 if [[ "${1}" = "--build-only" ]]; then
968 build_only="true"
969 else
970 die "java-pkg_jar-from called with unknown parameter: ${1}"
971 fi
972 shift
973 done
974
975 [[ ${#} -ne 2 ]] && die "${FUNCNAME} takes only two arguments besides --*"
764 976
765 local pkg="${1}" target_jar="${2}" jar 977 local pkg="${1}" target_jar="${2}" jar
766 [[ -z ${pkg} ]] && die "Must specify package to get a jar from" 978 [[ -z ${pkg} ]] && die "Must specify package to get a jar from"
767 [[ -z ${target_jar} ]] && die "Must specify jar to get" 979 [[ -z ${target_jar} ]] && die "Must specify jar to get"
768 980
769 # TODO check that package is actually installed 981 local error_msg="Could not find classpath for ${pkg}. Are you sure its installed?"
982 local classpath
770 local classpath=$(java-config --classpath=${pkg}) 983 classpath=$(java-config --classpath=${pkg})
771 [[ $? != 0 ]] && die "There could not find classpath for ${pkg}. Are you sure its installed?" 984 [[ $? != 0 ]] && die ${error_msg}
985
772 for jar in ${classpath//:/ }; do 986 for jar in ${classpath//:/ }; do
773 if [[ ! -f "${jar}" ]] ; then 987 if [[ ! -f "${jar}" ]] ; then
774 die "Installation problems with jars in ${pkg} - is it installed?" 988 die "Installation problem with jar ${jar} in ${pkg} - is it installed?"
775 fi 989 fi
776 990
777 if [[ "$(basename ${jar})" == "${target_jar}" ]] ; then 991 if [[ "$(basename ${jar})" == "${target_jar}" ]] ; then
778 java-pkg_record-jar_ "${pkg}" "${jar}" 992 # Only record jars that aren't build-only
993 [[ -z "${build_only}" ]] && java-pkg_record-jar_ "${pkg}" "${jar}"
779 echo "${jar}" 994 echo "${jar}"
780 return 0 995 return 0
781 fi 996 fi
782 done 997 done
783 998
784 die "Could not find ${target_jar} in ${pkg}" 999 die "Could not find ${target_jar} in ${pkg}"
785 return 1 1000 return 1
786} 1001}
787 1002
788# This function reads stdin, and based on that input, figures out how to 1003# This function reads stdin, and based on that input, figures out how to
802# line="${line// /}" 1017# line="${line// /}"
803# 1018#
804# # format: path=jarinfo 1019# # format: path=jarinfo
805# local path=${line%%=*} 1020# local path=${line%%=*}
806# local jarinfo=${line##*=} 1021# local jarinfo=${line##*=}
807# 1022#
808# # format: jar@package 1023# # format: jar@package
809# local jar=${jarinfo%%@*}.jar 1024# local jar=${jarinfo%%@*}.jar
810# local package=${jarinfo##*@} 1025# local package=${jarinfo##*@}
811# if [[ -n ${replace_only} ]]; then 1026# if [[ -n ${replace_only} ]]; then
812# [[ ! -f $path ]] && die "No jar exists at ${path}" 1027# [[ ! -f $path ]] && die "No jar exists at ${path}"
825# @section-end query 1040# @section-end query
826# ------------------------------------------------------------------------------ 1041# ------------------------------------------------------------------------------
827 1042
828# ------------------------------------------------------------------------------ 1043# ------------------------------------------------------------------------------
829# @section-begin helper 1044# @section-begin helper
830# @section-summary Helper functions 1045# @section-summary Helper functions
831# 1046#
832# Various other functions to use from an ebuild 1047# Various other functions to use from an ebuild
833# ------------------------------------------------------------------------------ 1048# ------------------------------------------------------------------------------
834 1049
835# ------------------------------------------------------------------------------ 1050# ------------------------------------------------------------------------------
841# jdbc-stdext 1056# jdbc-stdext
842# jaf 1057# jaf
843# jdbc-rowset 1058# jdbc-rowset
844# jms 1059# jms
845# 1060#
846# @param $1 - Optionally indicate that the dependencies are controlled by 1061# @param $1 - Optionally indicate that the dependencies are controlled by
847# a use flag by specifying '--use' Requires $2. 1062# a use flag by specifying '--use' Requires $2.
848# @param $2 - USE flag which will enable the dependencies. 1063# @param $2 - USE flag which will enable the dependencies.
849# @param $@ - virtual packages to add depenedencies for 1064# @param $@ - virtual packages to add depenedencies for
850# ------------------------------------------------------------------------------ 1065# ------------------------------------------------------------------------------
851# TODO rewrite to parse a line based declaration file instead -- karltk 1066# TODO rewrite to parse a line based declaration file instead -- karltk
907# 1122#
908# export DEPEND="${DEPEND} ${depstr}" 1123# export DEPEND="${DEPEND} ${depstr}"
909# export RDEPEND="${RDEPEND} ${depstr}" 1124# export RDEPEND="${RDEPEND} ${depstr}"
910#} 1125#}
911 1126
1127# ------------------------------------------------------------------------------
1128# @ebuild-function java-pkg_find-normal-jars
1129#
1130# Find the files with suffix .jar file in the given directory or $WORKDIR
1131#
1132# @param $1 - The directory to search for jar files (default: ${WORKDIR})
1133# ------------------------------------------------------------------------------
1134java-pkg_find-normal-jars() {
1135 local dir=$1
1136 [[ "${dir}" ]] || dir="${WORKDIR}"
1137 local found
1138 for jar in $(find "${dir}" -name "*.jar" -type f); do
1139 echo "${jar}"
1140 found="true"
1141 done
1142 [[ "${found}" ]]
1143 return $?
1144}
1145
1146# ------------------------------------------------------------------------------
1147# @ebuild-function java-pkg_ensure-no-bundled-jars
1148#
1149# Try to locate bundled jar files in ${WORKDIR} and die if found.
912# This should be used after S has been populated with symlinks to jars 1150# This function should be called after WORKDIR has been populated with symlink
913# TODO document 1151# to system jar files or bundled jars removed.
1152# ------------------------------------------------------------------------------
914java-pkg_ensure-no-bundled-jars() { 1153java-pkg_ensure-no-bundled-jars() {
915 debug-print-function ${FUNCNAME} $* 1154 debug-print-function ${FUNCNAME} $*
916 pushd ${WORKDIR} >/dev/null 2>/dev/null
917 1155
918 local bundled_jars=$(find . -name "*.jar" -type f) 1156 local bundled_jars=$(java-pkg_find-normal-jars)
919 if [[ -n ${bundled_jars} ]]; then 1157 if [[ -n ${bundled_jars} ]]; then
920 echo "Bundled jars found:" 1158 echo "Bundled jars found:"
921 local jar 1159 local jar
922 for jar in ${bundled_jars}; do 1160 for jar in ${bundled_jars}; do
923 echo $(pwd)${jar/./} 1161 echo $(pwd)${jar/./}
924 done 1162 done
925 die "Bundled jars found!" 1163 die "Bundled jars found!"
926
927 fi 1164 fi
928 popd >/dev/null 2>/dev/null
929} 1165}
930 1166
931# ------------------------------------------------------------------------------ 1167# ------------------------------------------------------------------------------
932# @internal-function java-pkg_ensure-vm-version-sufficient 1168# @internal-function java-pkg_ensure-vm-version-sufficient
933# 1169#
945 fi 1181 fi
946} 1182}
947 1183
948# ------------------------------------------------------------------------------ 1184# ------------------------------------------------------------------------------
949# @internal-function java-pkg_is-vm-version-sufficient 1185# @internal-function java-pkg_is-vm-version-sufficient
950# 1186#
951# @return zero - VM is sufficient 1187# @return zero - VM is sufficient
952# @return non-zero - VM is not sufficient 1188# @return non-zero - VM is not sufficient
953# ------------------------------------------------------------------------------ 1189# ------------------------------------------------------------------------------
954java-pkg_is-vm-version-sufficient() { 1190java-pkg_is-vm-version-sufficient() {
955 debug-print-function ${FUNCNAME} $* 1191 debug-print-function ${FUNCNAME} $*
975 die "Active Java VM too old" 1211 die "Active Java VM too old"
976 fi 1212 fi
977} 1213}
978 1214
979# ------------------------------------------------------------------------------ 1215# ------------------------------------------------------------------------------
980# @internal-function java-pkg_is-vm-version-eq 1216# @internal-function java-pkg_is-vm-version-eq
981# 1217#
982# @param $@ - VM version to compare current VM to 1218# @param $@ - VM version to compare current VM to
983# @return zero - VM versions are equal 1219# @return zero - VM versions are equal
984# @return non-zero - VM version are not equal 1220# @return non-zero - VM version are not equal
985# ------------------------------------------------------------------------------ 1221# ------------------------------------------------------------------------------
986java-pkg_is-vm-version-eq() { 1222java-pkg_is-vm-version-eq() {
1016# 1252#
1017# @param $@ - VM version to compare current to 1253# @param $@ - VM version to compare current to
1018# ------------------------------------------------------------------------------ 1254# ------------------------------------------------------------------------------
1019java-pkg_ensure-vm-version-ge() { 1255java-pkg_ensure-vm-version-ge() {
1020 debug-print-function ${FUNCNAME} $* 1256 debug-print-function ${FUNCNAME} $*
1021 1257
1022 if ! java-pkg_is-vm-version-ge "$@" ; then 1258 if ! java-pkg_is-vm-version-ge "$@" ; then
1023 debug-print "vm is not suffient" 1259 debug-print "vm is not suffient"
1024 eerror "This package requires a Java VM version >= $@" 1260 eerror "This package requires a Java VM version >= $@"
1025 einfo "Please use java-config -S to set the correct one" 1261 einfo "Please use java-config -S to set the correct one"
1026 die "Active Java VM too old" 1262 die "Active Java VM too old"
1027 fi 1263 fi
1028} 1264}
1029 1265
1030# ------------------------------------------------------------------------------ 1266# ------------------------------------------------------------------------------
1031# @internal-function java-pkg_is-vm-version-ge 1267# @internal-function java-pkg_is-vm-version-ge
1032# 1268#
1033# @param $@ - VM version to compare current VM to 1269# @param $@ - VM version to compare current VM to
1034# @return zero - current VM version is greater than checked version 1270# @return zero - current VM version is greater than checked version
1035# @return non-zero - current VM version is not greater than checked version 1271# @return non-zero - current VM version is not greater than checked version
1036# ------------------------------------------------------------------------------ 1272# ------------------------------------------------------------------------------
1037java-pkg_is-vm-version-ge() { 1273java-pkg_is-vm-version-ge() {
1051 return 1 1287 return 1
1052 fi 1288 fi
1053 fi 1289 fi
1054} 1290}
1055 1291
1292java-pkg_set-current-vm() {
1293 export GENTOO_VM=${1}
1294}
1295
1296java-pkg_get-current-vm() {
1297 echo ${GENTOO_VM}
1298}
1299
1300java-pkg_current-vm-matches() {
1301 hasq $(java-pkg_get-current-vm) ${@}
1302 return $?
1303}
1304
1056# ------------------------------------------------------------------------------ 1305# ------------------------------------------------------------------------------
1057# @ebuild-function java-pkg_get-source 1306# @ebuild-function java-pkg_get-source
1058# 1307#
1059# Determines what source version should be used, for passing to -source. 1308# Determines what source version should be used, for passing to -source.
1060# Unless you want to break things you probably shouldn't set _WANT_SOURCE 1309# Unless you want to break things you probably shouldn't set _WANT_SOURCE
1061# 1310#
1062# @return string - Either the lowest possible source, or JAVA_PKG_WANT_SOURCE 1311# @return string - Either the lowest possible source, or JAVA_PKG_WANT_SOURCE
1063# ------------------------------------------------------------------------------ 1312# ------------------------------------------------------------------------------
1068# ------------------------------------------------------------------------------ 1317# ------------------------------------------------------------------------------
1069# @ebuild-function java-pkg_get-target 1318# @ebuild-function java-pkg_get-target
1070# 1319#
1071# Determines what target version should be used, for passing to -target. 1320# Determines what target version should be used, for passing to -target.
1072# If you don't care about lower versions, you can set _WANT_TARGET to the 1321# If you don't care about lower versions, you can set _WANT_TARGET to the
1073# version of your JDK. 1322# version of your JDK.
1074# Remember doing this will mostly like cause things to break.
1075# Doesn't allow it to be lower then the one in depend.
1076# Doesn't allow it to be higher then the active vm.
1077# 1323#
1078# @return string - Either the lowest possible target, or JAVA_PKG_WANT_TARGET 1324# @return string - Either the lowest possible target, or JAVA_PKG_WANT_TARGET
1079# ------------------------------------------------------------------------------ 1325# ------------------------------------------------------------------------------
1080java-pkg_get-target() { 1326java-pkg_get-target() {
1081 local min=$(depend-java-query --get-lowest "${DEPEND} ${RDEPEND}")
1082 if [[ -n "${JAVA_PKG_WANT_TARGET}" ]]; then
1083 local max="$(java-config --select-vm "${GENTOO_VM}" -g PROVIDES_VERSION)"
1084 if version_is_at_least "${min}" "${JAVA_PKG_WANT_TARGET}" && version_is_at_least "${JAVA_PKG_WANT_TARGET}" "${max}"; then
1085 echo ${JAVA_PKG_WANT_TARGET}
1086 else
1087 echo ${min}
1088 fi
1089 else
1090 echo ${min}
1091 fi
1092
1093 #echo ${JAVA_PKG_WANT_TARGET:-$(depend-java-query --get-lowest "${DEPEND}")} 1327 echo ${JAVA_PKG_WANT_TARGET:-$(depend-java-query --get-lowest "${DEPEND} ${RDEPEND}")}
1094} 1328}
1095 1329
1096java-pkg_get-javac() { 1330java-pkg_get-javac() {
1097 debug-print-function ${FUNCNAME} $* 1331 debug-print-function ${FUNCNAME} $*
1098 1332
1099 java-pkg_init-compiler_ 1333
1100 local compiler="${GENTOO_COMPILER}" 1334 local compiler="${GENTOO_COMPILER}"
1101 1335
1102 local compiler_executable 1336 local compiler_executable
1103 if [[ "${compiler}" = "javac" ]]; then 1337 if [[ "${compiler}" = "javac" ]]; then
1104 # nothing fancy needs to be done for javac 1338 # nothing fancy needs to be done for javac
1112 unset JAVAC 1346 unset JAVAC
1113 # try to get value of JAVAC 1347 # try to get value of JAVAC
1114 compiler_executable="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${JAVAC})" 1348 compiler_executable="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${JAVAC})"
1115 export JAVAC=${old_javac} 1349 export JAVAC=${old_javac}
1116 1350
1117 [[ -z ${compiler_executable} ]] && die "JAVAC is empty or undefined in ${compiler_env}" 1351 if [[ -z ${compiler_executable} ]]; then
1118 1352 echo "JAVAC is empty or undefined in ${compiler_env}"
1353 return 1
1354 fi
1355
1119 # check that it's executable 1356 # check that it's executable
1120 if [[ ! -x ${compiler_executable} ]]; then 1357 if [[ ! -x ${compiler_executable} ]]; then
1121 eerror "Could not find ${compiler_executable}!"
1122 die "${compiler_executable} doesn't exist, or isn't executable" 1358 echo "${compiler_executable} doesn't exist, or isn't executable"
1359 return 1
1123 fi 1360 fi
1124 else 1361 else
1125 eerror "Could not find environment file for ${compiler}" 1362 echo "Could not find environment file for ${compiler}"
1126 die "Could not find ${compiler_env}" 1363 return 1
1127 fi 1364 fi
1128 fi 1365 fi
1129 echo ${compiler_executable} 1366 echo ${compiler_executable}
1130} 1367}
1131 1368
1132# ------------------------------------------------------------------------------ 1369# ------------------------------------------------------------------------------
1133# @ebuild-function java-pkg_javac-args 1370# @ebuild-function java-pkg_javac-args
1134# 1371#
1135# If an ebuild uses javac directly, instead of using ejavac, it should call this 1372# If an ebuild uses javac directly, instead of using ejavac, it should call this
1136# to know what -source/-target to use. 1373# to know what -source/-target to use.
1137# 1374#
1138# @return string - arguments to pass to javac, complete with -target and -source 1375# @return string - arguments to pass to javac, complete with -target and -source
1141 debug-print-function ${FUNCNAME} $* 1378 debug-print-function ${FUNCNAME} $*
1142 1379
1143 local want_source="$(java-pkg_get-source)" 1380 local want_source="$(java-pkg_get-source)"
1144 local want_target="$(java-pkg_get-target)" 1381 local want_target="$(java-pkg_get-target)"
1145 1382
1146 local source_str="-source ${want_source}" 1383 local source_str="-source ${want_source}"
1147 local target_str="-target ${want_target}" 1384 local target_str="-target ${want_target}"
1148 1385
1149 debug-print "want source: ${want_source}" 1386 debug-print "want source: ${want_source}"
1150 debug-print "want target: ${want_target}" 1387 debug-print "want target: ${want_target}"
1151 1388
1152 if [[ -z "${want_source}" || -z "${want_target}" ]]; then 1389 if [[ -z "${want_source}" || -z "${want_target}" ]]; then
1153 debug-print "could not find valid -source/-target values" 1390 debug-print "could not find valid -source/-target values for javac"
1154 die "Could not find valid -source/-target values" 1391 echo "Could not find valid -source/-target values for javac"
1392 return 1
1155 else 1393 else
1156 if java-pkg_is-vm-version-ge "1.4"; then 1394 if java-pkg_is-vm-version-ge "1.4"; then
1157 echo "${source_str} ${target_str}" 1395 echo "${source_str} ${target_str}"
1158 else 1396 else
1159 echo "${target_str}" 1397 echo "${target_str}"
1163 1401
1164# TODO document 1402# TODO document
1165java-pkg_get-jni-cflags() { 1403java-pkg_get-jni-cflags() {
1166 local flags="-I${JAVA_HOME}/include" 1404 local flags="-I${JAVA_HOME}/include"
1167 1405
1406 local platform="linux"
1407 use elibc_FreeBSD && platform="freebsd"
1408
1168 # TODO do a check that the directories are valid 1409 # TODO do a check that the directories are valid
1169 # TODO figure out how to cope with other things than linux...
1170 flags="${flags} -I${JAVA_HOME}/include/linux" 1410 flags="${flags} -I${JAVA_HOME}/include/${platform}"
1171 1411
1172 echo ${flags} 1412 echo ${flags}
1173} 1413}
1174 1414
1175java-pkg_ensure-gcj() { 1415java-pkg_ensure-gcj() {
1180 ebeep 5 1420 ebeep 5
1181 die "No GCJ support found!" 1421 die "No GCJ support found!"
1182 fi 1422 fi
1183} 1423}
1184 1424
1425java-pkg_ensure-test() {
1426 if hasq test ${FEATURES} && ! hasq -test ${FEATURES} \
1427 && hasq test ${IUSE} && ! use test;
1428 then
1429 eerror "You specified FEATURES=test, but USE=test is needed"
1430 eerror "to pull in the additional dependencies for testing"
1431 die "Need USE=test enabled"
1432 fi
1433}
1434
1435# ------------------------------------------------------------------------------
1436# @ebuild-function java-pkg_register-ant-task
1437#
1438# Register this package as ant task, so that ant will load it when no specific
1439# ANT_TASKS are specified. Note that even without this registering, all packages
1440# specified in ANT_TASKS will be loaded. Mostly used by the actual ant tasks
1441# packages, but can be also used by other ebuilds that used to symlink their
1442# .jar into /usr/share/ant-core/lib to get autoloaded, for backwards
1443# compatibility.
1444#
1445# @param --version x.y Register only for ant version x.y (otherwise for any ant
1446# version). Used by the ant-* packages to prevent loading of mismatched
1447# ant-core ant tasks after core was updated, before the tasks are updated,
1448# without a need for blockers.
1449# @param $1 Name to register as. Defaults to JAVA_PKG_NAME ($PN[-$SLOT])
1450# ------------------------------------------------------------------------------
1451java-pkg_register-ant-task() {
1452 local TASKS_DIR="tasks"
1453
1454 # check for --version x.y parameters
1455 while [[ -n "${1}" && -n "${2}" ]]; do
1456 local var="${1#--}"
1457 local val="${2}"
1458 if [[ "${var}" == "version" ]]; then
1459 TASKS_DIR="tasks-${val}"
1460 else
1461 die "Unknown parameter passed to java-pkg_register-ant-tasks: ${1} ${2}"
1462 fi
1463 shift 2
1464 done
1465
1466 local TASK_NAME="${1:-${JAVA_PKG_NAME}}"
1467
1468 dodir /usr/share/ant/${TASKS_DIR}
1469 touch "${D}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}"
1470}
1471
1472# ------------------------------------------------------------------------------
1473# @internal-function java-pkg_ant-tasks-from-deps
1474#
1475# Function to determine ANT_TASKS from DEPEND variable for backwards
1476# compatibility with ebuilds that don't set ANT_TASKS before calling eant() or
1477# WANT_ANT_TASKS before inheriting java-pkg-2. If the DEPEND string contains
1478# "dev-java/ant" or "dev-java/ant-tasks", then it returns "all", otherwise
1479# "none". It's not smart enough to cope with USE flag depends but that shouldn't
1480# be a problem, the worst it can do is activace all tasks when not needed.
1481# Note that this is called only with JAVA_PKG_STRICT=1, to find ebuilds with
1482# insufficient dependencies, otherwise all available tasks are used for
1483# backwards compatilbility.
1484#
1485# @return "all" or "none"
1486# ------------------------------------------------------------------------------
1487java-pkg_ant-tasks-from-deps() {
1488 local found_ant found_ant_tasks
1489
1490 for dep in ${DEPEND}
1491 do
1492 local ant="$(awk '/(dev-java\/ant)/ { if (match($1, "(dev-java/ant)((-[0-9])+|$)", m)) print m[1] }' <<< ${dep})"
1493 [[ "${ant}" == "dev-java/ant" ]] && found_ant=true
1494 [[ "${dep}" == *"ant-tasks"* ]] && found_ant_tasks=true
1495 done
1496
1497 if [[ -n "${found_ant}" || -n "${found_ant_tasks}" ]]; then
1498 java-pkg_announce-qa-violation "The ebuild DEPENDS on deprecated ant or ant-tasks"
1499 echo "all"
1500 else
1501 # ebuild doesn't set ANT_TASKS and doesn't depend on ant-tasks or ant
1502 # so we deactivate all tasks that may be installed
1503 echo "none"
1504 fi
1505}
1506
1507# ------------------------------------------------------------------------------
1508# @internal-function java-pkg_ant-tasks-depend
1509#
1510# Translates the WANT_ANT_TASKS variable into valid dependencies.
1511# ------------------------------------------------------------------------------
1512java-pkg_ant-tasks-depend() {
1513 debug-print-function ${FUNCNAME} ${WANT_ANT_TASKS}
1514
1515 if [[ -n "${WANT_ANT_TASKS}" ]]; then
1516 local DEP=""
1517 for i in ${WANT_ANT_TASKS}
1518 do
1519 if [[ ${i} != ant-* ]]; then
1520 echo "Invalid atom in WANT_ANT_TASKS: ${i}"
1521 return 1
1522 fi
1523 DEP="${DEP}dev-java/${i} "
1524 done
1525 echo ${DEP}
1526 return 0
1527 else
1528 return 0
1529 fi
1530}
1531
1185# ------------------------------------------------------------------------------ 1532# ------------------------------------------------------------------------------
1186# @section-end helper 1533# @section-end helper
1187# ------------------------------------------------------------------------------ 1534# ------------------------------------------------------------------------------
1188 1535
1189# ------------------------------------------------------------------------------ 1536# ------------------------------------------------------------------------------
1196 1543
1197# ------------------------------------------------------------------------------ 1544# ------------------------------------------------------------------------------
1198# @ebuild-function eant 1545# @ebuild-function eant
1199# 1546#
1200# Ant wrapper function. Will use the appropriate compiler, based on user-defined 1547# Ant wrapper function. Will use the appropriate compiler, based on user-defined
1201# compiler. 1548# compiler. Will also set proper ANT_TASKS from the variable ANT_TASKS,
1202# 1549# variables:
1550# EANT_GENTOO_CLASSPATH - calls java-pkg_getjars for the value and adds to the
1551# gentoo.classpath property. Be sure to call
1552# java-ant_rewrite-classpath in src_unpack.
1553# *ANT_TASKS - used to determine ANT_TASKS before calling Ant.
1203# ------------------------------------------------------------------------------ 1554# ------------------------------------------------------------------------------
1204eant() { 1555eant() {
1205 debug-print-function ${FUNCNAME} $* 1556 debug-print-function ${FUNCNAME} $*
1206 1557
1207 local antflags 1558 # FIXME get this working
1559# if is-java-strict && [[ ! ${DEPEND} =~ "dev-java/ant" ]]; then
1560# java-pkg_announce-qa-violation \
1561# "Using eant, but not depending on dev-java/ant or dev-java/ant-core"
1562# fi
1563
1564 if ! hasq java-ant-2 ${INHERITED} && is-java-strict; then
1565 local msg="You should inherit java-ant-2 when using eant"
1566 java-pkg_announce-qa-violation ${msg}
1567 die ${msg}
1568 fi
1569
1570 local antflags="-Dnoget=true -Dmaven.mode.offline=true"
1571
1208 java-pkg_init-compiler_ 1572 java-pkg_init-compiler_
1209 local compiler="${GENTOO_COMPILER}" 1573 local compiler="${GENTOO_COMPILER}"
1210 1574
1211 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}" 1575 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}"
1212 1576
1214 if [[ "${compiler}" != "javac" && -z "${build_compiler}" ]]; then 1578 if [[ "${compiler}" != "javac" && -z "${build_compiler}" ]]; then
1215 die "ANT_BUILD_COMPILER undefined in ${compiler_env}" 1579 die "ANT_BUILD_COMPILER undefined in ${compiler_env}"
1216 fi 1580 fi
1217 1581
1218 if [[ ${compiler} != "javac" ]]; then 1582 if [[ ${compiler} != "javac" ]]; then
1219 antflags="-Dbuild.compiler=${build_compiler}" 1583 antflags="${antflags} -Dbuild.compiler=${build_compiler}"
1220 # Figure out any extra stuff to put on the classpath for compilers aside 1584 # Figure out any extra stuff to put on the classpath for compilers aside
1221 # from javac 1585 # from javac
1222 # ANT_BUILD_COMPILER_DEPS should be something that could be passed to 1586 # ANT_BUILD_COMPILER_DEPS should be something that could be passed to
1223 # java-config -p 1587 # java-config -p
1224 local build_compiler_deps="$(source ${JAVA_PKG_COMPILER_DIR}/${compiler} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER_DEPS})" 1588 local build_compiler_deps="$(source ${JAVA_PKG_COMPILER_DIR}/${compiler} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER_DEPS})"
1229 1593
1230 if is-java-strict; then 1594 if is-java-strict; then
1231 einfo "Disabling system classpath for ant" 1595 einfo "Disabling system classpath for ant"
1232 antflags="${antflags} -Dbuild.sysclasspath=ignore" 1596 antflags="${antflags} -Dbuild.sysclasspath=ignore"
1233 fi 1597 fi
1234 1598
1235 if [[ -n ${JAVA_PKG_DEBUG} ]]; then 1599 for arg in "${@}"; do
1236 antflags="${antflags} -debug" 1600 if [[ ${arg} = -lib ]]; then
1601 if is-java-strict; then
1602 eerror "You should not use the -lib argument to eant because it will fail"
1603 eerror "with JAVA_PKG_STRICT. Please use for example java-pkg_jar-from"
1604 eerror "or ant properties to make dependencies available."
1605 eerror "For ant tasks use WANT_ANT_TASKS or ANT_TASKS from."
1606 eerror "split ant (>=dev-java/ant-core-1.7)."
1607 die "eant -lib is deprecated/forbidden"
1608 else
1609 echo "eant -lib is deprecated. Turn JAVA_PKG_STRICT on for"
1610 echo "more info."
1611 fi
1237 fi 1612 fi
1238 1613 done
1614
1615 if has_version ">=dev-java/ant-core-1.7.0"; then
1616 # default ANT_TASKS to WANT_ANT_TASKS, if ANT_TASKS is not set explicitly
1617 ANT_TASKS="${ANT_TASKS:-${WANT_ANT_TASKS}}"
1618
1619 # override ANT_TASKS with JAVA_PKG_FORCE_ANT_TASKS if it's set
1620 ANT_TASKS="${JAVA_PKG_FORCE_ANT_TASKS:-${ANT_TASKS}}"
1621
1622 if is-java-strict; then
1623 # if ant-tasks were not set by ebuild or forced, try to determine them from depends
1624 if [[ -z "${ANT_TASKS}" ]]; then
1625 ANT_TASKS="$(java-pkg_ant-tasks-from-deps)"
1626 fi
1627 else
1628 # if ant-tasks is not set by ebuild or forced, activate all of them
1629 ANT_TASKS="${ANT_TASKS:-all}"
1630 fi
1631
1632 # at this point, ANT_TASKS should be "all", "none" or explicit list
1633 if [[ "${ANT_TASKS}" == "all" ]]; then
1634 einfo "Using all available ANT_TASKS"
1635 elif [[ "${ANT_TASKS}" == "none" ]]; then
1636 einfo "Disabling all optional ANT_TASKS"
1637 else
1638 einfo "Using following ANT_TASKS: ${ANT_TASKS}"
1639 fi
1640
1641 export ANT_TASKS
1642 fi
1643
1644 [[ -n ${JAVA_PKG_DEBUG} ]] && antflags="${antflags} --execdebug -debug"
1645 [[ -n ${PORTAGE_QUIET} ]] && antflags="${antflags} -q"
1646
1647 local gcp="${EANT_GENTOO_CLASSPATH}"
1648
1649 if [[ ${EBUILD_PHASE} = "test" ]]; then
1650 antflags="${antflags} -DJunit.present=true"
1651 [[ ${gcp} && ${ANT_TASKS} = *ant-junit* ]] && gcp="${gcp} junit"
1652 fi
1653
1654 local cp
1655
1656 for atom in ${gcp}; do
1657 cp="${cp}:$(java-pkg_getjars ${atom})"
1658 done
1659
1660 if [[ ${cp} ]]; then
1661 # It seems ant does not like single quotes around ${cp}
1662 antflags="${antflags} -Dgentoo.classpath=\"${cp#:}\""
1663 fi
1664
1239 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ant ${antflags} "${@}" 1665 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ant ${antflags} "${@}"
1666 debug-print "Calling ant: ${antflags} ${@}"
1240 ant ${antflags} "${@}" || die "eant failed" 1667 ant ${antflags} "${@}" || die "eant failed"
1241 1668
1242} 1669}
1243 1670
1244# ------------------------------------------------------------------------------ 1671# ------------------------------------------------------------------------------
1245# @ebuild-function ejavac 1672# @ebuild-function ejavac
1246# 1673#
1247# Javac wrapper function. Will use the appropriate compiler, based on 1674# Javac wrapper function. Will use the appropriate compiler, based on
1248# /etc/java-config/compilers.conf 1675# /etc/java-config/compilers.conf
1249# 1676#
1250# @param $@ - Arguments to be passed to the compiler 1677# @param $@ - Arguments to be passed to the compiler
1251# ------------------------------------------------------------------------------ 1678# ------------------------------------------------------------------------------
1252ejavac() { 1679ejavac() {
1253 debug-print-function ${FUNCNAME} $* 1680 debug-print-function ${FUNCNAME} $*
1254 1681
1255 # FIXME using get-javac ends up printing stuff with einfo 1682 java-pkg_init-compiler_
1683
1684 local compiler_executable
1256# local compiler_executable=$(java-pkg_get-javac) 1685 compiler_executable=$(java-pkg_get-javac)
1257 local compiler_executable="javac" 1686 if [[ ${?} != 0 ]]; then
1687 eerror "There was a problem determining compiler: ${compiler_executable}"
1688 die "get-javac failed"
1689 fi
1258 1690
1691 local javac_args
1692 javac_args="$(java-pkg_javac-args)"
1693 if [[ ${?} != 0 ]]; then
1694 eerror "There was a problem determining JAVACFLAGS: ${javac_args}"
1695 die "java-pkg_javac-args failed"
1696 fi
1697
1259 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} $(java-pkg_javac-args) "${@}" 1698 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} ${javac_args} "${@}"
1260 ${compiler_executable} $(java-pkg_javac-args) "${@}" || die "ejavac failed" 1699 ${compiler_executable} ${javac_args} "${@}" || die "ejavac failed"
1261} 1700}
1262 1701
1263# ------------------------------------------------------------------------------ 1702# ------------------------------------------------------------------------------
1264# @ebuild-function java-pkg_filter-compiler 1703# @ebuild-function java-pkg_filter-compiler
1265# 1704#
1266# Used to prevent the use of some compilers. Should be used in src_compile. 1705# Used to prevent the use of some compilers. Should be used in src_compile.
1267# Basically, it just appends onto JAVA_PKG_FILTER_COMPILER 1706# Basically, it just appends onto JAVA_PKG_FILTER_COMPILER
1268# 1707#
1269# @param $@ - compilers to filter 1708# @param $@ - compilers to filter
1270# ------------------------------------------------------------------------------ 1709# ------------------------------------------------------------------------------
1288# ------------------------------------------------------------------------------ 1727# ------------------------------------------------------------------------------
1289# @ebuild-function use_doc 1728# @ebuild-function use_doc
1290# 1729#
1291# Helper function for getting ant to build javadocs. If the user has USE=doc, 1730# Helper function for getting ant to build javadocs. If the user has USE=doc,
1292# then 'javadoc' or the argument are returned. Otherwise, there is no return. 1731# then 'javadoc' or the argument are returned. Otherwise, there is no return.
1293# 1732#
1294# The output of this should be passed to ant. 1733# The output of this should be passed to ant.
1295# 1734#
1296# Example: build javadocs by calling 'javadoc' target 1735# Example: build javadocs by calling 'javadoc' target
1297# eant $(use_doc) 1736# eant $(use_doc)
1298# Example: build javadocs by calling 'apidoc' target 1737# Example: build javadocs by calling 'apidoc' target
1303# ------------------------------------------------------------------------------ 1742# ------------------------------------------------------------------------------
1304use_doc() { 1743use_doc() {
1305 use doc && echo ${@:-javadoc} 1744 use doc && echo ${@:-javadoc}
1306} 1745}
1307 1746
1747
1308# ------------------------------------------------------------------------------ 1748# ------------------------------------------------------------------------------
1309# @section-end build 1749# @section-end build
1310# ------------------------------------------------------------------------------ 1750# ------------------------------------------------------------------------------
1311 1751
1312# ------------------------------------------------------------------------------ 1752# ------------------------------------------------------------------------------
1313# @section-begin internal 1753# @section-begin internal
1314# @section-summary Internal functions 1754# @section-summary Internal functions
1315# 1755#
1316# Do __NOT__ use any of these from an ebuild! These are only to be used from 1756# Do __NOT__ use any of these from an ebuild! These are only to be used from
1317# within the java eclasses. 1757# within the java eclasses.
1318# ------------------------------------------------------------------------------ 1758# ------------------------------------------------------------------------------
1319 1759
1320# ----------------------------------------------------------------------------- 1760# -----------------------------------------------------------------------------
1321# @function-internal java-pkg_init 1761# @function-internal java-pkg_init
1322# 1762#
1323# The purpose of this function, as the name might imply, is to initialize the 1763# The purpose of this function, as the name might imply, is to initialize the
1324# Java environment. It ensures that that there aren't any environment variables 1764# Java environment. It ensures that that there aren't any environment variables
1325# that'll muss things up. It initializes some variables, which are used 1765# that'll muss things up. It initializes some variables, which are used
1326# internally. And most importantly, it'll switch the VM if necessary. 1766# internally. And most importantly, it'll switch the VM if necessary.
1327# 1767#
1339 # TODO we will probably want to set JAVAC and JAVACFLAGS 1779 # TODO we will probably want to set JAVAC and JAVACFLAGS
1340 1780
1341 # Do some QA checks 1781 # Do some QA checks
1342 java-pkg_check-jikes 1782 java-pkg_check-jikes
1343 1783
1344 # When users have crazy classpaths some packages can fail to compile. 1784 # When users have crazy classpaths some packages can fail to compile.
1345 # and everything should work with empty CLASSPATH. 1785 # and everything should work with empty CLASSPATH.
1346 # This also helps prevent unexpected dependencies on random things 1786 # This also helps prevent unexpected dependencies on random things
1347 # from the CLASSPATH. 1787 # from the CLASSPATH.
1348 unset CLASSPATH 1788 unset CLASSPATH
1789
1790 # Unset external ANT_ stuff
1791 unset ANT_TASKS
1792 unset ANT_OPTS
1349} 1793}
1350 1794
1351# ------------------------------------------------------------------------------ 1795# ------------------------------------------------------------------------------
1352# @function-internal java-pkg-init-compiler_ 1796# @function-internal java-pkg-init-compiler_
1353# 1797#
1354# This function attempts to figure out what compiler should be used. It does 1798# This function attempts to figure out what compiler should be used. It does
1355# this by reading the file at JAVA_PKG_COMPILERS_CONF, and checking the 1799# this by reading the file at JAVA_PKG_COMPILERS_CONF, and checking the
1356# COMPILERS variable defined there. 1800# COMPILERS variable defined there.
1357# This can be overridden by a list in JAVA_PKG_FORCE_COMPILER 1801# This can be overridden by a list in JAVA_PKG_FORCE_COMPILER
1358# 1802#
1359# It will go through the list of compilers, and verify that it supports the 1803# It will go through the list of compilers, and verify that it supports the
1360# target and source that are needed. If it is not suitable, then the next 1804# target and source that are needed. If it is not suitable, then the next
1361# compiler is checked. When JAVA_PKG_FORCE_COMPILER is defined, this checking 1805# compiler is checked. When JAVA_PKG_FORCE_COMPILER is defined, this checking
1362# isn't done. 1806# isn't done.
1363# 1807#
1385 if [[ -z ${JAVA_PKG_FORCE_COMPILER} ]]; then 1829 if [[ -z ${JAVA_PKG_FORCE_COMPILER} ]]; then
1386 compilers="$(source ${JAVA_PKG_COMPILERS_CONF} 1>/dev/null 2>&1; echo ${COMPILERS})" 1830 compilers="$(source ${JAVA_PKG_COMPILERS_CONF} 1>/dev/null 2>&1; echo ${COMPILERS})"
1387 else 1831 else
1388 compilers=${JAVA_PKG_FORCE_COMPILER} 1832 compilers=${JAVA_PKG_FORCE_COMPILER}
1389 fi 1833 fi
1390 1834
1391 debug-print "Read \"${compilers}\" from ${JAVA_PKG_COMPILERS_CONF}" 1835 debug-print "Read \"${compilers}\" from ${JAVA_PKG_COMPILERS_CONF}"
1392 1836
1393 # Figure out if we should announce what compiler we're using 1837 # Figure out if we should announce what compiler we're using
1394 local compiler 1838 local compiler
1395 for compiler in ${compilers}; do 1839 for compiler in ${compilers}; do
1398 if [[ ${compiler} = "javac" ]]; then 1842 if [[ ${compiler} = "javac" ]]; then
1399 debug-print "Found javac... breaking" 1843 debug-print "Found javac... breaking"
1400 export GENTOO_COMPILER="javac" 1844 export GENTOO_COMPILER="javac"
1401 break 1845 break
1402 fi 1846 fi
1403 1847
1404 if has ${compiler} ${JAVA_PKG_FILTER_COMPILER}; then 1848 if has ${compiler} ${JAVA_PKG_FILTER_COMPILER}; then
1405 if [[ -z ${JAVA_PKG_FORCE_COMPILER} ]]; then 1849 if [[ -z ${JAVA_PKG_FORCE_COMPILER} ]]; then
1406 einfo "Filtering ${compiler}" 1850 einfo "Filtering ${compiler}"
1407 continue 1851 continue
1408 fi 1852 fi
1409 fi 1853 fi
1410 1854
1411 # for non-javac, we need to make sure it supports the right target and 1855 # for non-javac, we need to make sure it supports the right target and
1412 # source 1856 # source
1413 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}" 1857 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}"
1414 if [[ -f ${compiler_env} ]]; then 1858 if [[ -f ${compiler_env} ]]; then
1415 local desired_target="$(java-pkg_get-target)" 1859 local desired_target="$(java-pkg_get-target)"
1497# Writes the package.env out to disk. 1941# Writes the package.env out to disk.
1498# 1942#
1499# ------------------------------------------------------------------------------ 1943# ------------------------------------------------------------------------------
1500# TODO change to do-write, to match everything else 1944# TODO change to do-write, to match everything else
1501java-pkg_do_write_() { 1945java-pkg_do_write_() {
1946 java-pkg_init_paths_
1502 # Create directory for package.env 1947 # Create directory for package.env
1503 dodir "${JAVA_PKG_SHAREPATH}" 1948 dodir "${JAVA_PKG_SHAREPATH}"
1504 if [[ -n "${JAVA_PKG_CLASSPATH}" || -n "${JAVA_PKG_LIBRARY}" || -f "${JAVA_PKG_DEPEND}" ]]; then 1949 if [[ -n "${JAVA_PKG_CLASSPATH}" || -n "${JAVA_PKG_LIBRARY}" || -f "${JAVA_PKG_DEPEND}" ]]; then
1505 # Create package.env 1950 # Create package.env
1506 ( 1951 (
1511 [[ -n "${JAVA_PKG_LIBRARY}" ]] && echo "LIBRARY_PATH=\"${JAVA_PKG_LIBRARY}\"" 1956 [[ -n "${JAVA_PKG_LIBRARY}" ]] && echo "LIBRARY_PATH=\"${JAVA_PKG_LIBRARY}\""
1512 [[ -n "${JAVA_PROVIDE}" ]] && echo "PROVIDES=\"${JAVA_PROVIDE}\"" 1957 [[ -n "${JAVA_PROVIDE}" ]] && echo "PROVIDES=\"${JAVA_PROVIDE}\""
1513 [[ -f "${JAVA_PKG_DEPEND}" ]] && echo "DEPEND=\"$(cat ${JAVA_PKG_DEPEND} | uniq | tr '\n' ':')\"" 1958 [[ -f "${JAVA_PKG_DEPEND}" ]] && echo "DEPEND=\"$(cat ${JAVA_PKG_DEPEND} | uniq | tr '\n' ':')\""
1514 echo "VM=\"$(echo ${RDEPEND} ${DEPEND} | sed -e 's/ /\n/g' | sed -n -e '/virtual\/\(jre\|jdk\)/ { p;q }')\"" # TODO cleanup ! 1959 echo "VM=\"$(echo ${RDEPEND} ${DEPEND} | sed -e 's/ /\n/g' | sed -n -e '/virtual\/\(jre\|jdk\)/ { p;q }')\"" # TODO cleanup !
1515 ) > "${JAVA_PKG_ENV}" 1960 ) > "${JAVA_PKG_ENV}"
1516 1961
1517 # register target/source 1962 # register target/source
1518 local target="$(java-pkg_get-target)" 1963 local target="$(java-pkg_get-target)"
1519 local source="$(java-pkg_get-source)" 1964 local source="$(java-pkg_get-source)"
1520 [[ -n ${target} ]] && echo "TARGET=\"${target}\"" >> "${JAVA_PKG_ENV}" 1965 [[ -n ${target} ]] && echo "TARGET=\"${target}\"" >> "${JAVA_PKG_ENV}"
1521 [[ -n ${source} ]] && echo "SOURCE=\"${source}\"" >> "${JAVA_PKG_ENV}" 1966 [[ -n ${source} ]] && echo "SOURCE=\"${source}\"" >> "${JAVA_PKG_ENV}"
1534 # Strip unnecessary leading and trailing colons 1979 # Strip unnecessary leading and trailing colons
1535 # TODO try to cleanup if possible 1980 # TODO try to cleanup if possible
1536 sed -e "s/=\":/=\"/" -e "s/:\"$/\"/" -i "${JAVA_PKG_ENV}" || die "Did you forget to call java_init ?" 1981 sed -e "s/=\":/=\"/" -e "s/:\"$/\"/" -i "${JAVA_PKG_ENV}" || die "Did you forget to call java_init ?"
1537 fi 1982 fi
1538} 1983}
1539
1540 1984
1541# ------------------------------------------------------------------------------ 1985# ------------------------------------------------------------------------------
1542# @internal-function java-pkg_record-jar_ 1986# @internal-function java-pkg_record-jar_
1543# 1987#
1544# Record a dependency to the package.env 1988# Record a dependency to the package.env
1588 fi 2032 fi
1589} 2033}
1590 2034
1591# ------------------------------------------------------------------------------ 2035# ------------------------------------------------------------------------------
1592# @internal-function java-pkg_expand_dir_ 2036# @internal-function java-pkg_expand_dir_
1593# 2037#
1594# Gets the full path of the file/directory's parent. 2038# Gets the full path of the file/directory's parent.
1595# @param $1 - file/directory to find parent directory for 2039# @param $1 - file/directory to find parent directory for
1596# @return - path to $1's parent directory 2040# @return - path to $1's parent directory
1597# ------------------------------------------------------------------------------ 2041# ------------------------------------------------------------------------------
1598java-pkg_expand_dir_() { 2042java-pkg_expand_dir_() {
1625# ------------------------------------------------------------------------------ 2069# ------------------------------------------------------------------------------
1626java-pkg_setup-vm() { 2070java-pkg_setup-vm() {
1627 debug-print-function ${FUNCNAME} $* 2071 debug-print-function ${FUNCNAME} $*
1628 2072
1629 local vendor="$(java-pkg_get-vm-vendor)" 2073 local vendor="$(java-pkg_get-vm-vendor)"
1630 if [[ "${vendor}" == "sun" ]] && java-pkg_is-vm-version-ge 1 5; then 2074 if [[ "${vendor}" == "sun" ]] && java-pkg_is-vm-version-ge "1.5" ; then
1631 addpredict "/dev/random" 2075 addpredict "/dev/random"
1632 elif [[ "${vendor}" == "ibm" ]]; then 2076 elif [[ "${vendor}" == "ibm" ]]; then
1633 addpredict "/proc/self/maps" 2077 addpredict "/proc/self/maps"
1634 addpredict "/proc/cpuinfo" 2078 addpredict "/proc/cpuinfo"
1635 export LANG="C" LC_ALL="C" 2079 export LANG="C" LC_ALL="C"
1684# @return - The version of the current VM 2128# @return - The version of the current VM
1685# ------------------------------------------------------------------------------ 2129# ------------------------------------------------------------------------------
1686java-pkg_get-vm-version() { 2130java-pkg_get-vm-version() {
1687 debug-print-function ${FUNCNAME} $* 2131 debug-print-function ${FUNCNAME} $*
1688 2132
1689 java-pkg_get-current-vm | sed -e "s/.*-\([0-9.]\+\).*/\1/" 2133 java-config -g PROVIDES_VERSION
1690} 2134}
1691 2135
1692# ------------------------------------------------------------------------------ 2136# ------------------------------------------------------------------------------
1693# @internal-function java-pkg_switch-vm 2137# @internal-function java-pkg_switch-vm
1694# 2138#
1695# Switch VM if we're allowed to (controlled by JAVA_PKG_ALLOW_VM_CHANGE), and 2139# Switch VM if we're allowed to (controlled by JAVA_PKG_ALLOW_VM_CHANGE), and
1696# verify that the current VM is sufficient. 2140# verify that the current VM is sufficient.
1697# Setup the environment for the VM being used. 2141# Setup the environment for the VM being used.
1698# ------------------------------------------------------------------------------ 2142# ------------------------------------------------------------------------------
1699java-pkg_switch-vm() { 2143java-pkg_switch-vm() {
2144 debug-print-function ${FUNCNAME} $*
2145
1700 if java-pkg_needs-vm; then 2146 if java-pkg_needs-vm; then
1701 # Use the VM specified by JAVA_PKG_FORCE_VM 2147 # Use the VM specified by JAVA_PKG_FORCE_VM
1702 if [[ -n ${JAVA_PKG_FORCE_VM} ]]; then 2148 if [[ -n "${JAVA_PKG_FORCE_VM}" ]]; then
1703 # If you're forcing the VM, I hope you know what your doing... 2149 # If you're forcing the VM, I hope you know what your doing...
2150 debug-print "JAVA_PKG_FORCE_VM used: ${JAVA_PKG_FORCE_VM}"
1704 export GENTOO_VM="${JAVA_PKG_FORCE_VM}" 2151 export GENTOO_VM="${JAVA_PKG_FORCE_VM}"
1705 # if we're allowed to switch the vm... 2152 # if we're allowed to switch the vm...
1706 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then 2153 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then
1707 debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}" 2154 debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}"
1708 if [[ -n ${JAVA_PKG_VNEED} ]]; then 2155 if [[ -n ${JAVA_PKG_VNEED} ]]; then
1709 export GENTOO_VM="$(depend-java-query --need-virtual "${JAVA_PKG_VNEED}" --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")" 2156 GENTOO_VM="$(depend-java-query --need-virtual "${JAVA_PKG_VNEED}" --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")"
1710 else 2157 else
1711 export GENTOO_VM="$(depend-java-query --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")" 2158 GENTOO_VM="$(depend-java-query --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")"
2159 fi
2160 if [[ -z "${GENTOO_VM}" || "${GENTOO_VM}" == "None" ]]; then
2161 eerror "Unable to determine VM for building from dependencies:"
2162 echo "NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}}"
2163 echo "VNEED: ${JAVA_PKG_VNEED}"
2164 die "Failed to determine VM for building."
2165 else
2166 export GENTOO_VM
1712 fi 2167 fi
1713 # otherwise just make sure the current VM is sufficient 2168 # otherwise just make sure the current VM is sufficient
1714 else 2169 else
1715 java-pkg_ensure-vm-version-sufficient 2170 java-pkg_ensure-vm-version-sufficient
1716 fi 2171 fi
1717 debug-print "Using: $(java-config -f)" 2172 debug-print "Using: $(java-config -f)"
1718 2173
1719 java-pkg_setup-vm 2174 java-pkg_setup-vm
1720 2175
1721 export JAVA=$(java-config --java) 2176 export JAVA=$(java-config --java)
1722 export JAVAC=$(java-config --javac) 2177 export JAVAC=$(java-config --javac)
1723 export JAVACFLAGS="$(java-pkg_javac-args)" 2178 JAVACFLAGS="$(java-pkg_javac-args)"
2179 if [[ ${?} != 0 ]]; then
2180 eerror "There was a problem determining JAVACFLAGS: ${JAVACFLAGS}"
2181 die "java-pkg_javac-args failed"
2182 fi
1724 [[ -n ${JAVACFLAGS_EXTRA} ]] && export JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}" 2183 [[ -n ${JAVACFLAGS_EXTRA} ]] && JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}"
2184 export JAVACFLAGS
1725 2185
1726 export JAVA_HOME="$(java-config -g JAVA_HOME)" 2186 export JAVA_HOME="$(java-config -g JAVA_HOME)"
1727 export JDK_HOME=${JAVA_HOME} 2187 export JDK_HOME=${JAVA_HOME}
1728 2188
1729 #TODO If you know a better solution let us know. 2189 #TODO If you know a better solution let us know.
1730 java-pkg_append_ LD_LIBRARY_PATH "$(java-config -g LDPATH)" 2190 java-pkg_append_ LD_LIBRARY_PATH "$(java-config -g LDPATH)"
1731 2191
1732 local tann="${T}/announced-vm" 2192 local tann="${T}/announced-vm"
1733 if [[ -n "${JAVA_PKG_DEBUG}" ]] || [[ ! -f "${tann}" ]] ; then 2193 if [[ -n "${JAVA_PKG_DEBUG}" ]] || [[ ! -f "${tann}" ]] ; then
1734 # Add a check for setup/preinst phase... to avoid duplicate outputs 2194 # Add a check for setup/preinst phase... to avoid duplicate outputs
1735 # for when FEATURES=buildpkg 2195 # for when FEATURES=buildpkg
1736 if [[ ${EBUILD_PHASE} != "setup" && ${EBUILD_PHASE} != "preinst" && ${EBUILD_PHASE} != "postinst" ]]; 2196 if [[ ${EBUILD_PHASE} != "setup" && ${EBUILD_PHASE} != "preinst" && ${EBUILD_PHASE} != "postinst" ]];
1775 einfo "Classes" 2235 einfo "Classes"
1776 find "${S}" -type f -name '*.class' -print0 | xargs -0 -r -n 500 ls -ald | sed -e "s,${WORKDIR},\${WORKDIR}," 2236 find "${S}" -type f -name '*.class' -print0 | xargs -0 -r -n 500 ls -ald | sed -e "s,${WORKDIR},\${WORKDIR},"
1777 fi 2237 fi
1778} 2238}
1779 2239
1780# TODO document 2240# ------------------------------------------------------------------------------
2241# @internal-function java-pkg_verify-classes
2242#
1781# Verify that the classes were compiled for the right source / target 2243# Verify that the classes were compiled for the right source / target. Dies if
2244# not.
2245# @param $1 (optional) - the file to check, otherwise checks whole ${D}
2246# ------------------------------------------------------------------------------
1782java-pkg_verify-classes() { 2247java-pkg_verify-classes() {
1783 ebegin "Verifying java class versions"
1784 #$(find ${D} -type f -name '*.jar' -o -name '*.class') 2248 #$(find ${D} -type f -name '*.jar' -o -name '*.class')
1785 class-version-verify.py -t $(java-pkg_get-target) -r ${D} 2249 local target=$(java-pkg_get-target)
2250 local result
2251 local log="${T}/class-version-verify.log"
2252 if [[ -n "${1}" ]]; then
2253 class-version-verify.py -v -t ${target} "${1}" > "${log}"
1786 result=$? 2254 result=$?
1787 eend ${result}
1788 if [[ ${result} == 0 ]]; then
1789 einfo "All good"
1790 else 2255 else
1791 ewarn "Possible problem" 2256 ebegin "Verifying java class versions (target: ${target})"
1792 die "Bad class files found" 2257 class-version-verify.py -v -t ${target} -r "${D}" > "${log}"
2258 result=$?
2259 eend ${result}
1793 fi 2260 fi
2261 [[ -n ${JAVA_PKG_DEBUG} ]] && cat "${log}"
2262 if [[ ${result} != 0 ]]; then
2263 eerror "Incorrect bytecode version found"
2264 [[ -n "${1}" ]] && eerror "in file: ${1}"
2265 eerror "See ${log} for more details."
2266 die "Incorrect bytecode found"
2267 fi
1794} 2268}
1795
1796 2269
1797# ------------------------------------------------------------------------------ 2270# ------------------------------------------------------------------------------
1798# @section-end internal 2271# @section-end internal
1799# ------------------------------------------------------------------------------ 2272# ------------------------------------------------------------------------------
1800 2273
1832 let "JAVA_PKG_QA_VIOLATIONS+=1" 2305 let "JAVA_PKG_QA_VIOLATIONS+=1"
1833 export JAVA_PKG_QA_VIOLATIONS 2306 export JAVA_PKG_QA_VIOLATIONS
1834} 2307}
1835 2308
1836is-java-strict() { 2309is-java-strict() {
1837 hasq java-strict ${FEATURES}; 2310 [[ -n ${JAVA_PKG_STRICT} ]]
1838 return $? 2311 return $?
1839} 2312}
1840 2313
1841# ------------------------------------------------------------------------------ 2314# ------------------------------------------------------------------------------
1842# @eclass-end 2315# @eclass-end

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.62

  ViewVC Help
Powered by ViewVC 1.1.20