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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Sun Dec 17 16:44:06 2006 UTC (8 years ago) by betelgeuse
Branch: MAIN
Changes since 1.5: +23 -2 lines
Added default src_compile.

1 nichoj 1.1 # Eclass for Java packages
2     #
3     # Copyright (c) 2004-2005, Thomas Matthijs <axxo@gentoo.org>
4     # Copyright (c) 2004-2005, Gentoo Foundation
5     #
6     # Licensed under the GNU General Public License, v2
7     #
8 betelgeuse 1.6 # $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.5 2006/12/08 12:12:04 betelgeuse Exp $
9 nichoj 1.1
10     inherit java-utils-2
11    
12     # -----------------------------------------------------------------------------
13     # @eclass-begin
14     # @eclass-summary Eclass for Java Packages
15     #
16     # This eclass should be inherited for pure Java packages, or by packages which
17     # need to use Java.
18     # -----------------------------------------------------------------------------
19    
20     # ------------------------------------------------------------------------------
21     # @depend
22     #
23     # Java packages need java-config, and a fairly new release of Portage.
24     #
25     # JAVA_PKG_E_DEPEND is defined in java-utils.eclass.
26     # ------------------------------------------------------------------------------
27     DEPEND="${JAVA_PKG_E_DEPEND}"
28    
29     # ------------------------------------------------------------------------------
30     # @rdepend
31     #
32     # Nothing special for RDEPEND... just the same as DEPEND.
33     # ------------------------------------------------------------------------------
34     RDEPEND="${DEPEND}"
35    
36 betelgeuse 1.6 EXPORT_FUNCTIONS pkg_setup src_compile
37 nichoj 1.1
38     # ------------------------------------------------------------------------------
39     # @eclass-pkg_setup
40     #
41     # pkg_setup initializes the Java environment
42     # ------------------------------------------------------------------------------
43     java-pkg-2_pkg_setup() {
44     java-pkg_init
45 betelgeuse 1.5 java-pkg_ensure-test
46 nichoj 1.1 }
47    
48     # ------------------------------------------------------------------------------
49 betelgeuse 1.6 # @eclass-src_compile
50     #
51     # Default src_compile for java packages
52     # variables:
53     # EANT_BUILD_XML - controls the location of the build.xml (default: ./build.xml)
54     # EANT_BUILD_TARGET - the ant target/targets to execute (default: jar)
55     # EANT_DOC_TARGET - the target to build extra docs under the doc use flag
56     # (default: the one provided by use_doc in
57     # java-utils-2.eclass)
58     # ------------------------------------------------------------------------------
59     java-pkg-2_src_compile() {
60     if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then
61     local antflags="${EANT_BUILD_TARGET:=jar}"
62     hasq doc ${IUSE} && antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})"
63     eant ${antflags} -f ${EANT_BUILD_XML}
64     else
65     vecho "${FUNCNAME}: No build.xml found so nothing to do."
66     fi
67     }
68    
69     # ------------------------------------------------------------------------------
70 swegener 1.3 # @note
71 nichoj 1.1 #
72 swegener 1.3 # We need to initialize the environment in every function because Portage
73 nichoj 1.1 # will source /etc/profile between phases and trample all over the env.
74     # This is accomplished by phase hooks, which is available with newer versions of
75     # portage.
76     # ------------------------------------------------------------------------------
77    
78 caster 1.2 pre_pkg_setup() {
79 nichoj 1.1 java-pkg-2_pkg_setup
80     }
81    
82     pre_src_unpack() {
83     java-pkg-2_pkg_setup
84     }
85    
86     pre_src_compile() {
87     java-pkg-2_pkg_setup
88     }
89    
90     pre_src_install() {
91     java-pkg-2_pkg_setup
92     }
93    
94     pre_src_test() {
95     java-pkg-2_pkg_setup
96     }
97    
98     pre_pkg_preinst() {
99     java-pkg-2_pkg_setup
100     }
101    
102     pre_pkg_postinst() {
103     java-pkg-2_pkg_setup
104     }
105    
106     # ------------------------------------------------------------------------------
107     # @eclass-end
108     # ------------------------------------------------------------------------------

  ViewVC Help
Powered by ViewVC 1.1.20