--- 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 +# } # @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,6 +176,18 @@ IUSE="${IUSE} ${myiuse}" DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )" RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )" +} + +# @FUNCTION: apache2_optional_init +# @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 if use ${myiuse}; then _init_apache2