/[gentoo-x86]/eclass/apache-module.eclass
Gentoo

Diff of /eclass/apache-module.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.4
1# Copyright 2004 Gentoo Foundation 1# Copyright 2004 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License, v2 or later 2# Distributed under the terms of the GNU General Public License, v2 or later
3# Author Michael Tindal <urilith@gentoo.org> 3# Author Michael Tindal <urilith@gentoo.org>
4# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.3 2005/01/21 08:06:38 vericgar Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.4 2005/02/21 01:35:40 vericgar Exp $
5ECLASS=apache-module 5ECLASS=apache-module
6INHERITED="$INHERITED $ECLASS" 6INHERITED="$INHERITED $ECLASS"
7 7
8inherit depend.apache 8inherit depend.apache
9 9
231## know they need prefork, and then exit the build. 231## know they need prefork, and then exit the build.
232#### 232####
233apache2_pkg_setup() { 233apache2_pkg_setup() {
234 debug-print-function apache2_pkg_setup 234 debug-print-function apache2_pkg_setup
235 235
236 if [ -n "${APACHE2_MT_UNSAFEE}" ]; then 236 if [ -n "${APACHE2_SAFE_MPMS}" ]; then
237 if [ "x${APACHE2_MT_UNSAFE}" != "no" ]; then
238 APACHE2_MPM_STYLE=`/usr/sbin/apxs2 -q MPM_NAME`
239 if [ "x$APACHE2_MPM_STYLE" != "xprefork" ]; then
240 eerror "You currently have Apache configured to use the."
241 eerror "$APACHE2_MPM_STYLE MPM style. The module you are"
242 eerror "trying to install is not currently thread-safe,"
243 eerror "and will not work under your current configuraiton."
244 echo
245 eerror "If you still want to use the module, please reinstall"
246 eerror "Apache with mpm-prefork set."
247 237
248 epause 238 INSTALLED_MPMS=$(ls ${ROOT}/usr/sbin/apache2.*)
249 ebeep 239
250 die Invalid Apache MPM style. 240 for mpm in ${INSTALLED_MPMS}; do
241 # strip everything up to and including 'apache2.' from ${mpm}
242 mpm=${mpm#*apache2.}
243
244 if hasq ${mpm} ${APACHE2_SAFE_MPMS} ; then
245 INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}"
251 fi 246 fi
247 done
248
249 if [ -z "${INSTALLED_MPM_SAFE}" ] ; then
250 eerror "The module you are trying to install (${PN})"
251 eerror "will only work with one of the following MPMs:"
252 eerror " ${APACHE2_SAFE_MPMS}"
253 eerror "You do not currently have any of these MPMs installed."
254 eerror "Please re-install apache with the correct mpm-* USE flag set."
255 die "No safe MPM installed."
252 fi 256 fi
257
253 fi 258 fi
259
254} 260}
255 261
256#### 262####
257## apache2_src_compile 263## apache2_src_compile
258## 264##
326 einfo "Configuration file installed as" 332 einfo "Configuration file installed as"
327 einfo " ${APACHE2_MODULES_CONFDIR}/$(basename ${APACHE2_MOD_CONF}).conf" 333 einfo " ${APACHE2_MODULES_CONFDIR}/$(basename ${APACHE2_MOD_CONF}).conf"
328 einfo "You may want to edit it before turning the module on in /etc/conf.d/apache2" 334 einfo "You may want to edit it before turning the module on in /etc/conf.d/apache2"
329 einfo 335 einfo
330 fi 336 fi
337
338 if [ -n "${APACHE2_SAFE_MPMS}" ]; then
339
340 INSTALLED_MPMS=$(ls ${ROOT}/usr/sbin/apache2.*)
341
342 for mpm in ${INSTALLED_MPMS}; do
343 # strip everything up to and including 'apache2.' from ${mpm}
344 mpm=${mpm#*apache2.}
345
346 if ! hasq ${mpm} ${APACHE2_SAFE_MPMS} ; then
347 INSTALLED_MPM_UNSAFE="${INSTALLED_MPM_UNSAFE} ${mpm}"
348 else
349 INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}"
350 fi
351 done
352
353 if [ -n "${INSTALLED_MPM_UNSAFE}" ] ; then
354 ewarn "You have one or more MPMs installed that will not work with"
355 ewarn "this module (${PN}). Please make sure that you only enable"
356 ewarn "this module if you are using one of the following MPMs:"
357 ewarn " ${INSTALLED_MPM_SAFE}"
358 fi
359
360 fi
361
362
331} 363}
332 364
333###### 365######
334## Apache dual (1.x or 2.x) ebuild functions 366## Apache dual (1.x or 2.x) ebuild functions
335## 367##

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20