/[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.6 Revision 1.12
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.6 2005/06/01 21:10:18 urilith Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.12 2005/07/11 15:08:06 swegener Exp $
5ECLASS=apache-module
6INHERITED="$INHERITED $ECLASS"
7 5
8inherit depend.apache 6inherit depend.apache
9 7
10# This eclass provides a common set of functions for Apache modules. 8# This eclass provides a common set of functions for Apache modules.
11 9
162## This installs the files into apache's directories. The module is installed 160## This installs the files into apache's directories. The module is installed
163## from a directory chosen as above (APXS2_S or ${S}/src). In addition, 161## from a directory chosen as above (APXS2_S or ${S}/src). In addition,
164## this function can also set the executable permission on files listed in EXECFILES. 162## this function can also set the executable permission on files listed in EXECFILES.
165## The configuration file name is listed in APACHE1_MOD_CONF without the .conf extensions, 163## The configuration file name is listed in APACHE1_MOD_CONF without the .conf extensions,
166## so if you configuration is 55_mod_foo.conf, APACHE1_MOD_CONF would be 55_mod_foo. 164## so if you configuration is 55_mod_foo.conf, APACHE1_MOD_CONF would be 55_mod_foo.
167## DOCFILES contains the list of files you want filed as documentation. The name of the 165## DOCFILES contains the list of files you want filed as documentation. The name of the
168## module can also be specified using the APACHE1_MOD_FILE or defaults to 166## module can also be specified using the APACHE1_MOD_FILE or defaults to
169## .libs/${PN}.so. 167## .libs/${PN}.so.
170#### 168####
171apache1_src_install() { 169apache1_src_install() {
172 debug-print-function apache1_src_install 170 debug-print-function apache1_src_install
173 171
174 CD_DIR=$(apache_cd_dir) 172 CD_DIR=$(apache_cd_dir)
182 180
183 if [ -n "${APACHE1_MOD_CONF}" ] ; then 181 if [ -n "${APACHE1_MOD_CONF}" ] ; then
184 insinto ${APACHE1_MODULES_CONFDIR} 182 insinto ${APACHE1_MODULES_CONFDIR}
185 doins ${FILESDIR}/${APACHE1_MOD_CONF}.conf || die "internal ebuild error: '${FILESDIR}/${APACHE1_MOD_CONF}.conf' not found." 183 doins ${FILESDIR}/${APACHE1_MOD_CONF}.conf || die "internal ebuild error: '${FILESDIR}/${APACHE1_MOD_CONF}.conf' not found."
186 fi 184 fi
187 185
188 cd ${S} 186 cd ${S}
189 187
190 if [ -n "${DOCFILES}" ] ; then 188 if [ -n "${DOCFILES}" ] ; then
191 OTHER_DOCS=$(apache_doc_magic) 189 OTHER_DOCS=$(apache_doc_magic)
192 HTML_DOCS=$(apache_doc_magic html) 190 HTML_DOCS=$(apache_doc_magic html)
233apache2_pkg_setup() { 231apache2_pkg_setup() {
234 debug-print-function apache2_pkg_setup 232 debug-print-function apache2_pkg_setup
235 233
236 if [ -n "${APACHE2_SAFE_MPMS}" ]; then 234 if [ -n "${APACHE2_SAFE_MPMS}" ]; then
237 235
238 for mpm in ${APACHE2_SAFE_MPMS}; do 236 INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)"
239 MPM_USE="mpm-${mpm}" 237
240 if built_with_use apache ${MPM_USE}; then 238 if hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then
241 INSTALLED_MPM_SAFE="yes" 239 INSTALLED_MPM_SAFE="yes"
242 fi 240 fi
243 done
244 241
245 if [ -z "${INSTALLED_MPM_SAFE}" ] ; then 242 if [ -z "${INSTALLED_MPM_SAFE}" ] ; then
246 eerror "The module you are trying to install (${PN})" 243 eerror "The module you are trying to install (${PN})"
247 eerror "will only work with one of the following MPMs:" 244 eerror "will only work with one of the following MPMs:"
248 eerror " ${APACHE2_SAFE_MPMS}" 245 eerror " ${APACHE2_SAFE_MPMS}"
252 fi 249 fi
253 250
254 fi 251 fi
255 252
256} 253}
257 254
258#### 255####
259## apache2_src_compile 256## apache2_src_compile
260## 257##
261## The default action is to call ${APXS2} with the value of 258## The default action is to call ${APXS2} with the value of
262## ${APXS2_ARGS}. If a module requires a different build setup 259## ${APXS2_ARGS}. If a module requires a different build setup
331 einfo 328 einfo
332 fi 329 fi
333 330
334 if [ -n "${APACHE2_SAFE_MPMS}" ]; then 331 if [ -n "${APACHE2_SAFE_MPMS}" ]; then
335 332
336 INSTALLED_MPMS=$(ls ${ROOT}/usr/sbin/apache2.*) 333 INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)"
337 334
338 for mpm in ${INSTALLED_MPMS}; do
339 # strip everything up to and including 'apache2.' from ${mpm}
340 mpm=${mpm#*apache2.}
341
342 if ! hasq ${mpm} ${APACHE2_SAFE_MPMS} ; then 335 if ! hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then
343 INSTALLED_MPM_UNSAFE="${INSTALLED_MPM_UNSAFE} ${mpm}" 336 INSTALLED_MPM_UNSAFE="${INSTALLED_MPM_UNSAFE} ${mpm}"
344 else 337 else
345 INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}" 338 INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}"
346 fi 339 fi
347 done
348 340
349 if [ -n "${INSTALLED_MPM_UNSAFE}" ] ; then 341 if [ -n "${INSTALLED_MPM_UNSAFE}" ] ; then
350 ewarn "You have one or more MPMs installed that will not work with" 342 ewarn "You have one or more MPMs installed that will not work with"
351 ewarn "this module (${PN}). Please make sure that you only enable" 343 ewarn "this module (${PN}). Please make sure that you only enable"
352 ewarn "this module if you are using one of the following MPMs:" 344 ewarn "this module if you are using one of the following MPMs:"
353 ewarn " ${INSTALLED_MPM_SAFE}" 345 ewarn " ${INSTALLED_MPM_SAFE}"
354 fi 346 fi
355 347
356 fi 348 fi
357 349
358
359} 350}
360 351
361###### 352######
362## Apache dual (1.x or 2.x) ebuild functions 353## Apache dual (1.x or 2.x) ebuild functions
363## 354##

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.20