/[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.4 Revision 1.9
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.4 2005/02/21 01:35:40 vericgar Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.9 2005/06/04 18:13:05 vericgar Exp $
5ECLASS=apache-module 5ECLASS=apache-module
6INHERITED="$INHERITED $ECLASS" 6INHERITED="$INHERITED $ECLASS"
7 7
8inherit depend.apache 8inherit depend.apache
9 9
175 cd ${CD_DIR} || die "cd ${CD_DIR} failed" 175 cd ${CD_DIR} || die "cd ${CD_DIR} failed"
176 176
177 MOD_FILE=$(apache_mod_file) 177 MOD_FILE=$(apache_mod_file)
178 178
179 exeinto ${APACHE1_MODULESDIR} 179 exeinto ${APACHE1_MODULESDIR}
180 doexe ${MOD_FILE} || die "internal ebuild error: \'${MOD_FILE}\' not found" 180 doexe ${MOD_FILE} || die "internal ebuild error: '${MOD_FILE}' not found"
181 [ -n "${APACHE1_EXECFILES}" ] && doexe ${APACHE1_EXECFILES} 181 [ -n "${APACHE1_EXECFILES}" ] && doexe ${APACHE1_EXECFILES}
182 182
183 if [ -n "${APACHE1_MOD_CONF}" ] ; then 183 if [ -n "${APACHE1_MOD_CONF}" ] ; then
184 insinto ${APACHE1_MODULES_CONFDIR} 184 insinto ${APACHE1_MODULES_CONFDIR}
185 doins ${FILESDIR}/${APACHE1_MOD_CONF}.conf || die "internal ebuild error: \'${APACHE2_MOD_CONF}.conf\' not found." 185 doins ${FILESDIR}/${APACHE1_MOD_CONF}.conf || die "internal ebuild error: '${FILESDIR}/${APACHE1_MOD_CONF}.conf' not found."
186 fi 186 fi
187 187
188 cd ${S} 188 cd ${S}
189 189
190 if [ -n "${DOCFILES}" ] ; then 190 if [ -n "${DOCFILES}" ] ; then
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_SAFE_MPMS}" ]; then 236 if [ -n "${APACHE2_SAFE_MPMS}" ]; then
237 237
238 INSTALLED_MPMS=$(ls ${ROOT}/usr/sbin/apache2.*) 238 INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)"
239 239
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 240 if hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then
245 INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}" 241 INSTALLED_MPM_SAFE="yes"
246 fi 242 fi
247 done
248 243
249 if [ -z "${INSTALLED_MPM_SAFE}" ] ; then 244 if [ -z "${INSTALLED_MPM_SAFE}" ] ; then
250 eerror "The module you are trying to install (${PN})" 245 eerror "The module you are trying to install (${PN})"
251 eerror "will only work with one of the following MPMs:" 246 eerror "will only work with one of the following MPMs:"
252 eerror " ${APACHE2_SAFE_MPMS}" 247 eerror " ${APACHE2_SAFE_MPMS}"
292 cd ${CD_DIR} || die "cd ${CD_DIR} failed" 287 cd ${CD_DIR} || die "cd ${CD_DIR} failed"
293 288
294 MOD_FILE=$(apache_mod_file) 289 MOD_FILE=$(apache_mod_file)
295 290
296 exeinto ${APACHE2_MODULESDIR} 291 exeinto ${APACHE2_MODULESDIR}
297 doexe ${MOD_FILE} || die "internal ebuild error: \'${MOD_FILE}\' not found" 292 doexe ${MOD_FILE} || die "internal ebuild error: '${MOD_FILE}' not found"
298 [ -n "${APACHE2_EXECFILES}" ] && doexe ${APACHE2_EXECFILES} 293 [ -n "${APACHE2_EXECFILES}" ] && doexe ${APACHE2_EXECFILES}
299 294
300 if [ -n "${APACHE2_MOD_CONF}" ] ; then 295 if [ -n "${APACHE2_MOD_CONF}" ] ; then
301 insinto ${APACHE2_MODULES_CONFDIR} 296 insinto ${APACHE2_MODULES_CONFDIR}
302 doins ${FILESDIR}/${APACHE2_MOD_CONF}.conf || die "internal ebuild error: \'${APACHE2_MOD_CONF}.conf\' not found." 297 doins ${FILESDIR}/${APACHE2_MOD_CONF}.conf || die "internal ebuild error: '${FILESDIR}/${APACHE2_MOD_CONF}.conf' not found."
303 fi 298 fi
304 299
305 if [ -n "${APACHE2_VHOSTFILE}" ]; then 300 if [ -n "${APACHE2_VHOSTFILE}" ]; then
306 insinto ${APACHE2_MODULES_VHOSTDIR} 301 insinto ${APACHE2_MODULES_VHOSTDIR}
307 doins ${FILESDIR}/${APACHE2_VHOSTFILE}.conf 302 doins ${FILESDIR}/${APACHE2_VHOSTFILE}.conf
335 einfo 330 einfo
336 fi 331 fi
337 332
338 if [ -n "${APACHE2_SAFE_MPMS}" ]; then 333 if [ -n "${APACHE2_SAFE_MPMS}" ]; then
339 334
340 INSTALLED_MPMS=$(ls ${ROOT}/usr/sbin/apache2.*) 335 INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)"
341 336
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 337 if ! hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then
347 INSTALLED_MPM_UNSAFE="${INSTALLED_MPM_UNSAFE} ${mpm}" 338 INSTALLED_MPM_UNSAFE="${INSTALLED_MPM_UNSAFE} ${mpm}"
348 else 339 else
349 INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}" 340 INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}"
350 fi 341 fi
351 done 342
352
353 if [ -n "${INSTALLED_MPM_UNSAFE}" ] ; then 343 if [ -n "${INSTALLED_MPM_UNSAFE}" ] ; then
354 ewarn "You have one or more MPMs installed that will not work with" 344 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" 345 ewarn "this module (${PN}). Please make sure that you only enable"
356 ewarn "this module if you are using one of the following MPMs:" 346 ewarn "this module if you are using one of the following MPMs:"
357 ewarn " ${INSTALLED_MPM_SAFE}" 347 ewarn " ${INSTALLED_MPM_SAFE}"

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

  ViewVC Help
Powered by ViewVC 1.1.20