summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Longinotti <chtekk@gentoo.org>2007-05-12 02:28:51 +0000
committerLuca Longinotti <chtekk@gentoo.org>2007-05-12 02:28:51 +0000
commit1829849dd64368b03be69e3d35648ef4b33731ad (patch)
tree588d25a7b14476bf195bd6fff0c253fbdf0ccd19 /eclass/apache-module.eclass
parentMove from kernel to kernel-misc herd (diff)
downloadhistorical-1829849dd64368b03be69e3d35648ef4b33731ad.tar.gz
historical-1829849dd64368b03be69e3d35648ef4b33731ad.tar.bz2
historical-1829849dd64368b03be69e3d35648ef4b33731ad.zip
Update for Apache 1.X masking.
Diffstat (limited to 'eclass/apache-module.eclass')
-rw-r--r--eclass/apache-module.eclass148
1 files changed, 63 insertions, 85 deletions
diff --git a/eclass/apache-module.eclass b/eclass/apache-module.eclass
index 610fea3d5cd9..6fbbc3c81459 100644
--- a/eclass/apache-module.eclass
+++ b/eclass/apache-module.eclass
@@ -1,7 +1,6 @@
-# Copyright 2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License, v2 or later
-# Author Michael Tindal <urilith@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.18 2006/11/26 21:25:28 vericgar Exp $
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.19 2007/05/12 02:28:51 chtekk Exp $
inherit depend.apache
@@ -9,7 +8,7 @@ inherit depend.apache
# 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 RDEPEND=DEPEND that portage does if you use this eclass.
+# automatic RDEPEND=DEPEND that Portage does if you use this eclass.
# See bug 107127 for more information.
######
@@ -78,15 +77,15 @@ DOCFILES=""
apache_cd_dir() {
debug-print-function $FUNCNAME $*
- if [ "${APACHE_VERSION}" == "1" ]; then
- [ -n "${APXS1_S}" ] && CD_DIR="${APXS1_S}"
+ if [[ "${APACHE_VERSION}" == "1" ]] ; then
+ [[ -n "${APXS1_S}" ]] && CD_DIR="${APXS1_S}"
else
- [ -n "${APXS2_S}" ] && CD_DIR="${APXS2_S}"
+ [[ -n "${APXS2_S}" ]] && CD_DIR="${APXS2_S}"
fi
- # XXX - is this really needed? can't we just return ${S}?
- if [ -z "${CD_DIR}" ]; then
- if [ -d ${S}/src ] ; then
+ # XXX - Is this really needed? Can't we just return ${S}?
+ if [[ -z "${CD_DIR}" ]] ; then
+ if [[ -d "${S}/src" ]] ; then
CD_DIR="${S}/src"
else
CD_DIR="${S}"
@@ -94,7 +93,7 @@ apache_cd_dir() {
fi
debug-print apache_cd_dir: "CD_DIR=${CD_DIR}"
- echo ${CD_DIR}
+ echo "${CD_DIR}"
}
####
@@ -105,22 +104,22 @@ apache_cd_dir() {
apache_mod_file() {
debug-print-function $FUNCNAME $*
- if [ "${APACHE_VERSION}" == "1" ]; then
- [ -n "${APACHE1_MOD_FILE}" ] && MOD_FILE="${APACHE1_MOD_FILE}"
- [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/${PN}.so"
+ if [[ "${APACHE_VERSION}" == "1" ]] ; then
+ [[ -n "${APACHE1_MOD_FILE}" ]] && MOD_FILE="${APACHE1_MOD_FILE}"
+ [[ -z "${MOD_FILE}" ]] && MOD_FILE="$(apache_cd_dir)/${PN}.so"
else
- [ -n "${APACHE2_MOD_FILE}" ] && MOD_FILE="${APACHE2_MOD_FILE}"
- [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/.libs/${PN}.so"
+ [[ -n "${APACHE2_MOD_FILE}" ]] && MOD_FILE="${APACHE2_MOD_FILE}"
+ [[ -z "${MOD_FILE}" ]] && MOD_FILE="$(apache_cd_dir)/.libs/${PN}.so"
fi
- debug-print apache_mod_file: MOD_FILE=${MOD_FILE}
- echo ${MOD_FILE}
+ debug-print apache_mod_file: "MOD_FILE=${MOD_FILE}"
+ echo "${MOD_FILE}"
}
####
## apache_doc_magic
##
-## Some magic for picking out html files from ${DOCFILES}. It takes
+## Some magic for picking out html files from ${DOCFILES}. It takes
## an optional first argument `html'; if the first argument is equals
## `html', only html files are returned, otherwise normal (non-html)
## docs are returned.
@@ -128,27 +127,24 @@ apache_mod_file() {
apache_doc_magic() {
debug-print-function $FUNCNAME $*
- if [ -n "${DOCFILES}" ]; then
- if [ "x$1" == "xhtml" ]; then
+ if [[ -n "${DOCFILES}" ]] ; then
+ if [[ "x$1" == "xhtml" ]] ; then
DOCS="`echo ${DOCFILES} | sed -e 's/ /\n/g' | sed -e '/^[^ ]*.html$/ !d'`"
else
DOCS="`echo ${DOCFILES} | sed 's, *[^ ]*\+.html, ,g'`"
fi
- debug-print apache_doc_magic: DOCS=${DOCS}
- echo ${DOCS}
+ debug-print apache_doc_magic: "DOCS=${DOCS}"
+ echo "${DOCS}"
fi
}
######
-## Apache 1.x ebuild functions
+## Apache 1.x ebuild functions - !!! DEPRECATED !!!
######
####
-## apache1_src_compile
-## The default action is to call ${APXS11} with the value of
-## ${APXS1_ARGS}. If a module requires a different build setup
-## than this, use ${APXS1} in your own src_compile routine.
+## apache1_src_compile - !!! DEPRECATED !!!
####
apache1_src_compile() {
debug-print-function $FUNCNAME $*
@@ -160,16 +156,7 @@ apache1_src_compile() {
}
####
-## apache1_src_install
-##
-## This installs the files into apache's directories. The module is installed
-## from a directory chosen as above (APXS2_S or ${S}/src). In addition,
-## this function can also set the executable permission on files listed in EXECFILES.
-## The configuration file name is listed in APACHE1_MOD_CONF without the .conf extensions,
-## so if you configuration is 55_mod_foo.conf, APACHE1_MOD_CONF would be 55_mod_foo.
-## DOCFILES contains the list of files you want filed as documentation. The name of the
-## module can also be specified using the APACHE1_MOD_FILE or defaults to
-## .libs/${PN}.so.
+## apache1_src_install - !!! DEPRECATED !!!
####
apache1_src_install() {
debug-print-function $FUNCNAME $*
@@ -200,9 +187,7 @@ apache1_src_install() {
}
####
-## apache1_pkg_postinst
-##
-## Prints the standard config message, unless APACHE1_NO_CONFIG is set to yes.
+## apache1_pkg_postinst - !!! DEPRECATED !!!
####
apache1_pkg_postinst() {
debug-print-function $FUNCNAME $*
@@ -218,7 +203,7 @@ apache1_pkg_postinst() {
if [ -n "${APACHE1_MOD_CONF}" ] ; then
einfo
einfo "Configuration file installed as"
- einfo " ${APACHE1_MODULES_CONFDIR}/$(basename ${APACHE1_MOD_CONF}).conf"
+ einfo " ${APACHE1_MODULES_CONFDIR}/$(basename ${APACHE1_MOD_CONF}).conf"
einfo "You may want to edit it before turning the module on in /etc/conf.d/apache"
einfo
fi
@@ -231,46 +216,43 @@ apache1_pkg_postinst() {
####
## apache2_pkg_setup
##
-## Checks to see if APACHE2_MT_UNSAFE is set to anything other than "no". If it is, then
+## Checks to see if APACHE2_MT_UNSAFE is set to anything other than "no". If it is, then
## we check what the MPM style used by Apache is, if it isnt prefork, we let the user
## know they need prefork, and then exit the build.
####
apache2_pkg_setup() {
debug-print-function $FUNCNAME $*
- if [ -n "${APACHE2_SAFE_MPMS}" ]; then
-
+ if [[ -n "${APACHE2_SAFE_MPMS}" ]] ; then
INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)"
if hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then
INSTALLED_MPM_SAFE="yes"
fi
- if [ -z "${INSTALLED_MPM_SAFE}" ] ; then
+ if [[ -z "${INSTALLED_MPM_SAFE}" ]] ; then
eerror "The module you are trying to install (${PN})"
eerror "will only work with one of the following MPMs:"
- eerror " ${APACHE2_SAFE_MPMS}"
+ eerror " ${APACHE2_SAFE_MPMS}"
eerror "You do not currently have any of these MPMs installed."
eerror "Please re-install apache with the correct mpm-* USE flag set."
die "No safe MPM installed."
fi
-
fi
-
}
####
## apache2_src_compile
##
## The default action is to call ${APXS2} with the value of
-## ${APXS2_ARGS}. If a module requires a different build setup
+## ${APXS2_ARGS}. If a module requires a different build setup
## than this, use ${APXS2} in your own src_compile routine.
####
apache2_src_compile() {
debug-print-function $FUNCNAME $*
CD_DIR=$(apache_cd_dir)
- cd ${CD_DIR} || die "cd ${CD_DIR} failed"
+ cd "${CD_DIR}" || die "cd ${CD_DIR} failed"
APXS2_ARGS="${APXS2_ARGS:--c ${PN}.c}"
${APXS2} ${APXS2_ARGS} || die "${APXS2} ${APXS2_ARGS} failed"
}
@@ -278,8 +260,8 @@ apache2_src_compile() {
####
## apache2_src_install
##
-## This installs the files into apache's directories. The module is installed
-## from a directory chosen as above (APXS2_S or ${S}/src). In addition,
+## This installs the files into apache's directories. The module is installed
+## from a directory chosen as above (APXS2_S or ${S}/src). In addition,
## this function can also set the executable permission on files listed in EXECFILES.
## The configuration file name is listed in CONFFILE without the .conf extensions,
## so if you configuration is 55_mod_foo.conf, CONFFILE would be 55_mod_foo.
@@ -289,39 +271,39 @@ apache2_src_install() {
debug-print-function $FUNCNAME $*
CD_DIR=$(apache_cd_dir)
- cd ${CD_DIR} || die "cd ${CD_DIR} failed"
+ cd "${CD_DIR}" || die "cd ${CD_DIR} failed"
MOD_FILE=$(apache_mod_file)
- exeinto ${APACHE2_MODULESDIR}
+ exeinto "${APACHE2_MODULESDIR}"
doexe ${MOD_FILE} || die "internal ebuild error: '${MOD_FILE}' not found"
- [ -n "${APACHE2_EXECFILES}" ] && doexe ${APACHE2_EXECFILES}
+ [[ -n "${APACHE2_EXECFILES}" ]] && doexe ${APACHE2_EXECFILES}
- if [ -n "${APACHE2_MOD_CONF}" ] ; then
- insinto ${APACHE2_MODULES_CONFDIR}
- doins ${FILESDIR}/${APACHE2_MOD_CONF}.conf || die "internal ebuild error: '${FILESDIR}/${APACHE2_MOD_CONF}.conf' not found."
+ if [[ -n "${APACHE2_MOD_CONF}" ]] ; then
+ insinto "${APACHE2_MODULES_CONFDIR}"
+ doins "${FILESDIR}/${APACHE2_MOD_CONF}.conf" || die "internal ebuild error: '${FILESDIR}/${APACHE2_MOD_CONF}.conf' not found"
fi
- if [ -n "${APACHE2_VHOSTFILE}" ]; then
- insinto ${APACHE2_VHOSTDIR}
- doins ${FILESDIR}/${APACHE2_VHOSTFILE}.conf
+ if [[ -n "${APACHE2_VHOSTFILE}" ]] ; then
+ insinto "${APACHE2_VHOSTDIR}"
+ doins "${FILESDIR}/${APACHE2_VHOSTFILE}.conf" || die "internal ebuild error: '${FILESDIR}/${APACHE2_VHOSTFILE}.conf' not found"
fi
- cd ${S}
+ cd "${S}"
- if [ -n "${DOCFILES}" ] ; then
+ if [[ -n "${DOCFILES}" ]] ; then
OTHER_DOCS=$(apache_doc_magic)
HTML_DOCS=$(apache_doc_magic html)
- [ -n "${OTHER_DOCS}" ] && dodoc ${OTHER_DOCS}
- [ -n "${HTML_DOCS}" ] && dohtml ${HTML_DOCS}
+ [[ -n "${OTHER_DOCS}" ]] && dodoc ${OTHER_DOCS}
+ [[ -n "${HTML_DOCS}" ]] && dohtml ${HTML_DOCS}
fi
}
apache2_pkg_postinst() {
debug-print-function $FUNCNAME $*
- if [ -n "${APACHE2_MOD_DEFINE}" ]; then
+ if [[ -n "${APACHE2_MOD_DEFINE}" ]] ; then
local my_opts="-D ${APACHE2_MOD_DEFINE// / -D }"
einfo
@@ -329,7 +311,8 @@ apache2_pkg_postinst() {
einfo "add '${my_opts}' to APACHE2_OPTS."
einfo
fi
- if [ -n "${APACHE2_MOD_CONF}" ] ; then
+
+ if [[ -n "${APACHE2_MOD_CONF}" ]] ; then
einfo
einfo "Configuration file installed as"
einfo " ${APACHE2_MODULES_CONFDIR}/$(basename ${APACHE2_MOD_CONF}).conf"
@@ -337,8 +320,7 @@ apache2_pkg_postinst() {
einfo
fi
- if [ -n "${APACHE2_SAFE_MPMS}" ]; then
-
+ if [[ -n "${APACHE2_SAFE_MPMS}" ]] ; then
INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)"
if ! hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then
@@ -347,30 +329,28 @@ apache2_pkg_postinst() {
INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}"
fi
- if [ -n "${INSTALLED_MPM_UNSAFE}" ] ; then
+ if [[ -n "${INSTALLED_MPM_UNSAFE}" ]] ; then
ewarn "You have one or more MPMs installed that will not work with"
ewarn "this module (${PN}). Please make sure that you only enable"
ewarn "this module if you are using one of the following MPMs:"
- ewarn " ${INSTALLED_MPM_SAFE}"
+ ewarn " ${INSTALLED_MPM_SAFE}"
fi
-
fi
-
}
######
-## Apache dual (1.x or 2.x) ebuild functions
+## Apache dual (1.x or 2.x) ebuild functions - Apache 1.X DEPRECATED!
##
-## This is where the magic happens. We provide dummy routines of all of the functions
-## provided by all of the specifics. We use APACHE_ECLASS_VER_* to see which versions
-## to call. If a function is provided by a given section (ie pkg_postinst in Apache 2.x)
+## This is where the magic happens. We provide dummy routines of all of the functions
+## provided by all of the specifics. We use APACHE_ECLASS_VER_* to see which versions
+## to call. If a function is provided by a given section (ie pkg_postinst in Apache 2.x)
## the exported routine simply does nothing.
######
apache-module_pkg_setup() {
debug-print-function $FUNCNAME $*
- if [ ${APACHE_VERSION} -eq '2' ]; then
+ if [[ ${APACHE_VERSION} -eq "2" ]] ; then
apache2_pkg_setup
fi
}
@@ -378,7 +358,7 @@ apache-module_pkg_setup() {
apache-module_src_compile() {
debug-print-function $FUNCNAME $*
- if [ ${APACHE_VERSION} -eq '1' ]; then
+ if [[ ${APACHE_VERSION} -eq "1" ]] ; then
apache1_src_compile
else
apache2_src_compile
@@ -388,7 +368,7 @@ apache-module_src_compile() {
apache-module_src_install() {
debug-print-function $FUNCNAME $*
- if [ ${APACHE_VERSION} -eq '1' ]; then
+ if [[ ${APACHE_VERSION} -eq "1" ]] ; then
apache1_src_install
else
apache2_src_install
@@ -398,7 +378,7 @@ apache-module_src_install() {
apache-module_pkg_postinst() {
debug-print-function $FUNCNAME $*
- if [ ${APACHE_VERSION} -eq '1' ]; then
+ if [[ ${APACHE_VERSION} -eq "1" ]] ; then
apache1_pkg_postinst
else
apache2_pkg_postinst
@@ -406,5 +386,3 @@ apache-module_pkg_postinst() {
}
EXPORT_FUNCTIONS pkg_setup src_compile src_install pkg_postinst
-
-# vim:ts=4