/[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.17 Revision 1.18
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.17 2006/10/14 20:27:20 swegener Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.18 2006/11/26 21:25:28 vericgar Exp $
5 5
6inherit depend.apache 6inherit depend.apache
7 7
8# This eclass provides a common set of functions for Apache modules. 8# This eclass provides a common set of functions for Apache modules.
9 9
74## apache_cd_dir 74## apache_cd_dir
75## 75##
76## Return the path to our temporary build dir 76## Return the path to our temporary build dir
77#### 77####
78apache_cd_dir() { 78apache_cd_dir() {
79 debug-print-function apache_cd_dir 79 debug-print-function $FUNCNAME $*
80 80
81 if [ "${APACHE_VERSION}" == "1" ]; then 81 if [ "${APACHE_VERSION}" == "1" ]; then
82 [ -n "${APXS1_S}" ] && CD_DIR="${APXS1_S}" 82 [ -n "${APXS1_S}" ] && CD_DIR="${APXS1_S}"
83 else 83 else
84 [ -n "${APXS2_S}" ] && CD_DIR="${APXS2_S}" 84 [ -n "${APXS2_S}" ] && CD_DIR="${APXS2_S}"
101## apache_mod_file 101## apache_mod_file
102## 102##
103## Return the path to the module file 103## Return the path to the module file
104#### 104####
105apache_mod_file() { 105apache_mod_file() {
106 debug-print-function apache_mod_file 106 debug-print-function $FUNCNAME $*
107 107
108 if [ "${APACHE_VERSION}" == "1" ]; then 108 if [ "${APACHE_VERSION}" == "1" ]; then
109 [ -n "${APACHE1_MOD_FILE}" ] && MOD_FILE="${APACHE1_MOD_FILE}" 109 [ -n "${APACHE1_MOD_FILE}" ] && MOD_FILE="${APACHE1_MOD_FILE}"
110 [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/${PN}.so" 110 [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/${PN}.so"
111 else 111 else
124## an optional first argument `html'; if the first argument is equals 124## an optional first argument `html'; if the first argument is equals
125## `html', only html files are returned, otherwise normal (non-html) 125## `html', only html files are returned, otherwise normal (non-html)
126## docs are returned. 126## docs are returned.
127#### 127####
128apache_doc_magic() { 128apache_doc_magic() {
129 debug-print-function apache_doc_magic $* 129 debug-print-function $FUNCNAME $*
130 130
131 if [ -n "${DOCFILES}" ]; then 131 if [ -n "${DOCFILES}" ]; then
132 if [ "x$1" == "xhtml" ]; then 132 if [ "x$1" == "xhtml" ]; then
133 DOCS="`echo ${DOCFILES} | sed -e 's/ /\n/g' | sed -e '/^[^ ]*.html$/ !d'`" 133 DOCS="`echo ${DOCFILES} | sed -e 's/ /\n/g' | sed -e '/^[^ ]*.html$/ !d'`"
134 else 134 else
149## The default action is to call ${APXS11} with the value of 149## The default action is to call ${APXS11} with the value of
150## ${APXS1_ARGS}. If a module requires a different build setup 150## ${APXS1_ARGS}. If a module requires a different build setup
151## than this, use ${APXS1} in your own src_compile routine. 151## than this, use ${APXS1} in your own src_compile routine.
152#### 152####
153apache1_src_compile() { 153apache1_src_compile() {
154 debug-print-function apache1_src_compile 154 debug-print-function $FUNCNAME $*
155 155
156 CD_DIR=$(apache_cd_dir) 156 CD_DIR=$(apache_cd_dir)
157 cd ${CD_DIR} || die "cd ${CD_DIR} failed" 157 cd ${CD_DIR} || die "cd ${CD_DIR} failed"
158 APXS1_ARGS="${APXS1_ARGS:--c ${PN}.c}" 158 APXS1_ARGS="${APXS1_ARGS:--c ${PN}.c}"
159 ${APXS1} ${APXS1_ARGS} || die "${APXS1} ${APXS1_ARGS} failed" 159 ${APXS1} ${APXS1_ARGS} || die "${APXS1} ${APXS1_ARGS} failed"
170## DOCFILES contains the list of files you want filed as documentation. The name of the 170## DOCFILES contains the list of files you want filed as documentation. The name of the
171## module can also be specified using the APACHE1_MOD_FILE or defaults to 171## module can also be specified using the APACHE1_MOD_FILE or defaults to
172## .libs/${PN}.so. 172## .libs/${PN}.so.
173#### 173####
174apache1_src_install() { 174apache1_src_install() {
175 debug-print-function apache1_src_install 175 debug-print-function $FUNCNAME $*
176 176
177 CD_DIR=$(apache_cd_dir) 177 CD_DIR=$(apache_cd_dir)
178 cd ${CD_DIR} || die "cd ${CD_DIR} failed" 178 cd ${CD_DIR} || die "cd ${CD_DIR} failed"
179 179
180 MOD_FILE=$(apache_mod_file) 180 MOD_FILE=$(apache_mod_file)
203## apache1_pkg_postinst 203## apache1_pkg_postinst
204## 204##
205## Prints the standard config message, unless APACHE1_NO_CONFIG is set to yes. 205## Prints the standard config message, unless APACHE1_NO_CONFIG is set to yes.
206#### 206####
207apache1_pkg_postinst() { 207apache1_pkg_postinst() {
208 debug-print-function apache1_pkg_postinst 208 debug-print-function $FUNCNAME $*
209 209
210 if [ -n "${APACHE1_MOD_DEFINE}" ]; then 210 if [ -n "${APACHE1_MOD_DEFINE}" ]; then
211 local my_opts="-D ${APACHE1_MOD_DEFINE// / -D }" 211 local my_opts="-D ${APACHE1_MOD_DEFINE// / -D }"
212 212
213 einfo 213 einfo
234## Checks to see if APACHE2_MT_UNSAFE is set to anything other than "no". If it is, then 234## Checks to see if APACHE2_MT_UNSAFE is set to anything other than "no". If it is, then
235## we check what the MPM style used by Apache is, if it isnt prefork, we let the user 235## we check what the MPM style used by Apache is, if it isnt prefork, we let the user
236## know they need prefork, and then exit the build. 236## know they need prefork, and then exit the build.
237#### 237####
238apache2_pkg_setup() { 238apache2_pkg_setup() {
239 debug-print-function apache2_pkg_setup 239 debug-print-function $FUNCNAME $*
240 240
241 if [ -n "${APACHE2_SAFE_MPMS}" ]; then 241 if [ -n "${APACHE2_SAFE_MPMS}" ]; then
242 242
243 INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)" 243 INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)"
244 244
265## The default action is to call ${APXS2} with the value of 265## The default action is to call ${APXS2} with the value of
266## ${APXS2_ARGS}. If a module requires a different build setup 266## ${APXS2_ARGS}. If a module requires a different build setup
267## than this, use ${APXS2} in your own src_compile routine. 267## than this, use ${APXS2} in your own src_compile routine.
268#### 268####
269apache2_src_compile() { 269apache2_src_compile() {
270 debug-print-function apache2_src_compile 270 debug-print-function $FUNCNAME $*
271 271
272 CD_DIR=$(apache_cd_dir) 272 CD_DIR=$(apache_cd_dir)
273 cd ${CD_DIR} || die "cd ${CD_DIR} failed" 273 cd ${CD_DIR} || die "cd ${CD_DIR} failed"
274 APXS2_ARGS="${APXS2_ARGS:--c ${PN}.c}" 274 APXS2_ARGS="${APXS2_ARGS:--c ${PN}.c}"
275 ${APXS2} ${APXS2_ARGS} || die "${APXS2} ${APXS2_ARGS} failed" 275 ${APXS2} ${APXS2_ARGS} || die "${APXS2} ${APXS2_ARGS} failed"
284## The configuration file name is listed in CONFFILE without the .conf extensions, 284## The configuration file name is listed in CONFFILE without the .conf extensions,
285## so if you configuration is 55_mod_foo.conf, CONFFILE would be 55_mod_foo. 285## so if you configuration is 55_mod_foo.conf, CONFFILE would be 55_mod_foo.
286## DOCFILES contains the list of files you want filed as documentation. 286## DOCFILES contains the list of files you want filed as documentation.
287#### 287####
288apache2_src_install() { 288apache2_src_install() {
289 debug-print-function apache2_src_install 289 debug-print-function $FUNCNAME $*
290 290
291 CD_DIR=$(apache_cd_dir) 291 CD_DIR=$(apache_cd_dir)
292 cd ${CD_DIR} || die "cd ${CD_DIR} failed" 292 cd ${CD_DIR} || die "cd ${CD_DIR} failed"
293 293
294 MOD_FILE=$(apache_mod_file) 294 MOD_FILE=$(apache_mod_file)
317 [ -n "${HTML_DOCS}" ] && dohtml ${HTML_DOCS} 317 [ -n "${HTML_DOCS}" ] && dohtml ${HTML_DOCS}
318 fi 318 fi
319} 319}
320 320
321apache2_pkg_postinst() { 321apache2_pkg_postinst() {
322 debug-print-function apache2_pkg_postinst 322 debug-print-function $FUNCNAME $*
323 323
324 if [ -n "${APACHE2_MOD_DEFINE}" ]; then 324 if [ -n "${APACHE2_MOD_DEFINE}" ]; then
325 local my_opts="-D ${APACHE2_MOD_DEFINE// / -D }" 325 local my_opts="-D ${APACHE2_MOD_DEFINE// / -D }"
326 326
327 einfo 327 einfo
366## to call. If a function is provided by a given section (ie pkg_postinst in Apache 2.x) 366## to call. If a function is provided by a given section (ie pkg_postinst in Apache 2.x)
367## the exported routine simply does nothing. 367## the exported routine simply does nothing.
368###### 368######
369 369
370apache-module_pkg_setup() { 370apache-module_pkg_setup() {
371 debug-print-function apache-module_pkg_setup 371 debug-print-function $FUNCNAME $*
372 372
373 if [ ${APACHE_VERSION} -eq '2' ]; then 373 if [ ${APACHE_VERSION} -eq '2' ]; then
374 apache2_pkg_setup 374 apache2_pkg_setup
375 fi 375 fi
376} 376}
377 377
378apache-module_src_compile() { 378apache-module_src_compile() {
379 debug-print-function apache-module_src_compile 379 debug-print-function $FUNCNAME $*
380 380
381 if [ ${APACHE_VERSION} -eq '1' ]; then 381 if [ ${APACHE_VERSION} -eq '1' ]; then
382 apache1_src_compile 382 apache1_src_compile
383 else 383 else
384 apache2_src_compile 384 apache2_src_compile
385 fi 385 fi
386} 386}
387 387
388apache-module_src_install() { 388apache-module_src_install() {
389 debug-print-function apache-module_src_install 389 debug-print-function $FUNCNAME $*
390 390
391 if [ ${APACHE_VERSION} -eq '1' ]; then 391 if [ ${APACHE_VERSION} -eq '1' ]; then
392 apache1_src_install 392 apache1_src_install
393 else 393 else
394 apache2_src_install 394 apache2_src_install
395 fi 395 fi
396} 396}
397 397
398apache-module_pkg_postinst() { 398apache-module_pkg_postinst() {
399 debug-print-function apache-module_pkg_postinst 399 debug-print-function $FUNCNAME $*
400 400
401 if [ ${APACHE_VERSION} -eq '1' ]; then 401 if [ ${APACHE_VERSION} -eq '1' ]; then
402 apache1_pkg_postinst 402 apache1_pkg_postinst
403 else 403 else
404 apache2_pkg_postinst 404 apache2_pkg_postinst

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.20