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

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20