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

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

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

Revision 1.3 Revision 1.25
3# Copyright (c) 2004-2005, Thomas Matthijs <axxo@gentoo.org> 3# Copyright (c) 2004-2005, Thomas Matthijs <axxo@gentoo.org>
4# Copyright (c) 2004-2005, Gentoo Foundation 4# Copyright (c) 2004-2005, Gentoo Foundation
5# 5#
6# Licensed under the GNU General Public License, v2 6# Licensed under the GNU General Public License, v2
7# 7#
8# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.25 2007/11/13 19:36:50 betelgeuse Exp $
8 9
9inherit java-utils-2 10inherit java-utils-2
10 11
11# ----------------------------------------------------------------------------- 12# -----------------------------------------------------------------------------
12# @eclass-begin 13# @eclass-begin
13# @eclass-summary Eclass for Java Packages 14# @eclass-summary Eclass for Java Packages
14# 15#
15# This eclass should be inherited for pure Java packages, or by packages which 16# This eclass should be inherited for pure Java packages, or by packages which
16# need to use Java. 17# need to use Java.
17# ----------------------------------------------------------------------------- 18# -----------------------------------------------------------------------------
19
20# ------------------------------------------------------------------------------
21# @IUSE
22#
23# Use JAVA_PKG_IUSE instead of IUSE for doc, source and examples so that
24# the eclass can automatically add the needed dependencies for the java-pkg_do*
25# functions.
26#
27# ------------------------------------------------------------------------------
28IUSE="${JAVA_PKG_IUSE}"
18 29
19# ------------------------------------------------------------------------------ 30# ------------------------------------------------------------------------------
20# @depend 31# @depend
21# 32#
22# Java packages need java-config, and a fairly new release of Portage. 33# Java packages need java-config, and a fairly new release of Portage.
30# 41#
31# Nothing special for RDEPEND... just the same as DEPEND. 42# Nothing special for RDEPEND... just the same as DEPEND.
32# ------------------------------------------------------------------------------ 43# ------------------------------------------------------------------------------
33RDEPEND="${DEPEND}" 44RDEPEND="${DEPEND}"
34 45
35EXPORT_FUNCTIONS pkg_setup 46EXPORT_FUNCTIONS pkg_setup src_compile
36 47
37# ------------------------------------------------------------------------------ 48# ------------------------------------------------------------------------------
38# @eclass-pkg_setup 49# @eclass-pkg_setup
39# 50#
40# pkg_setup initializes the Java environment 51# pkg_setup initializes the Java environment
41# ------------------------------------------------------------------------------ 52# ------------------------------------------------------------------------------
42java-pkg-2_pkg_setup() { 53java-pkg-2_pkg_setup() {
43 java-pkg_init 54 java-pkg_init
55 java-pkg_ensure-test
44} 56}
45 57
46# ------------------------------------------------------------------------------ 58# ------------------------------------------------------------------------------
47# @note 59# @eclass-src_compile
48# 60#
49# We need to initialize the environment in every function because Portage 61# Default src_compile for java packages
50# will source /etc/profile between phases and trample all over the env. 62# variables:
51# This is accomplished by phase hooks, which is available with newer versions of 63# EANT_BUILD_XML - controls the location of the build.xml (default: ./build.xml)
52# portage. 64# EANT_FILTER_COMPILER - Calls java-pkg_filter-compiler with the value
65# EANT_BUILD_TARGET - the ant target/targets to execute (default: jar)
66# EANT_DOC_TARGET - the target to build extra docs under the doc use flag
67# (default: javadoc; declare empty to disable completely)
68# EANT_GENTOO_CLASSPATH - @see eant documention in java-utils-2.eclass
69# EANT_EXTRA_ARGS - extra arguments to pass to eant
70# EANT_ANT_TASKS - modifies the ANT_TASKS variable in the eant environment
71# param: Parameters are passed to ant verbatim
53# ------------------------------------------------------------------------------ 72# ------------------------------------------------------------------------------
54
55pre_pkg_setup() {
56 java-pkg-2_pkg_setup
57}
58
59pre_src_unpack() {
60 java-pkg-2_pkg_setup
61}
62
63pre_src_compile() { 73java-pkg-2_src_compile() {
64 java-pkg-2_pkg_setup 74 if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then
65} 75 [[ "${EANT_FILTER_COMPILER}" ]] && \
66 76 java-pkg_filter-compiler ${EANT_FILTER_COMPILER}
67pre_src_install() { 77 local antflags="${EANT_BUILD_TARGET:=jar}"
68 java-pkg-2_pkg_setup 78 if hasq doc ${IUSE} && [[ -n "${EANT_DOC_TARGET=javadoc}" ]]; then
69} 79 antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})"
70 80 fi
71pre_src_test() { 81 local tasks
72 java-pkg-2_pkg_setup 82 [[ ${EANT_ANT_TASKS} ]] && tasks="${ANT_TASKS} ${EANT_ANT_TASKS}"
73} 83 ANT_TASKS="${tasks:-${ANT_TASKS}}" \
74 84 eant ${antflags} -f "${EANT_BUILD_XML}" ${EANT_EXTRA_ARGS} "${@}"
75pre_pkg_preinst() { 85 else
76 java-pkg-2_pkg_setup 86 echo "${FUNCNAME}: ${EANT_BUILD_XML} not found so nothing to do."
77} 87 fi
78
79pre_pkg_postinst() {
80 java-pkg-2_pkg_setup
81} 88}
82 89
83# ------------------------------------------------------------------------------ 90# ------------------------------------------------------------------------------
84# @eclass-end 91# @eclass-end
85# ------------------------------------------------------------------------------ 92# ------------------------------------------------------------------------------

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.20