/[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.13
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.13 2007/01/16 21:11:29 betelgeuse Exp $
8 9
9inherit java-utils-2 10inherit java-utils-2
11
12ECLASS="java-pkg-2"
13INHERITED="${INHERITED} ${ECLASS}"
10 14
11# ----------------------------------------------------------------------------- 15# -----------------------------------------------------------------------------
12# @eclass-begin 16# @eclass-begin
13# @eclass-summary Eclass for Java Packages 17# @eclass-summary Eclass for Java Packages
14# 18#
15# This eclass should be inherited for pure Java packages, or by packages which 19# This eclass should be inherited for pure Java packages, or by packages which
16# need to use Java. 20# need to use Java.
17# ----------------------------------------------------------------------------- 21# -----------------------------------------------------------------------------
18 22
19# ------------------------------------------------------------------------------ 23# ------------------------------------------------------------------------------
24# @IUSE
25#
26# ebuilds using this eclass can set JAVA_PKG_IUSE and then this eclass
27# will automatically add deps for them.
28#
29# ------------------------------------------------------------------------------
30IUSE="${JAVA_PKG_IUSE}"
31
32# ------------------------------------------------------------------------------
20# @depend 33# @depend
21# 34#
22# Java packages need java-config, and a fairly new release of Portage. 35# Java packages need java-config, and a fairly new release of Portage.
23# 36#
24# JAVA_PKG_E_DEPEND is defined in java-utils.eclass. 37# JAVA_PKG_E_DEPEND is defined in java-utils.eclass.
25# ------------------------------------------------------------------------------ 38# ------------------------------------------------------------------------------
26DEPEND="${JAVA_PKG_E_DEPEND}" 39DEPEND="${JAVA_PKG_E_DEPEND}"
27 40
41hasq source ${JAVA_PKG_IUSE} && DEPEND="${DEPEND} source? ( app-arch/zip )"
42
28# ------------------------------------------------------------------------------ 43# ------------------------------------------------------------------------------
29# @rdepend 44# @rdepend
30# 45#
31# Nothing special for RDEPEND... just the same as DEPEND. 46# Nothing special for RDEPEND... just the same as DEPEND.
32# ------------------------------------------------------------------------------ 47# ------------------------------------------------------------------------------
33RDEPEND="${DEPEND}" 48RDEPEND="${DEPEND}"
34 49
35EXPORT_FUNCTIONS pkg_setup 50EXPORT_FUNCTIONS pkg_setup src_compile
36 51
37# ------------------------------------------------------------------------------ 52# ------------------------------------------------------------------------------
38# @eclass-pkg_setup 53# @eclass-pkg_setup
39# 54#
40# pkg_setup initializes the Java environment 55# pkg_setup initializes the Java environment
41# ------------------------------------------------------------------------------ 56# ------------------------------------------------------------------------------
42java-pkg-2_pkg_setup() { 57java-pkg-2_pkg_setup() {
43 java-pkg_init 58 java-pkg_init
59 java-pkg_ensure-test
60}
61
62# ------------------------------------------------------------------------------
63# @eclass-src_compile
64#
65# Default src_compile for java packages
66# variables:
67# EANT_BUILD_XML - controls the location of the build.xml (default: ./build.xml)
68# EANT_FILTER_COMPILER - Calls java-pkg_filter-compiler with the value
69# EANT_BUILD_TARGET - the ant target/targets to execute (default: jar)
70# EANT_DOC_TARGET - the target to build extra docs under the doc use flag
71# (default: the one provided by use_doc in
72# java-utils-2.eclass)
73# EANT_GENTOO_CLASSPATH - @see eant documention in java-utils-2.eclass
74# EANT_EXTRA_ARGUMENTS - extra arguments to pass to eant
75# ------------------------------------------------------------------------------
76java-pkg-2_src_compile() {
77 if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then
78 [[ "${EANT_FILTER_COMPILER}" ]] && \
79 java-pkg_filter-compiler ${EANT_FILTER_COMPILER}
80
81 local antflags="${EANT_BUILD_TARGET:=jar}"
82 hasq doc ${IUSE} && antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})"
83 eant ${antflags} -f "${EANT_BUILD_XML}" ${EANT_EXTRA_ARGUMENTS}
84 else
85 echo "${FUNCNAME}: No build.xml found so nothing to do."
86 fi
44} 87}
45 88
46# ------------------------------------------------------------------------------ 89# ------------------------------------------------------------------------------
47# @note 90# @note
48# 91#
59pre_src_unpack() { 102pre_src_unpack() {
60 java-pkg-2_pkg_setup 103 java-pkg-2_pkg_setup
61} 104}
62 105
63pre_src_compile() { 106pre_src_compile() {
107 if is-java-strict; then
108 echo "Searching for bundled jars:"
109 java-pkg_find-normal-jars || echo "None found."
110 fi
64 java-pkg-2_pkg_setup 111 java-pkg-2_pkg_setup
65} 112}
66 113
67pre_src_install() { 114pre_src_install() {
68 java-pkg-2_pkg_setup 115 java-pkg-2_pkg_setup

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

  ViewVC Help
Powered by ViewVC 1.1.20