/[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.1 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.1 2004/11/21 01:51:58 urilith 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
145## apache1_src_compile 145## apache1_src_compile
146## The default action is to call ${APXS11} with the value of 146## The default action is to call ${APXS11} with the value of
147## ${APXS1_ARGS}. If a module requires a different build setup 147## ${APXS1_ARGS}. If a module requires a different build setup
148## than this, use ${APXS1} in your own src_compile routine. 148## than this, use ${APXS1} in your own src_compile routine.
149#### 149####
150apache1_src_compile () { 150apache1_src_compile() {
151 debug-print-function apache1_src_compile 151 debug-print-function apache1_src_compile
152 152
153 CD_DIR=$(apache_cd_dir) 153 CD_DIR=$(apache_cd_dir)
154 cd ${CD_DIR} || die "cd ${CD_DIR} failed" 154 cd ${CD_DIR} || die "cd ${CD_DIR} failed"
155 APXS1_ARGS="${APXS1_ARGS:--c ${PN}.c}" 155 APXS1_ARGS="${APXS1_ARGS:--c ${PN}.c}"
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
187 einfo
188 einfo "Configuration file installed as ${APACHE1_MODULES_CONFDIR}/${APACHE1_MOD_CONF}.conf"
189 einfo "You may want to edit it before turning the module on in /etc/conf.d/apache"
190 einfo
191 fi 186 fi
192 187
193 cd ${S} 188 cd ${S}
194 189
195 if [ -n "${DOCFILES}" ] ; then 190 if [ -n "${DOCFILES}" ] ; then
213 einfo 208 einfo
214 einfo "To enable ${PN}, you need to edit your /etc/conf.d/apache file and" 209 einfo "To enable ${PN}, you need to edit your /etc/conf.d/apache file and"
215 einfo "add '-D ${APACHE1_MOD_DEFINE}' to APACHE_OPTS." 210 einfo "add '-D ${APACHE1_MOD_DEFINE}' to APACHE_OPTS."
216 einfo 211 einfo
217 fi 212 fi
213 if [ -n "${APACHE1_MOD_CONF}" ] ; then
214 einfo
215 einfo "Configuration file installed as"
216 einfo " ${APACHE1_MODULES_CONFDIR}/$(basename ${APACHE1_MOD_CONF}).conf"
217 einfo "You may want to edit it before turning the module on in /etc/conf.d/apache"
218 einfo
219 fi
218} 220}
219 221
220###### 222######
221## Apache 2.x ebuild functions 223## Apache 2.x ebuild functions
222###### 224######
226## 228##
227## Checks to see if APACHE2_MT_UNSAFE is set to anything other than "no". If it is, then 229## Checks to see if APACHE2_MT_UNSAFE is set to anything other than "no". If it is, then
228## we check what the MPM style used by Apache is, if it isnt prefork, we let the user 230## we check what the MPM style used by Apache is, if it isnt prefork, we let the user
229## know they need prefork, and then exit the build. 231## know they need prefork, and then exit the build.
230#### 232####
231apache2_pkg_setup () { 233apache2_pkg_setup() {
232 debug-print-function apache2_pkg_setup 234 debug-print-function apache2_pkg_setup
233 235
234 if [ -n "${APACHE2_MT_UNSAFEE}" ]; then 236 if [ -n "${APACHE2_SAFE_MPMS}" ]; then
235 if [ "x${APACHE2_MT_UNSAFE}" != "no" ]; then
236 APACHE2_MPM_STYLE=`/usr/sbin/apxs2 -q MPM_NAME`
237 if [ "x$APACHE2_MPM_STYLE" != "xprefork" ]; then
238 eerror "You currently have Apache configured to use the."
239 eerror "$APACHE2_MPM_STYLE MPM style. The module you are"
240 eerror "trying to install is not currently thread-safe,"
241 eerror "and will not work under your current configuraiton."
242 echo
243 eerror "If you still want to use the module, please reinstall"
244 eerror "Apache with mpm-prefork set."
245 237
246 epause 238 INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)"
247 ebeep 239
248 die Invalid Apache MPM style. 240 if hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then
241 INSTALLED_MPM_SAFE="yes"
249 fi 242 fi
250 fi 243
244 if [ -z "${INSTALLED_MPM_SAFE}" ] ; then
245 eerror "The module you are trying to install (${PN})"
246 eerror "will only work with one of the following MPMs:"
247 eerror " ${APACHE2_SAFE_MPMS}"
248 eerror "You do not currently have any of these MPMs installed."
249 eerror "Please re-install apache with the correct mpm-* USE flag set."
250 die "No safe MPM installed."
251 fi 251 fi
252
253 fi
254
252} 255}
253 256
254#### 257####
255## apache2_src_compile 258## apache2_src_compile
256## 259##
257## The default action is to call ${APXS2} with the value of 260## The default action is to call ${APXS2} with the value of
258## ${APXS2_ARGS}. If a module requires a different build setup 261## ${APXS2_ARGS}. If a module requires a different build setup
259## than this, use ${APXS2} in your own src_compile routine. 262## than this, use ${APXS2} in your own src_compile routine.
260#### 263####
261apache2_src_compile () { 264apache2_src_compile() {
262 debug-print-function apache2_src_compile 265 debug-print-function apache2_src_compile
263 266
264 CD_DIR=$(apache_cd_dir) 267 CD_DIR=$(apache_cd_dir)
265 cd ${CD_DIR} || die "cd ${CD_DIR} failed" 268 cd ${CD_DIR} || die "cd ${CD_DIR} failed"
266 APXS2_ARGS="${APXS2_ARGS:--c ${PN}.c}" 269 APXS2_ARGS="${APXS2_ARGS:--c ${PN}.c}"
284 cd ${CD_DIR} || die "cd ${CD_DIR} failed" 287 cd ${CD_DIR} || die "cd ${CD_DIR} failed"
285 288
286 MOD_FILE=$(apache_mod_file) 289 MOD_FILE=$(apache_mod_file)
287 290
288 exeinto ${APACHE2_MODULESDIR} 291 exeinto ${APACHE2_MODULESDIR}
289 doexe ${MOD_FILE} || die "internal ebuild error: \'${MOD_FILE}\' not found" 292 doexe ${MOD_FILE} || die "internal ebuild error: '${MOD_FILE}' not found"
290 [ -n "${APACHE2_EXECFILES}" ] && doexe ${APACHE2_EXECFILES} 293 [ -n "${APACHE2_EXECFILES}" ] && doexe ${APACHE2_EXECFILES}
291 294
292 if [ -n "${APACHE2_MOD_CONF}" ] ; then 295 if [ -n "${APACHE2_MOD_CONF}" ] ; then
293 insinto ${APACHE2_MODULES_CONFDIR} 296 insinto ${APACHE2_MODULES_CONFDIR}
294 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."
295
296 einfo
297 einfo "Configuration file installed as ${APACHE2_MODULES_CONFDIR}/${APACHE2_MOD_CONF}.conf"
298 einfo "You may want to edit it before turning the module on in /etc/conf.d/apache2"
299 einfo
300 fi 298 fi
301 299
302 if [ -n "${APACHE2_VHOSTFILE}" ]; then 300 if [ -n "${APACHE2_VHOSTFILE}" ]; then
303 insinto ${APACHE2_MODULES_VHOSTDIR} 301 insinto ${APACHE2_MODULES_VHOSTDIR}
304 doins ${FILESDIR}/${APACHE2_VHOSTFILE}.conf 302 doins ${FILESDIR}/${APACHE2_VHOSTFILE}.conf
322 einfo 320 einfo
323 einfo "To enable ${PN}, you need to edit your /etc/conf.d/apache2 file and" 321 einfo "To enable ${PN}, you need to edit your /etc/conf.d/apache2 file and"
324 einfo "add '-D ${APACHE2_MOD_DEFINE}' to APACHE2_OPTS." 322 einfo "add '-D ${APACHE2_MOD_DEFINE}' to APACHE2_OPTS."
325 einfo 323 einfo
326 fi 324 fi
325 if [ -n "${APACHE2_MOD_CONF}" ] ; then
326 einfo
327 einfo "Configuration file installed as"
328 einfo " ${APACHE2_MODULES_CONFDIR}/$(basename ${APACHE2_MOD_CONF}).conf"
329 einfo "You may want to edit it before turning the module on in /etc/conf.d/apache2"
330 einfo
331 fi
332
333 if [ -n "${APACHE2_SAFE_MPMS}" ]; then
334
335 INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)"
336
337 if ! hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then
338 INSTALLED_MPM_UNSAFE="${INSTALLED_MPM_UNSAFE} ${mpm}"
339 else
340 INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}"
341 fi
342
343 if [ -n "${INSTALLED_MPM_UNSAFE}" ] ; then
344 ewarn "You have one or more MPMs installed that will not work with"
345 ewarn "this module (${PN}). Please make sure that you only enable"
346 ewarn "this module if you are using one of the following MPMs:"
347 ewarn " ${INSTALLED_MPM_SAFE}"
348 fi
349
350 fi
351
352
327} 353}
328 354
329###### 355######
330## Apache dual (1.x or 2.x) ebuild functions 356## Apache dual (1.x or 2.x) ebuild functions
331## 357##

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

  ViewVC Help
Powered by ViewVC 1.1.20