/[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.9 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.9 2005/06/04 18:13:05 vericgar Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.17 2006/10/14 20:27:20 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.
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.
11 14
12###### 15######
13## Common ebuild variables 16## Common ebuild variables
14###### 17######
15 18
47 50
48#### 51####
49## APACHE1_MOD_DEFINE, APACHE2_MOD_DEFINE 52## APACHE1_MOD_DEFINE, APACHE2_MOD_DEFINE
50## 53##
51## 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
52## module/it's config file 55## module/it's config file, multiple defines should be space separated
53#### 56####
54APACHE1_MOD_DEFINE="" 57APACHE1_MOD_DEFINE=""
55APACHE2_MOD_DEFINE="" 58APACHE2_MOD_DEFINE=""
56 59
57#### 60####
102apache_mod_file() { 105apache_mod_file() {
103 debug-print-function apache_mod_file 106 debug-print-function apache_mod_file
104 107
105 if [ "${APACHE_VERSION}" == "1" ]; then 108 if [ "${APACHE_VERSION}" == "1" ]; then
106 [ -n "${APACHE1_MOD_FILE}" ] && MOD_FILE="${APACHE1_MOD_FILE}" 109 [ -n "${APACHE1_MOD_FILE}" ] && MOD_FILE="${APACHE1_MOD_FILE}"
107 [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/${PN}.so" 110 [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/${PN}.so"
108 else 111 else
109 [ -n "${APACHE2_MOD_FILE}" ] && MOD_FILE="${APACHE2_MOD_FILE}" 112 [ -n "${APACHE2_MOD_FILE}" ] && MOD_FILE="${APACHE2_MOD_FILE}"
110 [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/.libs/${PN}.so" 113 [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/.libs/${PN}.so"
111 fi 114 fi
112 115
113 debug-print apache_mod_file: MOD_FILE=${MOD_FILE} 116 debug-print apache_mod_file: MOD_FILE=${MOD_FILE}
114 echo ${MOD_FILE} 117 echo ${MOD_FILE}
115} 118}
162## This installs the files into apache's directories. The module is installed 165## 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, 166## 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. 167## 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, 168## 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. 169## 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 170## 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 171## module can also be specified using the APACHE1_MOD_FILE or defaults to
169## .libs/${PN}.so. 172## .libs/${PN}.so.
170#### 173####
171apache1_src_install() { 174apache1_src_install() {
172 debug-print-function apache1_src_install 175 debug-print-function apache1_src_install
173 176
174 CD_DIR=$(apache_cd_dir) 177 CD_DIR=$(apache_cd_dir)
182 185
183 if [ -n "${APACHE1_MOD_CONF}" ] ; then 186 if [ -n "${APACHE1_MOD_CONF}" ] ; then
184 insinto ${APACHE1_MODULES_CONFDIR} 187 insinto ${APACHE1_MODULES_CONFDIR}
185 doins ${FILESDIR}/${APACHE1_MOD_CONF}.conf || die "internal ebuild error: '${FILESDIR}/${APACHE1_MOD_CONF}.conf' not found." 188 doins ${FILESDIR}/${APACHE1_MOD_CONF}.conf || die "internal ebuild error: '${FILESDIR}/${APACHE1_MOD_CONF}.conf' not found."
186 fi 189 fi
187 190
188 cd ${S} 191 cd ${S}
189 192
190 if [ -n "${DOCFILES}" ] ; then 193 if [ -n "${DOCFILES}" ] ; then
191 OTHER_DOCS=$(apache_doc_magic) 194 OTHER_DOCS=$(apache_doc_magic)
192 HTML_DOCS=$(apache_doc_magic html) 195 HTML_DOCS=$(apache_doc_magic html)
203#### 206####
204apache1_pkg_postinst() { 207apache1_pkg_postinst() {
205 debug-print-function apache1_pkg_postinst 208 debug-print-function apache1_pkg_postinst
206 209
207 if [ -n "${APACHE1_MOD_DEFINE}" ]; then 210 if [ -n "${APACHE1_MOD_DEFINE}" ]; then
211 local my_opts="-D ${APACHE1_MOD_DEFINE// / -D }"
212
208 einfo 213 einfo
209 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"
210 einfo "add '-D ${APACHE1_MOD_DEFINE}' to APACHE_OPTS." 215 einfo "add '${my_opts}' to APACHE_OPTS."
211 einfo 216 einfo
212 fi 217 fi
213 if [ -n "${APACHE1_MOD_CONF}" ] ; then 218 if [ -n "${APACHE1_MOD_CONF}" ] ; then
214 einfo 219 einfo
215 einfo "Configuration file installed as" 220 einfo "Configuration file installed as"
251 fi 256 fi
252 257
253 fi 258 fi
254 259
255} 260}
256 261
257#### 262####
258## apache2_src_compile 263## apache2_src_compile
259## 264##
260## The default action is to call ${APXS2} with the value of 265## The default action is to call ${APXS2} with the value of
261## ${APXS2_ARGS}. If a module requires a different build setup 266## ${APXS2_ARGS}. If a module requires a different build setup
296 insinto ${APACHE2_MODULES_CONFDIR} 301 insinto ${APACHE2_MODULES_CONFDIR}
297 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."
298 fi 303 fi
299 304
300 if [ -n "${APACHE2_VHOSTFILE}" ]; then 305 if [ -n "${APACHE2_VHOSTFILE}" ]; then
301 insinto ${APACHE2_MODULES_VHOSTDIR} 306 insinto ${APACHE2_VHOSTDIR}
302 doins ${FILESDIR}/${APACHE2_VHOSTFILE}.conf 307 doins ${FILESDIR}/${APACHE2_VHOSTFILE}.conf
303 fi 308 fi
304 309
305 cd ${S} 310 cd ${S}
306 311
315 320
316apache2_pkg_postinst() { 321apache2_pkg_postinst() {
317 debug-print-function apache2_pkg_postinst 322 debug-print-function apache2_pkg_postinst
318 323
319 if [ -n "${APACHE2_MOD_DEFINE}" ]; then 324 if [ -n "${APACHE2_MOD_DEFINE}" ]; then
325 local my_opts="-D ${APACHE2_MOD_DEFINE// / -D }"
326
320 einfo 327 einfo
321 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"
322 einfo "add '-D ${APACHE2_MOD_DEFINE}' to APACHE2_OPTS." 329 einfo "add '${my_opts}' to APACHE2_OPTS."
323 einfo 330 einfo
324 fi 331 fi
325 if [ -n "${APACHE2_MOD_CONF}" ] ; then 332 if [ -n "${APACHE2_MOD_CONF}" ] ; then
326 einfo 333 einfo
327 einfo "Configuration file installed as" 334 einfo "Configuration file installed as"
337 if ! hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then 344 if ! hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then
338 INSTALLED_MPM_UNSAFE="${INSTALLED_MPM_UNSAFE} ${mpm}" 345 INSTALLED_MPM_UNSAFE="${INSTALLED_MPM_UNSAFE} ${mpm}"
339 else 346 else
340 INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}" 347 INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}"
341 fi 348 fi
342 349
343 if [ -n "${INSTALLED_MPM_UNSAFE}" ] ; then 350 if [ -n "${INSTALLED_MPM_UNSAFE}" ] ; then
344 ewarn "You have one or more MPMs installed that will not work with" 351 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" 352 ewarn "this module (${PN}). Please make sure that you only enable"
346 ewarn "this module if you are using one of the following MPMs:" 353 ewarn "this module if you are using one of the following MPMs:"
347 ewarn " ${INSTALLED_MPM_SAFE}" 354 ewarn " ${INSTALLED_MPM_SAFE}"
348 fi 355 fi
349 356
350 fi 357 fi
351 358
352
353} 359}
354 360
355###### 361######
356## Apache dual (1.x or 2.x) ebuild functions 362## Apache dual (1.x or 2.x) ebuild functions
357## 363##

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

  ViewVC Help
Powered by ViewVC 1.1.20