/[gentoo-x86]/eclass/depend.apache.eclass
Gentoo

Diff of /eclass/depend.apache.eclass

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

Revision 1.44 Revision 1.45
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2009 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.44 2008/03/04 10:59:27 hollow Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.45 2009/05/26 16:41:56 arfrever Exp $
4 4
5# @ECLASS: depend.apache.eclass 5# @ECLASS: depend.apache.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# apache-devs@gentoo.org 7# apache-devs@gentoo.org
8# @BLURB: Functions to allow ebuilds to depend on apache 8# @BLURB: Functions to allow ebuilds to depend on apache
32# 32#
33# @CODE 33# @CODE
34# DEPEND="server? ( virtual/Perl-CGI )" 34# DEPEND="server? ( virtual/Perl-CGI )"
35# RDEPEND="${DEPEND}" 35# RDEPEND="${DEPEND}"
36# want_apache2 server 36# want_apache2 server
37#
38# pkg_setup() {
39# depend.apache_pkg_setup server
40# }
37# @CODE 41# @CODE
38 42
39inherit multilib 43inherit multilib
40 44
41# ============================================================================== 45# ==============================================================================
130 134
131# ============================================================================== 135# ==============================================================================
132# PUBLIC FUNCTIONS 136# PUBLIC FUNCTIONS
133# ============================================================================== 137# ==============================================================================
134 138
139# @FUNCTION: depend.apache_pkg_setup
140# @USAGE: [myiuse]
141# @DESCRIPTION:
142# An ebuild calls this in pkg_setup() to initialize variables for optional
143# apache-2.x support. If the myiuse parameter is not given it defaults to
144# apache2.
145depend.apache_pkg_setup() {
146 debug-print-function $FUNCNAME $*
147
148 if [[ "${EBUILD_PHASE}" != "setup" ]]; then
149 die "$FUNCNAME() should be called in pkg_setup()"
150 fi
151
152 local myiuse=${1:-apache2}
153 if has ${myiuse} ${IUSE}; then
154 if use ${myiuse}; then
155 _init_apache2
156 else
157 _init_no_apache
158 fi
159 fi
160}
161
135# @FUNCTION: want_apache 162# @FUNCTION: want_apache
136# @USAGE: [myiuse] 163# @USAGE: [myiuse]
137# @DESCRIPTION: 164# @DESCRIPTION:
138# An ebuild calls this to get the dependency information for optional apache 165# An ebuild calls this to get the dependency information for optional apache
139# support. If the myiuse parameter is not given it defaults to apache2. 166# support. If the myiuse parameter is not given it defaults to apache2.
167# An ebuild should additionally call depend.apache_pkg_setup() in pkg_setup()
168# with the same myiuse parameter.
140want_apache() { 169want_apache() {
141 debug-print-function $FUNCNAME $* 170 debug-print-function $FUNCNAME $*
142 want_apache2 "$@" 171 want_apache2 "$@"
143} 172}
144 173
145# @FUNCTION: want_apache2 174# @FUNCTION: want_apache2
146# @USAGE: [myiuse] 175# @USAGE: [myiuse]
147# @DESCRIPTION: 176# @DESCRIPTION:
148# An ebuild calls this to get the dependency information for optional apache-2.x 177# An ebuild calls this to get the dependency information for optional apache-2.x
149# support. If the myiuse parameter is not given it defaults to apache2. 178# support. If the myiuse parameter is not given it defaults to apache2.
179# An ebuild should additionally call depend.apache_pkg_setup() in pkg_setup()
180# with the same myiuse parameter.
150want_apache2() { 181want_apache2() {
151 debug-print-function $FUNCNAME $* 182 debug-print-function $FUNCNAME $*
152 183
153 local myiuse=${1:-apache2} 184 local myiuse=${1:-apache2}
154 IUSE="${IUSE} ${myiuse}" 185 IUSE="${IUSE} ${myiuse}"
155 DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )" 186 DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )"
156 RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )" 187 RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )"
157
158 if use ${myiuse}; then
159 _init_apache2
160 else
161 _init_no_apache
162 fi
163} 188}
164 189
165# @FUNCTION: want_apache2_2 190# @FUNCTION: want_apache2_2
166# @USAGE: [myiuse] 191# @USAGE: [myiuse]
167# @DESCRIPTION: 192# @DESCRIPTION:
168# An ebuild calls this to get the dependency information for optional 193# An ebuild calls this to get the dependency information for optional
169# apache-2.2.x support. If the myiuse parameter is not given it defaults to 194# apache-2.2.x support. If the myiuse parameter is not given it defaults to
170# apache2. 195# apache2.
196# An ebuild should additionally call depend.apache_pkg_setup() in pkg_setup()
197# with the same myiuse parameter.
171want_apache2_2() { 198want_apache2_2() {
172 debug-print-function $FUNCNAME $* 199 debug-print-function $FUNCNAME $*
173 200
174 local myiuse=${1:-apache2} 201 local myiuse=${1:-apache2}
175 IUSE="${IUSE} ${myiuse}" 202 IUSE="${IUSE} ${myiuse}"
176 DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )" 203 DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
177 RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )" 204 RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
178
179 if use ${myiuse}; then
180 _init_apache2
181 else
182 _init_no_apache
183 fi
184} 205}
185 206
186# @FUNCTION: need_apache 207# @FUNCTION: need_apache
187# @DESCRIPTION: 208# @DESCRIPTION:
188# An ebuild calls this to get the dependency information for apache. 209# An ebuild calls this to get the dependency information for apache.
273 eerror "build a thread-safe version of ${CATEGORY}/${PN} for use" 294 eerror "build a thread-safe version of ${CATEGORY}/${PN} for use"
274 eerror "with www-servers/apache" 295 eerror "with www-servers/apache"
275 die "Need missing USE flag '${myflag}' in ${myforeign}" 296 die "Need missing USE flag '${myflag}' in ${myforeign}"
276 fi 297 fi
277} 298}
299
300EXPORT_FUNCTIONS pkg_setup

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

  ViewVC Help
Powered by ViewVC 1.1.20