summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /eclass/depend.apache.eclass
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'eclass/depend.apache.eclass')
-rw-r--r--eclass/depend.apache.eclass317
1 files changed, 317 insertions, 0 deletions
diff --git a/eclass/depend.apache.eclass b/eclass/depend.apache.eclass
new file mode 100644
index 00000000000..22a8216a02d
--- /dev/null
+++ b/eclass/depend.apache.eclass
@@ -0,0 +1,317 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# @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 provides information
+# about where certain binaries and configuration files are located.
+#
+# 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.
+#
+# @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
+#
+# pkg_setup() {
+# depend.apache_pkg_setup server
+# }
+# @CODE
+
+inherit multilib
+
+# ==============================================================================
+# INTERNAL VARIABLES
+# ==============================================================================
+
+# @ECLASS-VARIABLE: APACHE_VERSION
+# @DESCRIPTION:
+# 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:
+# Path 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: APACHE_CTL
+# @DESCRIPTION:
+# 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.
+# This variable is set by the want/need_apache functions.
+
+# @ECLASS-VARIABLE: APACHE_CONFDIR
+# @DESCRIPTION:
+# 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.
+# This variable is set by the want/need_apache functions.
+
+# @ECLASS-VARIABLE: APACHE_VHOSTS_CONFDIR
+# @DESCRIPTION:
+# 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.
+# This variable is set by the want/need_apache functions.
+
+# @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_2_DEPEND
+# @DESCRIPTION:
+# Dependencies for Apache 2.2.x
+APACHE2_2_DEPEND="=www-servers/apache-2.2*"
+
+# @ECLASS-VARIABLE: APACHE2_4_DEPEND
+# @DESCRIPTION:
+# Dependencies for Apache 2.4.x
+APACHE2_4_DEPEND="=www-servers/apache-2.4*"
+
+
+# ==============================================================================
+# INTERNAL FUNCTIONS
+# ==============================================================================
+
+_init_apache2() {
+ debug-print-function $FUNCNAME $*
+
+ # WARNING: Do not use these variables with anything that is put
+ # into the dependency cache (DEPEND/RDEPEND/etc)
+ APACHE_VERSION="2"
+ APXS="/usr/sbin/apxs2"
+ APACHE_BIN="/usr/sbin/apache2"
+ APACHE_CTL="/usr/sbin/apache2ctl"
+ APACHE_INCLUDEDIR="/usr/include/apache2"
+ 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"
+}
+
+_init_no_apache() {
+ debug-print-function $FUNCNAME $*
+ APACHE_VERSION="0"
+}
+
+# ==============================================================================
+# 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 "$@"
+}
+
+# @FUNCTION: want_apache2
+# @USAGE: [myiuse]
+# @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 $*
+
+ local myiuse=${1:-apache2}
+ IUSE="${IUSE} ${myiuse}"
+ DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )"
+ RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_DEPEND} )"
+}
+
+# @FUNCTION: want_apache2_2
+# @USAGE: [myiuse]
+# @DESCRIPTION:
+# 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 $*
+
+ local myiuse=${1:-apache2}
+ IUSE="${IUSE} ${myiuse}"
+ DEPEND="${DEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
+ RDEPEND="${RDEPEND} ${myiuse}? ( ${APACHE2_2_DEPEND} )"
+}
+
+# @FUNCTION: need_apache
+# @DESCRIPTION:
+# An ebuild calls this to get the dependency information for apache.
+need_apache() {
+ debug-print-function $FUNCNAME $*
+ need_apache2
+}
+
+# @FUNCTION: need_apache2
+# @DESCRIPTION:
+# An ebuild calls this to get the dependency information for apache-2.x.
+need_apache2() {
+ debug-print-function $FUNCNAME $*
+
+ DEPEND="${DEPEND} ${APACHE2_DEPEND}"
+ RDEPEND="${RDEPEND} ${APACHE2_DEPEND}"
+ _init_apache2
+}
+
+# @FUNCTION: need_apache2_2
+# @DESCRIPTION:
+# An ebuild calls this to get the dependency information for apache-2.2.x.
+need_apache2_2() {
+ debug-print-function $FUNCNAME $*
+
+ DEPEND="${DEPEND} ${APACHE2_2_DEPEND}"
+ RDEPEND="${RDEPEND} ${APACHE2_2_DEPEND}"
+ _init_apache2
+}
+
+# @FUNCTION: need_apache2_4
+# @DESCRIPTION:
+# An ebuild calls this to get the dependency information for apache-2.4.x.
+need_apache2_4() {
+ debug-print-function $FUNCNAME $*
+
+ DEPEND="${DEPEND} ${APACHE2_4_DEPEND}"
+ RDEPEND="${RDEPEND} ${APACHE2_4_DEPEND}"
+ _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:
+# 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.
+has_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
+}
+
+# @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.
+has_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
+}
+
+EXPORT_FUNCTIONS pkg_setup