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

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

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

Revision 1.2 Revision 1.16
1# Eclass for optional Java packages 1# Eclass for optional Java packages
2# 2#
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-2011, 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# Major changes:
9# 20070805:
10# Removed phase hooks because Portage does proper env saving now.
11# <betelgeuse@gentoo.org>
12#
13# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-opt-2.eclass,v 1.16 2012/07/21 12:00:17 sera Exp $
14
15# @ECLASS: java-pkg-opt-2.eclass
16# @MAINTAINER:
17# java@gentoo.org
18# @AUTHOR:
19# Thomas Matthijs <axxo@gentoo.org>
20# @BLURB: Eclass for package with optional Java support
21# @DESCRIPTION:
22# Inherit this eclass instead of java-pkg-2 if you only need optional Java
23# support.
8 24
9inherit java-utils-2 25inherit java-utils-2
10 26
11# ------------------------------------------------------------------------------ 27# @ECLASS-VARIABLE: JAVA_PKG_OPT_USE
12# @eclass-begin 28# @DESCRIPTION:
13# @eclass-summary Eclass for packages with optional Java support
14# ------------------------------------------------------------------------------
15
16# ------------------------------------------------------------------------------
17# @ebuild-variable JAVA_PKG_OPT_USE
18#
19# USE flag to control if optional Java stuff is build. Defaults to 'java'. 29# USE flag to control if optional Java stuff is build. Defaults to 'java'.
20# ------------------------------------------------------------------------------
21JAVA_PKG_OPT_USE=${JAVA_PKG_OPT_USE:-java} 30JAVA_PKG_OPT_USE=${JAVA_PKG_OPT_USE:-java}
22 31
23# ------------------------------------------------------------------------------
24# ------------------------------------------------------------------------------
25DEPEND="${JAVA_PKG_OPT_USE}? ( ${JAVA_PKG_E_DEPEND} )" 32DEPEND="${JAVA_PKG_OPT_USE}? ( ${JAVA_PKG_E_DEPEND} )"
26RDEPEND="${DEPEND}" 33RDEPEND="${DEPEND}"
27 34
28# ------------------------------------------------------------------------------ 35# See java-pkg-2.eclass for JAVA_PKG_IUSE documentation
29# ------------------------------------------------------------------------------
30IUSE="${JAVA_PKG_OPT_USE}" 36IUSE="${JAVA_PKG_IUSE} ${JAVA_PKG_OPT_USE}"
31 37
32EXPORT_FUNCTIONS pkg_setup 38case "${EAPI:-0}" in
39 0|1) EXPORT_FUNCTIONS pkg_setup pkg_preinst ;;
40 *) EXPORT_FUNCTIONS pkg_setup src_prepare pkg_preinst ;;
41esac
33 42
34# ------------------------------------------------------------------------------ 43# @FUNCTION: java-pkg-opt-2_pkg_setup
35# ------------------------------------------------------------------------------ 44# @DESCRIPTION:
45# default pkg_setup, wrapper for java-utils-2_pkg_init
46
36java-pkg-opt-2_pkg_setup() { 47java-pkg-opt-2_pkg_setup() {
37 use ${JAVA_PKG_OPT_USE} && java-pkg_init 48 use ${JAVA_PKG_OPT_USE} && java-pkg_init
38} 49}
39 50
40# ------------------------------------------------------------------------------
41# @note
42#
43# We need to initialize the environment in every function because Portage
44# will source /etc/profile between phases and trample all over the env.
45# This is accomplished by phase hooks, which is available with newer versions of
46# portage.
47# ------------------------------------------------------------------------------
48 51
49pre_pkg_setup() { 52# @FUNCTION: java-pkg-opt-2_src_prepare
50 java-pkg-opt-2_pkg_setup 53# @DESCRIPTION:
54# default src_prepare, wrapper for java-utils-2_src_prepare
55
56java-pkg-opt-2_src_prepare() {
57 use ${JAVA_PKG_OPT_USE} && java-utils-2_src_prepare
51} 58}
52 59
53pre_src_unpack() { 60
61# @FUNCTION: java-pkg-opt-2_pkg_preinst
62# @DESCRIPTION:
63# default pkg_preinst, wrapper for java-utils-2_pkg_preinst
64
54 java-pkg-opt-2_pkg_setup 65java-pkg-opt-2_pkg_preinst() {
66 use ${JAVA_PKG_OPT_USE} && java-utils-2_pkg_preinst
55} 67}
56
57pre_src_compile() {
58 java-pkg-opt-2_pkg_setup
59}
60
61pre_src_install() {
62 java-pkg-opt-2_pkg_setup
63}
64
65pre_src_test() {
66 java-pkg-opt-2_pkg_setup
67}
68
69pre_pkg_preinst() {
70 java-pkg-opt-2_pkg_setup
71}
72
73pre_pkg_postinst() {
74 java-pkg-opt-2_pkg_setup
75}

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

  ViewVC Help
Powered by ViewVC 1.1.20