/[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.30 Revision 1.31
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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.30 2007/05/12 02:28:51 chtekk Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.31 2007/05/12 03:47:35 chtekk Exp $
4 4
5inherit multilib 5inherit multilib
6 6
7# This eclass handles depending on apache in a sane way and providing 7# This eclass handles depending on apache in a sane way and providing
8# information about where certain interfaces are located. 8# information about where certain interfaces are located.
101## 101##
102## Dependency magic based on useflags to use the right DEPEND 102## Dependency magic based on useflags to use the right DEPEND
103## If you change this, please check the DEPENDS in need_apache() 103## If you change this, please check the DEPENDS in need_apache()
104#### 104####
105 105
106NEED_APACHE_DEPEND="apache2? ( ${APACHE2_DEPEND} ) !apache2? ( ${APACHE1_DEPEND} )" 106NEED_APACHE_DEPEND="${APACHE2_DEPEND}"
107WANT_APACHE_DEPEND="apache2? ( ${APACHE2_DEPEND} )" 107WANT_APACHE_DEPEND="apache2? ( ${APACHE2_DEPEND} )"
108 108
109#### 109####
110# uses_apache1() - !!! DEPRECATED !!! 110# uses_apache1() - !!! DEPRECATED !!!
111#### 111####
219## This function can take a variable amount of arguments specifying the 219## This function can take a variable amount of arguments specifying the
220## versions of apache the ebuild supports 220## versions of apache the ebuild supports
221## 221##
222## If no arguments are specified, then all versions are assumed to be supported 222## If no arguments are specified, then all versions are assumed to be supported
223## 223##
224## If both 1.3 and 2.x are specified, the apache2 USE-flag will be used in
225## DEPEND/RDEPEND to determine which version to use.
226##
227## Currently supported versions: 1.3 2.0 2.2 2.x 224## Currently supported versions: 2.0 2.2 2.x
225####
228need_apache() { 226need_apache() {
229 debug-print-function $FUNCNAME $* 227 debug-print-function $FUNCNAME $*
230 228
231 local supports13 supports20 supports22 supports2x 229 local supports20 supports22 supports2x
232 230
233 if [[ $# -eq 0 ]] ; then 231 if [[ $# -eq 0 ]] ; then
234 supports13="yes"
235 supports2x="yes" 232 supports2x="yes"
236 else 233 else
237 while [[ $# -gt 0 ]] ; do 234 while [[ $# -gt 0 ]] ; do
238 case "$1" in 235 case "$1" in
239 1.3) supports13="yes"; shift;;
240 2.0) supports20="yes"; shift;; 236 2.0) supports20="yes"; shift;;
241 2.2) supports22="yes"; shift;; 237 2.2) supports22="yes"; shift;;
242 2.x) supports2x="yes"; shift;; 238 2.x) supports2x="yes"; shift;;
243 *) die "Unknown version specifier: $1";; 239 *) die "Unknown version specifier: $1";;
244 esac 240 esac
247 243
248 if [[ "${supports20}" == "yes" ]] && [[ "${supports22}" == "yes" ]] ; then 244 if [[ "${supports20}" == "yes" ]] && [[ "${supports22}" == "yes" ]] ; then
249 supports2x="yes"; 245 supports2x="yes";
250 fi 246 fi
251 247
252 debug-print "supports13: ${supports13}"
253 debug-print "supports20: ${supports20}" 248 debug-print "supports20: ${supports20}"
254 debug-print "supports22: ${supports22}" 249 debug-print "supports22: ${supports22}"
255 debug-print "supports2x: ${supports2x}" 250 debug-print "supports2x: ${supports2x}"
256 251
257 if [[ "${supports13}" != "yes" ]] ; then
258 if [[ "${supports2x}" == "yes" ]] ; then 252 if [[ "${supports2x}" == "yes" ]] ; then
259 need_apache2 253 need_apache2
260 elif [[ "${supports20}" == "yes" ]] ; then 254 elif [[ "${supports20}" == "yes" ]] ; then
261 need_apache2_0 255 need_apache2_0
262 elif [[ "${supports22}" == "yes" ]] ; then 256 elif [[ "${supports22}" == "yes" ]] ; then
263 need_apache2_2 257 need_apache2_2
264 fi
265 elif [[ "${supports13}" == "yes" ]] ; then
266 if [[ "${supports2x}" == "yes" || "${supports20}" == "yes" || "${supports22}" == "yes" ]] ; then
267 # We support both apache-1.3 and apache-2.*, set up USE-flag based
268 # DEPEND and RDEPEND, determined by which apache-2.x we support
269 IUSE="${IUSE} apache2"
270
271 if [[ "${supports2x}" != "yes" ]] ; then
272 if [[ "${supports20}" == "yes" ]] ; then
273 NEED_APACHE_DEPEND="apache2? ( ${APACHE2_0_DEPEND} ) !apache2? ( ${APACHE1_DEPEND} )"
274 elif [[ "${supports22}" == "yes" ]] ; then
275 NEED_APACHE_DEPEND="apache2? ( ${APACHE2_2_DEPEND} ) !apache2? ( ${APACHE1_DEPEND} )"
276 fi
277 fi
278
279 DEPEND="${DEPEND} ${NEED_APACHE_DEPEND}"
280 RDEPEND="${RDEPEND} ${NEED_APACHE_DEPEND}"
281
282 if use apache2 ; then
283 uses_apache2
284 else
285 uses_apache1
286 fi
287 else
288 need_apache1
289 fi
290 fi 258 fi
291} 259}
292 260
293want_apache() { 261want_apache() {
294 debug-print-function $FUNCNAME $* 262 debug-print-function $FUNCNAME $*

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.20