--- eclass/depend.apache.eclass +++ eclass/depend.apache.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2007 Gentoo Foundation +# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.44 2008/03/04 10:59:27 hollow Exp $ @@ -34,6 +34,10 @@ # DEPEND="server? ( virtual/Perl-CGI )" # RDEPEND="${DEPEND}" # want_apache2 server +# +# pkg_setup() { +# apache2_optional_init server +# } # @CODE inherit multilib @@ -137,6 +141,7 @@ # @DESCRIPTION: # An ebuild calls this to get the dependency information for optional apache # support. If the myiuse parameter is not given it defaults to apache2. +# An ebuild should additionally call apache2_optional_init() in pkg_setup(). want_apache() { debug-print-function $FUNCNAME $* want_apache2 "$@" @@ -147,6 +152,7 @@ # @DESCRIPTION: # An ebuild calls this to get the dependency information for optional apache-2.x # support. If the myiuse parameter is not given it defaults to apache2. +# An ebuild should additionally call apache2_optional_init() in pkg_setup(). want_apache2() { debug-print-function $FUNCNAME $* @@ -154,12 +160,6 @@ IUSE="${IUSE} ${myiuse}" DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )" RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )" - - if use ${myiuse}; then - _init_apache2 - else - _init_no_apache - fi } # @FUNCTION: want_apache2_2 @@ -168,6 +168,7 @@ # An ebuild calls this to get the dependency information for optional # apache-2.2.x support. If the myiuse parameter is not given it defaults to # apache2. +# An ebuild should additionally call apache2_optional_init() in pkg_setup(). want_apache2_2() { debug-print-function $FUNCNAME $* @@ -175,7 +176,21 @@ IUSE="${IUSE} ${myiuse}" DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )" RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )" +} +# @FUNCTION: apache2_optional_init +# @USAGE: [myiuse] +# @DESCRIPTION: +# An ebuild calls this in pkg_setup() to initialize variables for optional +# apache-2.x support. +apache2_optional_init() { + debug-print-function $FUNCNAME $* + + if [[ "${EBUILD_PHASE}" != "setup" ]]; then + die "apache2_optional_init() should be called in pkg_setup()" + fi + + local myiuse=${1:-apache2} if use ${myiuse}; then _init_apache2 else