/[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.12 Revision 1.17
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.12 2005/07/11 15:08:06 swegener Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.17 2006/10/14 20:27:20 swegener 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
10# NOTE: If you use this, be sure you use the need_* call after you have
11# defined DEPEND and RDEPEND. Also note that you can not rely on the
12# automatic RDEPEND=DEPEND that portage does if you use this eclass.
13# See bug 107127 for more information.
9 14
10###### 15######
11## Common ebuild variables 16## Common ebuild variables
12###### 17######
13 18
45 50
46#### 51####
47## APACHE1_MOD_DEFINE, APACHE2_MOD_DEFINE 52## APACHE1_MOD_DEFINE, APACHE2_MOD_DEFINE
48## 53##
49## Name of define (eg FOO) to use in conditional loading of the installed 54## Name of define (eg FOO) to use in conditional loading of the installed
50## module/it's config file 55## module/it's config file, multiple defines should be space separated
51#### 56####
52APACHE1_MOD_DEFINE="" 57APACHE1_MOD_DEFINE=""
53APACHE2_MOD_DEFINE="" 58APACHE2_MOD_DEFINE=""
54 59
55#### 60####
100apache_mod_file() { 105apache_mod_file() {
101 debug-print-function apache_mod_file 106 debug-print-function apache_mod_file
102 107
103 if [ "${APACHE_VERSION}" == "1" ]; then 108 if [ "${APACHE_VERSION}" == "1" ]; then
104 [ -n "${APACHE1_MOD_FILE}" ] && MOD_FILE="${APACHE1_MOD_FILE}" 109 [ -n "${APACHE1_MOD_FILE}" ] && MOD_FILE="${APACHE1_MOD_FILE}"
105 [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/${PN}.so" 110 [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/${PN}.so"
106 else 111 else
107 [ -n "${APACHE2_MOD_FILE}" ] && MOD_FILE="${APACHE2_MOD_FILE}" 112 [ -n "${APACHE2_MOD_FILE}" ] && MOD_FILE="${APACHE2_MOD_FILE}"
108 [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/.libs/${PN}.so" 113 [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/.libs/${PN}.so"
109 fi 114 fi
110 115
111 debug-print apache_mod_file: MOD_FILE=${MOD_FILE} 116 debug-print apache_mod_file: MOD_FILE=${MOD_FILE}
112 echo ${MOD_FILE} 117 echo ${MOD_FILE}
113} 118}
201#### 206####
202apache1_pkg_postinst() { 207apache1_pkg_postinst() {
203 debug-print-function apache1_pkg_postinst 208 debug-print-function apache1_pkg_postinst
204 209
205 if [ -n "${APACHE1_MOD_DEFINE}" ]; then 210 if [ -n "${APACHE1_MOD_DEFINE}" ]; then
211 local my_opts="-D ${APACHE1_MOD_DEFINE// / -D }"
212
206 einfo 213 einfo
207 einfo "To enable ${PN}, you need to edit your /etc/conf.d/apache file and" 214 einfo "To enable ${PN}, you need to edit your /etc/conf.d/apache file and"
208 einfo "add '-D ${APACHE1_MOD_DEFINE}' to APACHE_OPTS." 215 einfo "add '${my_opts}' to APACHE_OPTS."
209 einfo 216 einfo
210 fi 217 fi
211 if [ -n "${APACHE1_MOD_CONF}" ] ; then 218 if [ -n "${APACHE1_MOD_CONF}" ] ; then
212 einfo 219 einfo
213 einfo "Configuration file installed as" 220 einfo "Configuration file installed as"
294 insinto ${APACHE2_MODULES_CONFDIR} 301 insinto ${APACHE2_MODULES_CONFDIR}
295 doins ${FILESDIR}/${APACHE2_MOD_CONF}.conf || die "internal ebuild error: '${FILESDIR}/${APACHE2_MOD_CONF}.conf' not found." 302 doins ${FILESDIR}/${APACHE2_MOD_CONF}.conf || die "internal ebuild error: '${FILESDIR}/${APACHE2_MOD_CONF}.conf' not found."
296 fi 303 fi
297 304
298 if [ -n "${APACHE2_VHOSTFILE}" ]; then 305 if [ -n "${APACHE2_VHOSTFILE}" ]; then
299 insinto ${APACHE2_MODULES_VHOSTDIR} 306 insinto ${APACHE2_VHOSTDIR}
300 doins ${FILESDIR}/${APACHE2_VHOSTFILE}.conf 307 doins ${FILESDIR}/${APACHE2_VHOSTFILE}.conf
301 fi 308 fi
302 309
303 cd ${S} 310 cd ${S}
304 311
313 320
314apache2_pkg_postinst() { 321apache2_pkg_postinst() {
315 debug-print-function apache2_pkg_postinst 322 debug-print-function apache2_pkg_postinst
316 323
317 if [ -n "${APACHE2_MOD_DEFINE}" ]; then 324 if [ -n "${APACHE2_MOD_DEFINE}" ]; then
325 local my_opts="-D ${APACHE2_MOD_DEFINE// / -D }"
326
318 einfo 327 einfo
319 einfo "To enable ${PN}, you need to edit your /etc/conf.d/apache2 file and" 328 einfo "To enable ${PN}, you need to edit your /etc/conf.d/apache2 file and"
320 einfo "add '-D ${APACHE2_MOD_DEFINE}' to APACHE2_OPTS." 329 einfo "add '${my_opts}' to APACHE2_OPTS."
321 einfo 330 einfo
322 fi 331 fi
323 if [ -n "${APACHE2_MOD_CONF}" ] ; then 332 if [ -n "${APACHE2_MOD_CONF}" ] ; then
324 einfo 333 einfo
325 einfo "Configuration file installed as" 334 einfo "Configuration file installed as"

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

  ViewVC Help
Powered by ViewVC 1.1.20