public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass
@ 2007-09-08 14:06 Benedikt Boehm (hollow)
  0 siblings, 0 replies; 11+ messages in thread
From: Benedikt Boehm (hollow) @ 2007-09-08 14:06 UTC (permalink / raw
  To: gentoo-commits

hollow      07/09/08 14:06:12

  Modified:             depend.apache.eclass
  Log:
  add functions to get the right apr/apu-config

Revision  Changes    Path
1.34                 eclass/depend.apache.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.34&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.34&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.33&r2=1.34

Index: depend.apache.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- depend.apache.eclass	29 Jul 2007 16:36:23 -0000	1.33
+++ depend.apache.eclass	8 Sep 2007 14:06:12 -0000	1.34
@@ -1,6 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.33 2007/07/29 16:36:23 phreak Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.34 2007/09/08 14:06:12 hollow Exp $
 
 inherit multilib
 
@@ -107,6 +107,52 @@
 WANT_APACHE_DEPEND="apache2? ( ${APACHE2_DEPEND} )"
 
 ####
+## apr_config/apu_config
+##
+## Version magic to get the correct apr-config/apu-config
+## based on the (probably) installed version of apache.
+## This is needed to get modules to link to the same apr/apu
+## as apache (i.e. link 0.9 for 2.0, 1.x for 2.2)
+####
+apr_config() {
+	local default="${1:-1}"
+	if [[ "${USE_APACHE}" == "2" ]]; then
+		if has_version ${APACHE2_0_DEPEND}; then
+			echo apr-config
+		else
+			echo apr-1-config
+		fi
+	else
+		if [[ "${default}" == "0" ]]; then
+			echo apr-config
+		elif [[ "${default}" == "1" ]]; then
+			echo apr-1-config
+		else
+			die "Unknown version specifier: ${default}"
+		fi
+	fi
+}
+
+apu_config() {
+	local default="${1:-1}"
+	if [[ "${USE_APACHE}" == "2" ]]; then
+		if has_version ${APACHE2_0_DEPEND}; then
+			echo apu-config
+		else
+			echo apu-1-config
+		fi
+	else
+		if [[ "${default}" == "0" ]]; then
+			echo apu-config
+		elif [[ "${default}" == "1" ]]; then
+			echo apu-1-config
+		else
+			die "Unknown version specifier: ${default}"
+		fi
+	fi
+}
+
+####
 # uses_apache1() - !!! DEPRECATED !!!
 ####
 
@@ -116,7 +162,7 @@
 	# into the dependency cache (DEPEND/RDEPEND/etc)
 	APACHE_VERSION="1"
 	APXS="${APXS1}"
-	USE_APACHE2=""
+	USE_APACHE="1"
 	APACHECTL="${APACHECTL1}"
 	APACHE_BASEDIR="${APACHE1_BASEDIR}"
 	APACHE_CONFDIR="${APACHE1_CONFDIR}"
@@ -136,7 +182,7 @@
 	# WARNING: Do not use these variables with anything that is put
 	# into the dependency cache (DEPEND/RDEPEND/etc)
 	APACHE_VERSION="2"
-	USE_APACHE2="2"
+	USE_APACHE="2"
 	APXS="${APXS2}"
 	APACHECTL="${APACHECTL2}"
 	APACHE_BASEDIR="${APACHE2_BASEDIR}"
@@ -149,7 +195,7 @@
 doesnt_use_apache() {
 	debug-print-function $FUNCNAME $*
 	APACHE_VERSION="0"
-	USE_APACHE=""
+	USE_APACHE="0"
 }
 
 ####



-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass
@ 2008-02-02 12:53 Benedikt Boehm (hollow)
  0 siblings, 0 replies; 11+ messages in thread
From: Benedikt Boehm (hollow) @ 2008-02-02 12:53 UTC (permalink / raw
  To: gentoo-commits

hollow      08/02/02 12:53:52

  Modified:             depend.apache.eclass
  Log:
  remove obsolete depend.apache features wrt #208033

Revision  Changes    Path
1.36                 eclass/depend.apache.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.36&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.36&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.35&r2=1.36

Index: depend.apache.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- depend.apache.eclass	25 Nov 2007 14:27:52 -0000	1.35
+++ depend.apache.eclass	2 Feb 2008 12:53:52 -0000	1.36
@@ -1,6 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.35 2007/11/25 14:27:52 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.36 2008/02/02 12:53:52 hollow Exp $
 
 # @ECLASS: depend.apache.eclass
 # @MAINTAINER: apache-devs@gentoo.org
@@ -25,42 +25,34 @@
 # @DESCRIPTION:
 # Stores the version of apache we are going to be ebuilding. This variable is
 # set by the need_apache functions.
-#APACHE_VERSION="2"
 
-# @ECLASS-VARIABLE: APXS2
+# @ECLASS-VARIABLE: APXS
 # @DESCRIPTION:
 # Paths to the apxs tool
-APXS2="/usr/sbin/apxs2"
 
-# @ECLASS-VARIABLE: APACHECTL2
+# @ECLASS-VARIABLE: APACHECTL
 # @DESCRIPTION:
 # Path to the apachectl tool
-APACHECTL2="/usr/sbin/apache2ctl"
 
-# @ECLASS-VARIABLE: APACHE2_BASEDIR
+# @ECLASS-VARIABLE: APACHE_BASEDIR
 # @DESCRIPTION:
 # Path to the server root directory
-APACHE2_BASEDIR="/usr/$(get_libdir)/apache2"
 
-# @ECLASS-VARIABLE: APACHE2_CONFDIR
+# @ECLASS-VARIABLE: APACHE_CONFDIR
 # @DESCRIPTION:
 # Path to the configuration file directory
-APACHE2_CONFDIR="/etc/apache2"
 
-# @ECLASS-VARIABLE: APACHE2_MODULES_CONFDIR
+# @ECLASS-VARIABLE: APACHE_MODULES_CONFDIR
 # @DESCRIPTION:
 # Path where module configuration files are kept
-APACHE2_MODULES_CONFDIR="${APACHE2_CONFDIR}/modules.d"
 
-# @ECLASS-VARIABLE: APACHE2_VHOSTDIR
+# @ECLASS-VARIABLE: APACHE_VHOSTS_CONFDIR
 # @DESCRIPTION:
 # Path where virtual host configuration files are kept
-APACHE2_VHOSTDIR="${APACHE2_CONFDIR}/vhosts.d"
 
-# @ECLASS-VARIABLE: APACHE2_MODULESDIR
+# @ECLASS-VARIABLE: APACHE_MODULESDIR
 # @DESCRIPTION:
 # Path where we install modules
-APACHE2_MODULESDIR="${APACHE2_BASEDIR}/modules"
 
 # @ECLASS-VARIABLE: APACHE2_DEPEND
 # @DESCRIPTION:
@@ -95,14 +87,13 @@
 	# WARNING: Do not use these variables with anything that is put
 	# into the dependency cache (DEPEND/RDEPEND/etc)
 	APACHE_VERSION="2"
-	USE_APACHE="2"
-	APXS="${APXS2}"
-	APACHECTL="${APACHECTL2}"
-	APACHE_BASEDIR="${APACHE2_BASEDIR}"
-	APACHE_CONFDIR="${APACHE2_CONFDIR}"
-	APACHE_MODULES_CONFDIR="${APACHE2_MODULES_CONFDIR}"
-	APACHE_VHOSTSDIR="${APACHE2_VHOSTSDIR}"
-	APACHE_MODULESDIR="${APACHE2_MODULESDIR}"
+	APXS="/usr/sbin/apxs2"
+	APACHECTL="/usr/sbin/apache2ctl"
+	APACHE_BASEDIR="/usr/$(get_libdir)/apache2"
+	APACHE_CONFDIR="/etc/apache2"
+	APACHE_MODULES_CONFDIR="${APACHE_CONFDIR}/modules.d"
+	APACHE_VHOSTS_CONFDIR="${APACHE_CONFDIR}/vhosts.d"
+	APACHE_MODULESDIR="${APACHE_BASEDIR}/modules"
 }
 
 # @FUNCTION: doesnt_use_apache
@@ -181,55 +172,3 @@
 need_apache() {
 	need_apache2
 }
-
-# @FUNCTION: apr_config
-# @DESCRIPTION:
-# Version magic to get the correct apr-config binary based on the (probably)
-# installed version of apache.  This is needed to get modules to link to the
-# same apr/apu as apache (i.e. link 0.9 for 2.0, 1.x for 2.2)
-apr_config() {
-	debug-print-function $FUNCNAME $*
-
-	local default="${1:-1}"
-	if [[ "${USE_APACHE}" == "2" ]]; then
-		if has_version ${APACHE2_0_DEPEND}; then
-			echo apr-config
-		else
-			echo apr-1-config
-		fi
-	else
-		if [[ "${default}" == "0" ]]; then
-			echo apr-config
-		elif [[ "${default}" == "1" ]]; then
-			echo apr-1-config
-		else
-			die "Unknown version specifier: ${default}"
-		fi
-	fi
-}
-
-# @FUNCTION: apu_config
-# @DESCRIPTION:
-# Version magic to get the correct apu-config binary based on the (probably)
-# installed version of apache.  This is needed to get modules to link to the
-# same apr/apu as apache (i.e. link 0.9 for 2.0, 1.x for 2.2)
-apu_config() {
-	debug-print-function $FUNCNAME $*
-
-	local default="${1:-1}"
-	if [[ "${USE_APACHE}" == "2" ]]; then
-		if has_version ${APACHE2_0_DEPEND}; then
-			echo apu-config
-		else
-			echo apu-1-config
-		fi
-	else
-		if [[ "${default}" == "0" ]]; then
-			echo apu-config
-		elif [[ "${default}" == "1" ]]; then
-			echo apu-1-config
-		else
-			die "Unknown version specifier: ${default}"
-		fi
-	fi
-}



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass
@ 2008-02-02 14:31 Benedikt Boehm (hollow)
  0 siblings, 0 replies; 11+ messages in thread
From: Benedikt Boehm (hollow) @ 2008-02-02 14:31 UTC (permalink / raw
  To: gentoo-commits

hollow      08/02/02 14:31:43

  Modified:             depend.apache.eclass
  Log:
  cleanup/sanitize depend.apache.eclass wrt #208033

Revision  Changes    Path
1.37                 eclass/depend.apache.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.37&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.37&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.36&r2=1.37

Index: depend.apache.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- depend.apache.eclass	2 Feb 2008 12:53:52 -0000	1.36
+++ depend.apache.eclass	2 Feb 2008 14:31:42 -0000	1.37
@@ -1,6 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.36 2008/02/02 12:53:52 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.37 2008/02/02 14:31:42 hollow Exp $
 
 # @ECLASS: depend.apache.eclass
 # @MAINTAINER: apache-devs@gentoo.org
@@ -54,16 +54,16 @@
 # @DESCRIPTION:
 # Path where we install modules
 
+# @ECLASS-VARIABLE: APACHE_DEPEND
+# @DESCRIPTION:
+# Dependencies for Apache
+APACHE_DEPEND="www-servers/apache"
+
 # @ECLASS-VARIABLE: APACHE2_DEPEND
 # @DESCRIPTION:
 # Dependencies for Apache 2.x
 APACHE2_DEPEND="=www-servers/apache-2*"
 
-# @ECLASS-VARIABLE: APACHE2_0_DEPEND
-# @DESCRIPTION:
-# Dependencies for Apache 2.0.x
-APACHE2_0_DEPEND="=www-servers/apache-2.0*"
-
 # @ECLASS-VARIABLE: APACHE2_2_DEPEND
 # @DESCRIPTION:
 # Dependencies for Apache 2.2.x
@@ -72,16 +72,23 @@
 # @ECLASS-VARIABLE: WANT_APACHE_DEPEND
 # @DESCRIPTION:
 # Dependency magic based on useflag to use the right DEPEND
-WANT_APACHE_DEPEND="apache2? ( ${APACHE2_DEPEND} )"
+WANT_APACHE_DEPEND="apache2? ( ${APACHE_DEPEND} )"
+
+# @ECLASS-VARIABLE: WANT_APACHE2_DEPEND
+# @DESCRIPTION:
+# Dependency magic based on useflag to use the right DEPEND
+WANT_APACHE2_DEPEND="apache2? ( ${APACHE2_DEPEND} )"
+
+# @ECLASS-VARIABLE: WANT_APACHE2_2_DEPEND
+# @DESCRIPTION:
+# Dependency magic based on useflag to use the right DEPEND
+WANT_APACHE2_2_DEPEND="apache2? ( ${APACHE2_2_DEPEND} )"
 
 # ==============================================================================
 # INTERNAL FUNCTIONS
 # ==============================================================================
 
-# @FUNCTION: uses_apache2
-# @DESCRIPTION:
-# sets up all of the environment variables required for an apache2 module
-uses_apache2() {
+_init_apache2() {
 	debug-print-function $FUNCNAME $*
 
 	# WARNING: Do not use these variables with anything that is put
@@ -96,14 +103,9 @@
 	APACHE_MODULESDIR="${APACHE_BASEDIR}/modules"
 }
 
-# @FUNCTION: doesnt_use_apache
-# @DESCRIPTION:
-# sets up all of the environment variables required for optional apache usage
-doesnt_use_apache() {
+_init_no_apache() {
 	debug-print-function $FUNCNAME $*
-
 	APACHE_VERSION="0"
-	USE_APACHE="0"
 }
 
 # ==============================================================================
@@ -114,61 +116,76 @@
 # @DESCRIPTION:
 # An ebuild calls this to get the dependency information for optional apache-2.x
 # support.
-want_apache() {
+want_apache2() {
 	debug-print-function $FUNCNAME $*
 
 	IUSE="${IUSE} apache2"
-	DEPEND="${DEPEND} ${WANT_APACHE_DEPEND}"
-	RDEPEND="${RDEPEND} ${WANT_APACHE_DEPEND}"
+	DEPEND="${DEPEND} ${WANT_APACHE2_DEPEND}"
+	RDEPEND="${RDEPEND} ${WANT_APACHE2_DEPEND}"
 
 	if use apache2 ; then
-		uses_apache2
+		_init_apache2
 	else
-		doesnt_use_apache
+		_init_no_apache
 	fi
 }
 
-# @FUNCTION: need_apache2
+# @FUNCTION: want_apache
 # @DESCRIPTION:
-# An ebuild calls this to get the dependency information for apache-2.x. An
-# ebuild should use this in order for future changes to the build infrastructure
-# to happen seamlessly. All an ebuild needs to do is include the line
-# need_apache2 somewhere.
-need_apache2() {
+# An ebuild calls this to get the dependency information for optional
+# apache-2.2.x support.
+want_apache2_2() {
 	debug-print-function $FUNCNAME $*
 
-	DEPEND="${DEPEND} ${APACHE2_DEPEND}"
-	RDEPEND="${RDEPEND} ${APACHE2_DEPEND}"
-	uses_apache2
+	IUSE="${IUSE} apache2"
+	DEPEND="${DEPEND} ${WANT_APACHE2_2_DEPEND}"
+	RDEPEND="${RDEPEND} ${WANT_APACHE2_2_DEPEND}"
+
+	if use apache2 ; then
+		_init_apache2
+	else
+		_init_no_apache
+	fi
 }
 
-# @FUNCTION: need_apache2_0
+# @FUNCTION: want_apache
 # @DESCRIPTION:
-# Works like need_apache2 above, but its used by modules that only support
-# apache 2.0 and do not work with higher versions.
-need_apache2_0() {
+# An ebuild calls this to get the dependency information for optional apache
+# support.
+want_apache() {
+	want_apache2
+}
+
+# @FUNCTION: need_apache2
+# @DESCRIPTION:
+# Works like need_apache, but its used by modules that only support
+# apache 2.x and do not work with other versions.
+need_apache2() {
 	debug-print-function $FUNCNAME $*
 
-	DEPEND="${DEPEND} ${APACHE2_0_DEPEND}"
-	RDEPEND="${RDEPEND} ${APACHE2_0_DEPEND}"
-	uses_apache2
+	DEPEND="${DEPEND} ${APACHE2_DEPEND}"
+	RDEPEND="${RDEPEND} ${APACHE2_DEPEND}"
+	_init_apache2
 }
 
 # @FUNCTION: need_apache2_2
 # @DESCRIPTION:
-# Works like need_apache2 above, but its used by modules that only support
-# apache 2.2 and do not work with lower versions.
+# Works like need_apache, but its used by modules that only support
+# apache 2.2.x and do not work with other versions.
 need_apache2_2() {
 	debug-print-function $FUNCNAME $*
 
 	DEPEND="${DEPEND} ${APACHE2_2_DEPEND}"
 	RDEPEND="${RDEPEND} ${APACHE2_2_DEPEND}"
-	uses_apache2
+	_init_apache2
 }
 
 # @FUNCTION: need_apache
 # @DESCRIPTION:
-# Legacy alias for need_apache2
+# An ebuild calls this to get the dependency information for apache. An
+# ebuild should use this in order for future changes to the build infrastructure
+# to happen seamlessly. All an ebuild needs to do is include the line
+# need_apache somewhere.
 need_apache() {
 	need_apache2
 }



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass
@ 2008-02-03 11:51 Benedikt Boehm (hollow)
  0 siblings, 0 replies; 11+ messages in thread
From: Benedikt Boehm (hollow) @ 2008-02-03 11:51 UTC (permalink / raw
  To: gentoo-commits

hollow      08/02/03 11:51:37

  Modified:             depend.apache.eclass
  Log:
  add path to the apache binary; obsolete APACHECTL in favor of APACHE_CTL

Revision  Changes    Path
1.38                 eclass/depend.apache.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.38&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.38&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.37&r2=1.38

Index: depend.apache.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- depend.apache.eclass	2 Feb 2008 14:31:42 -0000	1.37
+++ depend.apache.eclass	3 Feb 2008 11:51:36 -0000	1.38
@@ -1,6 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.37 2008/02/02 14:31:42 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.38 2008/02/03 11:51:36 hollow Exp $
 
 # @ECLASS: depend.apache.eclass
 # @MAINTAINER: apache-devs@gentoo.org
@@ -95,7 +95,10 @@
 	# into the dependency cache (DEPEND/RDEPEND/etc)
 	APACHE_VERSION="2"
 	APXS="/usr/sbin/apxs2"
-	APACHECTL="/usr/sbin/apache2ctl"
+	APACHE_BIN="/usr/sbin/apache2"
+	APACHE_CTL="/usr/sbin/apache2ctl"
+	# legacy alias
+	APACHECTL="${APACHE_CTL}"
 	APACHE_BASEDIR="/usr/$(get_libdir)/apache2"
 	APACHE_CONFDIR="/etc/apache2"
 	APACHE_MODULES_CONFDIR="${APACHE_CONFDIR}/modules.d"



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass
@ 2008-02-03 14:12 Benedikt Boehm (hollow)
  0 siblings, 0 replies; 11+ messages in thread
From: Benedikt Boehm (hollow) @ 2008-02-03 14:12 UTC (permalink / raw
  To: gentoo-commits

hollow      08/02/03 14:12:44

  Modified:             depend.apache.eclass
  Log:
  do not hardcode USE flag for optional apache support

Revision  Changes    Path
1.39                 eclass/depend.apache.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.39&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.39&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.38&r2=1.39

Index: depend.apache.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- depend.apache.eclass	3 Feb 2008 11:51:36 -0000	1.38
+++ depend.apache.eclass	3 Feb 2008 14:12:44 -0000	1.39
@@ -1,6 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.38 2008/02/03 11:51:36 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.39 2008/02/03 14:12:44 hollow Exp $
 
 # @ECLASS: depend.apache.eclass
 # @MAINTAINER: apache-devs@gentoo.org
@@ -69,21 +69,6 @@
 # Dependencies for Apache 2.2.x
 APACHE2_2_DEPEND="=www-servers/apache-2.2*"
 
-# @ECLASS-VARIABLE: WANT_APACHE_DEPEND
-# @DESCRIPTION:
-# Dependency magic based on useflag to use the right DEPEND
-WANT_APACHE_DEPEND="apache2? ( ${APACHE_DEPEND} )"
-
-# @ECLASS-VARIABLE: WANT_APACHE2_DEPEND
-# @DESCRIPTION:
-# Dependency magic based on useflag to use the right DEPEND
-WANT_APACHE2_DEPEND="apache2? ( ${APACHE2_DEPEND} )"
-
-# @ECLASS-VARIABLE: WANT_APACHE2_2_DEPEND
-# @DESCRIPTION:
-# Dependency magic based on useflag to use the right DEPEND
-WANT_APACHE2_2_DEPEND="apache2? ( ${APACHE2_2_DEPEND} )"
-
 # ==============================================================================
 # INTERNAL FUNCTIONS
 # ==============================================================================
@@ -122,11 +107,12 @@
 want_apache2() {
 	debug-print-function $FUNCNAME $*
 
-	IUSE="${IUSE} apache2"
-	DEPEND="${DEPEND} ${WANT_APACHE2_DEPEND}"
-	RDEPEND="${RDEPEND} ${WANT_APACHE2_DEPEND}"
+	local myiuse=${1:-apache2}
+	IUSE="${IUSE} ${myiuse}"
+	DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )"
+	RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )"
 
-	if use apache2 ; then
+	if use ${myiuse} ; then
 		_init_apache2
 	else
 		_init_no_apache
@@ -140,11 +126,12 @@
 want_apache2_2() {
 	debug-print-function $FUNCNAME $*
 
-	IUSE="${IUSE} apache2"
-	DEPEND="${DEPEND} ${WANT_APACHE2_2_DEPEND}"
-	RDEPEND="${RDEPEND} ${WANT_APACHE2_2_DEPEND}"
+	local myiuse=${1:-apache2}
+	IUSE="${IUSE} ${myiuse}"
+	DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
+	RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
 
-	if use apache2 ; then
+	if use ${myiuse} ; then
 		_init_apache2
 	else
 		_init_no_apache
@@ -156,7 +143,8 @@
 # An ebuild calls this to get the dependency information for optional apache
 # support.
 want_apache() {
-	want_apache2
+	debug-print-function $FUNCNAME $*
+	want_apache2 "$@"
 }
 
 # @FUNCTION: need_apache2
@@ -190,5 +178,6 @@
 # to happen seamlessly. All an ebuild needs to do is include the line
 # need_apache somewhere.
 need_apache() {
+	debug-print-function $FUNCNAME $*
 	need_apache2
 }



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass
@ 2008-02-06  8:33 Benedikt Boehm (hollow)
  0 siblings, 0 replies; 11+ messages in thread
From: Benedikt Boehm (hollow) @ 2008-02-06  8:33 UTC (permalink / raw
  To: gentoo-commits

hollow      08/02/06 08:33:48

  Modified:             depend.apache.eclass
  Log:
  update depend.apache.eclass documentation

Revision  Changes    Path
1.40                 eclass/depend.apache.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.40&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.40&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.39&r2=1.40

Index: depend.apache.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- depend.apache.eclass	3 Feb 2008 14:12:44 -0000	1.39
+++ depend.apache.eclass	6 Feb 2008 08:33:47 -0000	1.40
@@ -1,19 +1,39 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.39 2008/02/03 14:12:44 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.40 2008/02/06 08:33:47 hollow Exp $
 
 # @ECLASS: depend.apache.eclass
 # @MAINTAINER: apache-devs@gentoo.org
 # @BLURB: Functions to allow ebuilds to depend on apache
 # @DESCRIPTION:
-# This eclass handles depending on apache in a sane way and providing
-# information about where certain interfaces are located.
+# This eclass handles depending on apache in a sane way and provides information
+# about where certain binaries and configuration files are located.
 #
-# @NOTE: If you use this, be sure you use the need_* call after you have defined
-# DEPEND and RDEPEND. Also note that you can not rely on the automatic
+# To make use of this eclass simply call one of the need/want_apache functions
+# described below. Make sure you use the need/want_apache call after you have
+# defined DEPEND and RDEPEND. Also note that you can not rely on the automatic
 # RDEPEND=DEPEND that portage does if you use this eclass.
 #
-# See bug 107127 for more information.
+# See Bug 107127 for more information.
+#
+# @EXAMPLE:
+#
+# Here is an example of an ebuild depending on apache:
+#
+# @CODE
+#   DEPEND="virtual/Perl-CGI"
+#   RDEPEND="${DEPEND}"
+#   need_apache2
+# @CODE
+#
+# Another example which demonstrates non-standard IUSE options for optional
+# apache support:
+#
+# @CODE
+#   DEPEND="server? ( virtual/Perl-CGI )"
+#   RDEPEND="${DEPEND}"
+#   want_apache2 server
+# @CODE
 
 inherit multilib
 
@@ -23,36 +43,48 @@
 
 # @ECLASS-VARIABLE: APACHE_VERSION
 # @DESCRIPTION:
-# Stores the version of apache we are going to be ebuilding. This variable is
-# set by the need_apache functions.
+# Stores the version of apache we are going to be ebuilding.
+# This variable is set by the want/need_apache functions.
 
 # @ECLASS-VARIABLE: APXS
 # @DESCRIPTION:
-# Paths to the apxs tool
+# Paths to the apxs tool.
+# This variable is set by the want/need_apache functions.
+
+# @ECLASS-VARIABLE: APACHE_BIN
+# @DESCRIPTION:
+# Path to the apache binary.
+# This variable is set by the want/need_apache functions.
 
-# @ECLASS-VARIABLE: APACHECTL
+# @ECLASS-VARIABLE: APACHE_CTL
 # @DESCRIPTION:
-# Path to the apachectl tool
+# Path to the apachectl tool.
+# This variable is set by the want/need_apache functions.
 
 # @ECLASS-VARIABLE: APACHE_BASEDIR
 # @DESCRIPTION:
-# Path to the server root directory
+# Path to the server root directory.
+# This variable is set by the want/need_apache functions.
 
 # @ECLASS-VARIABLE: APACHE_CONFDIR
 # @DESCRIPTION:
-# Path to the configuration file directory
+# Path to the configuration file directory.
+# This variable is set by the want/need_apache functions.
 
 # @ECLASS-VARIABLE: APACHE_MODULES_CONFDIR
 # @DESCRIPTION:
-# Path where module configuration files are kept
+# Path where module configuration files are kept.
+# This variable is set by the want/need_apache functions.
 
 # @ECLASS-VARIABLE: APACHE_VHOSTS_CONFDIR
 # @DESCRIPTION:
-# Path where virtual host configuration files are kept
+# Path where virtual host configuration files are kept.
+# This variable is set by the want/need_apache functions.
 
 # @ECLASS-VARIABLE: APACHE_MODULESDIR
 # @DESCRIPTION:
-# Path where we install modules
+# Path where we install modules.
+# This variable is set by the want/need_apache functions.
 
 # @ECLASS-VARIABLE: APACHE_DEPEND
 # @DESCRIPTION:
@@ -101,9 +133,20 @@
 # ==============================================================================
 
 # @FUNCTION: want_apache
+# @USAGE: [myiuse]
+# @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.
+want_apache() {
+	debug-print-function $FUNCNAME $*
+	want_apache2 "$@"
+}
+
+# @FUNCTION: want_apache2
+# @USAGE: [myiuse]
 # @DESCRIPTION:
 # An ebuild calls this to get the dependency information for optional apache-2.x
-# support.
+# support. If the myiuse parameter is not given it defaults to apache2.
 want_apache2() {
 	debug-print-function $FUNCNAME $*
 
@@ -119,10 +162,12 @@
 	fi
 }
 
-# @FUNCTION: want_apache
+# @FUNCTION: want_apache2_2
+# @USAGE: [myiuse]
 # @DESCRIPTION:
 # An ebuild calls this to get the dependency information for optional
-# apache-2.2.x support.
+# apache-2.2.x support. If the myiuse parameter is not given it defaults to
+# apache2.
 want_apache2_2() {
 	debug-print-function $FUNCNAME $*
 
@@ -138,19 +183,17 @@
 	fi
 }
 
-# @FUNCTION: want_apache
+# @FUNCTION: need_apache
 # @DESCRIPTION:
-# An ebuild calls this to get the dependency information for optional apache
-# support.
-want_apache() {
+# An ebuild calls this to get the dependency information for apache.
+need_apache() {
 	debug-print-function $FUNCNAME $*
-	want_apache2 "$@"
+	need_apache2
 }
 
 # @FUNCTION: need_apache2
 # @DESCRIPTION:
-# Works like need_apache, but its used by modules that only support
-# apache 2.x and do not work with other versions.
+# An ebuild calls this to get the dependency information for apache-2.x.
 need_apache2() {
 	debug-print-function $FUNCNAME $*
 
@@ -161,8 +204,7 @@
 
 # @FUNCTION: need_apache2_2
 # @DESCRIPTION:
-# Works like need_apache, but its used by modules that only support
-# apache 2.2.x and do not work with other versions.
+# An ebuild calls this to get the dependency information for apache-2.2.x.
 need_apache2_2() {
 	debug-print-function $FUNCNAME $*
 
@@ -170,14 +212,3 @@
 	RDEPEND="${RDEPEND} ${APACHE2_2_DEPEND}"
 	_init_apache2
 }
-
-# @FUNCTION: need_apache
-# @DESCRIPTION:
-# An ebuild calls this to get the dependency information for apache. An
-# ebuild should use this in order for future changes to the build infrastructure
-# to happen seamlessly. All an ebuild needs to do is include the line
-# need_apache somewhere.
-need_apache() {
-	debug-print-function $FUNCNAME $*
-	need_apache2
-}



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass
@ 2008-02-06 13:16 Benedikt Boehm (hollow)
  0 siblings, 0 replies; 11+ messages in thread
From: Benedikt Boehm (hollow) @ 2008-02-06 13:16 UTC (permalink / raw
  To: gentoo-commits

hollow      08/02/06 13:16:17

  Modified:             depend.apache.eclass
  Log:
  add check_apache_threads()

Revision  Changes    Path
1.41                 eclass/depend.apache.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.41&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.41&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.40&r2=1.41

Index: depend.apache.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- depend.apache.eclass	6 Feb 2008 08:33:47 -0000	1.40
+++ depend.apache.eclass	6 Feb 2008 13:16:17 -0000	1.41
@@ -1,6 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.40 2008/02/06 08:33:47 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.41 2008/02/06 13:16:17 hollow Exp $
 
 # @ECLASS: depend.apache.eclass
 # @MAINTAINER: apache-devs@gentoo.org
@@ -48,7 +48,7 @@
 
 # @ECLASS-VARIABLE: APXS
 # @DESCRIPTION:
-# Paths to the apxs tool.
+# Path to the apxs tool.
 # This variable is set by the want/need_apache functions.
 
 # @ECLASS-VARIABLE: APACHE_BIN
@@ -212,3 +212,26 @@
 	RDEPEND="${RDEPEND} ${APACHE2_2_DEPEND}"
 	_init_apache2
 }
+
+# @FUNCTION: check_apache_threads
+# @USAGE: [myflag]
+# @DESCRIPTION:
+# An ebuild calls this to make sure thread-safety is enabled if apache has been
+# built with a threaded MPM. If the myflag parameter is not given it defaults to
+# threads.
+check_apache_threads() {
+	debug-print-function $FUNCNAME $*
+
+	if ! built_with_use www-servers/apache threads ; then
+		return
+	fi
+
+	local myflag="${1:-threads}"
+
+	if ! use ${myflag}; then
+		echo
+		eerror "You need to enable USE flag '${myflag}' to build a thread-safe version"
+		eerror "of ${CATEGORY}/${PN} for use with www-servers/apache"
+		die "Need missing USE flag '${myflag}'"
+	fi
+}



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass
@ 2008-02-06 21:20 Benedikt Boehm (hollow)
  0 siblings, 0 replies; 11+ messages in thread
From: Benedikt Boehm (hollow) @ 2008-02-06 21:20 UTC (permalink / raw
  To: gentoo-commits

hollow      08/02/06 21:20:41

  Modified:             depend.apache.eclass
  Log:
  add check_apache_threads_in; add APACHE_INCLUDEDIR; remove legacy APACHECTL

Revision  Changes    Path
1.42                 eclass/depend.apache.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.42&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.42&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.41&r2=1.42

Index: depend.apache.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- depend.apache.eclass	6 Feb 2008 13:16:17 -0000	1.41
+++ depend.apache.eclass	6 Feb 2008 21:20:41 -0000	1.42
@@ -1,6 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.41 2008/02/06 13:16:17 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.42 2008/02/06 21:20:41 hollow Exp $
 
 # @ECLASS: depend.apache.eclass
 # @MAINTAINER: apache-devs@gentoo.org
@@ -114,8 +114,7 @@
 	APXS="/usr/sbin/apxs2"
 	APACHE_BIN="/usr/sbin/apache2"
 	APACHE_CTL="/usr/sbin/apache2ctl"
-	# legacy alias
-	APACHECTL="${APACHE_CTL}"
+	APACHE_INCLUDEDIR="/usr/include/apache2"
 	APACHE_BASEDIR="/usr/$(get_libdir)/apache2"
 	APACHE_CONFDIR="/etc/apache2"
 	APACHE_MODULES_CONFDIR="${APACHE_CONFDIR}/modules.d"
@@ -228,10 +227,35 @@
 
 	local myflag="${1:-threads}"
 
-	if ! use ${myflag}; then
+	if ! use ${myflag} ; then
 		echo
 		eerror "You need to enable USE flag '${myflag}' to build a thread-safe version"
 		eerror "of ${CATEGORY}/${PN} for use with www-servers/apache"
 		die "Need missing USE flag '${myflag}'"
 	fi
 }
+
+# @FUNCTION: check_apache_threads_in
+# @USAGE: <myforeign> [myflag]
+# @DESCRIPTION:
+# An ebuild calls this to make sure thread-safety is enabled in a foreign
+# package if apache has been built with a threaded MPM. If the myflag parameter
+# is not given it defaults to threads.
+check_apache_threads_in() {
+	debug-print-function $FUNCNAME $*
+
+	if ! built_with_use www-servers/apache threads ; then
+		return
+	fi
+
+	local myforeign="$1"
+	local myflag="${2:-threads}"
+
+	if ! built_with_use ${myforeign} ${myflag} ; then
+		echo
+		eerror "You need to enable USE flag '${myflag}' in ${myforeign} to"
+		eerror "build a thread-safe version of ${CATEGORY}/${PN} for use"
+		eerror "with www-servers/apache"
+		die "Need missing USE flag '${myflag}' in ${myforeign}"
+	fi
+}



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass
@ 2008-02-06 23:45 Benedikt Boehm (hollow)
  0 siblings, 0 replies; 11+ messages in thread
From: Benedikt Boehm (hollow) @ 2008-02-06 23:45 UTC (permalink / raw
  To: gentoo-commits

hollow      08/02/06 23:45:14

  Modified:             depend.apache.eclass
  Log:
  rename check_apache_threads to has_apache_threads as suggested by dberkholz

Revision  Changes    Path
1.43                 eclass/depend.apache.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.43&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.43&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.42&r2=1.43

Index: depend.apache.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- depend.apache.eclass	6 Feb 2008 21:20:41 -0000	1.42
+++ depend.apache.eclass	6 Feb 2008 23:45:13 -0000	1.43
@@ -1,6 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.42 2008/02/06 21:20:41 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.43 2008/02/06 23:45:13 hollow Exp $
 
 # @ECLASS: depend.apache.eclass
 # @MAINTAINER: apache-devs@gentoo.org
@@ -212,13 +212,13 @@
 	_init_apache2
 }
 
-# @FUNCTION: check_apache_threads
+# @FUNCTION: has_apache_threads
 # @USAGE: [myflag]
 # @DESCRIPTION:
 # An ebuild calls this to make sure thread-safety is enabled if apache has been
 # built with a threaded MPM. If the myflag parameter is not given it defaults to
 # threads.
-check_apache_threads() {
+has_apache_threads() {
 	debug-print-function $FUNCNAME $*
 
 	if ! built_with_use www-servers/apache threads ; then
@@ -235,13 +235,13 @@
 	fi
 }
 
-# @FUNCTION: check_apache_threads_in
+# @FUNCTION: has_apache_threads_in
 # @USAGE: <myforeign> [myflag]
 # @DESCRIPTION:
 # An ebuild calls this to make sure thread-safety is enabled in a foreign
 # package if apache has been built with a threaded MPM. If the myflag parameter
 # is not given it defaults to threads.
-check_apache_threads_in() {
+has_apache_threads_in() {
 	debug-print-function $FUNCNAME $*
 
 	if ! built_with_use www-servers/apache threads ; then



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass
@ 2008-03-04 10:59 Benedikt Boehm (hollow)
  0 siblings, 0 replies; 11+ messages in thread
From: Benedikt Boehm (hollow) @ 2008-03-04 10:59 UTC (permalink / raw
  To: gentoo-commits

hollow      08/03/04 10:59:28

  Modified:             depend.apache.eclass
  Log:
  add has_apache; cleanup

Revision  Changes    Path
1.44                 eclass/depend.apache.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.44&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.44&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.43&r2=1.44

Index: depend.apache.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- depend.apache.eclass	6 Feb 2008 23:45:13 -0000	1.43
+++ depend.apache.eclass	4 Mar 2008 10:59:27 -0000	1.44
@@ -1,9 +1,10 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.43 2008/02/06 23:45:13 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.44 2008/03/04 10:59:27 hollow Exp $
 
 # @ECLASS: depend.apache.eclass
-# @MAINTAINER: apache-devs@gentoo.org
+# @MAINTAINER:
+# apache-devs@gentoo.org
 # @BLURB: Functions to allow ebuilds to depend on apache
 # @DESCRIPTION:
 # This eclass handles depending on apache in a sane way and provides information
@@ -21,18 +22,18 @@
 # Here is an example of an ebuild depending on apache:
 #
 # @CODE
-#   DEPEND="virtual/Perl-CGI"
-#   RDEPEND="${DEPEND}"
-#   need_apache2
+# DEPEND="virtual/Perl-CGI"
+# RDEPEND="${DEPEND}"
+# need_apache2
 # @CODE
 #
 # Another example which demonstrates non-standard IUSE options for optional
 # apache support:
 #
 # @CODE
-#   DEPEND="server? ( virtual/Perl-CGI )"
-#   RDEPEND="${DEPEND}"
-#   want_apache2 server
+# DEPEND="server? ( virtual/Perl-CGI )"
+# RDEPEND="${DEPEND}"
+# want_apache2 server
 # @CODE
 
 inherit multilib
@@ -154,7 +155,7 @@
 	DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )"
 	RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )"
 
-	if use ${myiuse} ; then
+	if use ${myiuse}; then
 		_init_apache2
 	else
 		_init_no_apache
@@ -175,7 +176,7 @@
 	DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
 	RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
 
-	if use ${myiuse} ; then
+	if use ${myiuse}; then
 		_init_apache2
 	else
 		_init_no_apache
@@ -212,6 +213,21 @@
 	_init_apache2
 }
 
+# @FUNCTION: has_apache
+# @DESCRIPTION:
+# An ebuild calls this to get runtime variables for an indirect apache
+# dependency without USE-flag, in which case want_apache does not work.
+# DO NOT call this function in global scope.
+has_apache() {
+	debug-print-function $FUNCNAME $*
+
+	if has_version '>=www-servers/apache-2'; then
+		_init_apache2
+	else
+		_init_no_apache
+	fi
+}
+
 # @FUNCTION: has_apache_threads
 # @USAGE: [myflag]
 # @DESCRIPTION:
@@ -221,13 +237,13 @@
 has_apache_threads() {
 	debug-print-function $FUNCNAME $*
 
-	if ! built_with_use www-servers/apache threads ; then
+	if ! built_with_use www-servers/apache threads; then
 		return
 	fi
 
 	local myflag="${1:-threads}"
 
-	if ! use ${myflag} ; then
+	if ! use ${myflag}; then
 		echo
 		eerror "You need to enable USE flag '${myflag}' to build a thread-safe version"
 		eerror "of ${CATEGORY}/${PN} for use with www-servers/apache"
@@ -244,14 +260,14 @@
 has_apache_threads_in() {
 	debug-print-function $FUNCNAME $*
 
-	if ! built_with_use www-servers/apache threads ; then
+	if ! built_with_use www-servers/apache threads; then
 		return
 	fi
 
 	local myforeign="$1"
 	local myflag="${2:-threads}"
 
-	if ! built_with_use ${myforeign} ${myflag} ; then
+	if ! built_with_use ${myforeign} ${myflag}; then
 		echo
 		eerror "You need to enable USE flag '${myflag}' in ${myforeign} to"
 		eerror "build a thread-safe version of ${CATEGORY}/${PN} for use"



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass
@ 2009-05-26 16:41 Arfrever Frehtes Taifersar Arahesis (arfrever)
  0 siblings, 0 replies; 11+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-05-26 16:41 UTC (permalink / raw
  To: gentoo-commits

arfrever    09/05/26 16:41:56

  Modified:             depend.apache.eclass
  Log:
  Add depend.apache_pkg_setup() and don't call use() in functions called in "depend" phase (bug #268371).

Revision  Changes    Path
1.45                 eclass/depend.apache.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.45&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.45&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.44&r2=1.45

Index: depend.apache.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- depend.apache.eclass	4 Mar 2008 10:59:27 -0000	1.44
+++ depend.apache.eclass	26 May 2009 16:41:56 -0000	1.45
@@ -1,6 +1,6 @@
-# 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 $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.45 2009/05/26 16:41:56 arfrever Exp $
 
 # @ECLASS: depend.apache.eclass
 # @MAINTAINER:
@@ -34,6 +34,10 @@
 # DEPEND="server? ( virtual/Perl-CGI )"
 # RDEPEND="${DEPEND}"
 # want_apache2 server
+#
+# pkg_setup() {
+# 	depend.apache_pkg_setup server
+# }
 # @CODE
 
 inherit multilib
@@ -132,11 +136,36 @@
 # PUBLIC FUNCTIONS
 # ==============================================================================
 
+# @FUNCTION: depend.apache_pkg_setup
+# @USAGE: [myiuse]
+# @DESCRIPTION:
+# An ebuild calls this in pkg_setup() to initialize variables for optional
+# apache-2.x support. If the myiuse parameter is not given it defaults to
+# apache2.
+depend.apache_pkg_setup() {
+	debug-print-function $FUNCNAME $*
+
+	if [[ "${EBUILD_PHASE}" != "setup" ]]; then
+		die "$FUNCNAME() should be called in pkg_setup()"
+	fi
+
+	local myiuse=${1:-apache2}
+	if has ${myiuse} ${IUSE}; then
+		if use ${myiuse}; then
+			_init_apache2
+		else
+			_init_no_apache
+		fi
+	fi
+}
+
 # @FUNCTION: want_apache
 # @USAGE: [myiuse]
 # @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 depend.apache_pkg_setup() in pkg_setup()
+# with the same myiuse parameter.
 want_apache() {
 	debug-print-function $FUNCNAME $*
 	want_apache2 "$@"
@@ -147,6 +176,8 @@
 # @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 depend.apache_pkg_setup() in pkg_setup()
+# with the same myiuse parameter.
 want_apache2() {
 	debug-print-function $FUNCNAME $*
 
@@ -154,12 +185,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 +193,8 @@
 # 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 depend.apache_pkg_setup() in pkg_setup()
+# with the same myiuse parameter.
 want_apache2_2() {
 	debug-print-function $FUNCNAME $*
 
@@ -175,12 +202,6 @@
 	IUSE="${IUSE} ${myiuse}"
 	DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
 	RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
-
-	if use ${myiuse}; then
-		_init_apache2
-	else
-		_init_no_apache
-	fi
 }
 
 # @FUNCTION: need_apache
@@ -275,3 +296,5 @@
 		die "Need missing USE flag '${myflag}' in ${myforeign}"
 	fi
 }
+
+EXPORT_FUNCTIONS pkg_setup






^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-05-26 16:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-06  8:33 [gentoo-commits] gentoo-x86 commit in eclass: depend.apache.eclass Benedikt Boehm (hollow)
  -- strict thread matches above, loose matches on Subject: below --
2009-05-26 16:41 Arfrever Frehtes Taifersar Arahesis (arfrever)
2008-03-04 10:59 Benedikt Boehm (hollow)
2008-02-06 23:45 Benedikt Boehm (hollow)
2008-02-06 21:20 Benedikt Boehm (hollow)
2008-02-06 13:16 Benedikt Boehm (hollow)
2008-02-03 14:12 Benedikt Boehm (hollow)
2008-02-03 11:51 Benedikt Boehm (hollow)
2008-02-02 14:31 Benedikt Boehm (hollow)
2008-02-02 12:53 Benedikt Boehm (hollow)
2007-09-08 14:06 Benedikt Boehm (hollow)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox