/[gentoo-x86]/eclass/apache-2.eclass
Gentoo

Diff of /eclass/apache-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.4
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/apache-2.eclass,v 1.2 2007/11/29 18:43:31 hollow Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/apache-2.eclass,v 1.4 2007/12/20 15:53:19 zmedico Exp $
4 4
5# @ECLASS: apache-2 5# @ECLASS: apache-2
6# @MAINTAINER: apache-devs@gentoo.org 6# @MAINTAINER: apache-devs@gentoo.org
7# @BLURB: Provides a common set of functions for >=apache-2.2* ebuilds 7# @BLURB: Provides a common set of functions for >=apache-2.2* ebuilds
8# @DESCRIPTION: 8# @DESCRIPTION:
54# @DESCRIPTION: 54# @DESCRIPTION:
55# This variable needs to be set in the ebuild and contains a list of available 55# This variable needs to be set in the ebuild and contains a list of available
56# built-in modules 56# built-in modules
57 57
58IUSE_MPMS="${IUSE_MPMS_FORK} ${IUSE_MPMS_THREAD}" 58IUSE_MPMS="${IUSE_MPMS_FORK} ${IUSE_MPMS_THREAD}"
59IUSE="debug doc ldap selinux ssl static suexec threads" 59IUSE="${IUSE} debug doc ldap selinux ssl static suexec threads"
60 60
61for module in ${IUSE_MODULES} ; do 61for module in ${IUSE_MODULES} ; do
62 IUSE="${IUSE} apache2_modules_${module}" 62 IUSE="${IUSE} apache2_modules_${module}"
63done 63done
64 64
90# @FUNCTION: setup_mpm 90# @FUNCTION: setup_mpm
91# @DESCRIPTION: 91# @DESCRIPTION:
92# This internal function makes sure that only one of APACHE2_MPMS was selected 92# This internal function makes sure that only one of APACHE2_MPMS was selected
93# or a default based on USE=threads is selected if APACHE2_MPMS is empty 93# or a default based on USE=threads is selected if APACHE2_MPMS is empty
94setup_mpm() { 94setup_mpm() {
95 MY_MPM=""
95 for x in ${IUSE_MPMS} ; do 96 for x in ${IUSE_MPMS} ; do
96 if use apache2_mpms_${x} ; then 97 if use apache2_mpms_${x} ; then
97 if [[ -z "${MY_MPM}" ]] ; then 98 if [[ -z "${MY_MPM}" ]] ; then
98 MY_MPM=${x} 99 MY_MPM=${x}
99 elog 100 elog
130 eerror "You have selected a non-threaded MPM but USE=threads is enabled" 131 eerror "You have selected a non-threaded MPM but USE=threads is enabled"
131 die "invalid use flag combination" 132 die "invalid use flag combination"
132 fi 133 fi
133} 134}
134 135
136# @ECLASS-VARIABLE: MODULE_CRITICAL
137# @DESCRIPTION:
138# This variable needs to be set in the ebuild and contains a space-separated
139# list of modules critical for the default apache. A user may still
140# disable these modules for custom minimal installation at their own risk.
141
142# @FUNCTION: check_module_critical
143# @DESCRIPTION:
144# This internal function warns the user about modules critical for the default
145# apache configuration.
146check_module_critical() {
147 local unsupported=0
148
149 for m in ${MODULE_CRITICAL} ; do
150 if ! has ${m} ${MY_MODS} ; then
151 ewarn "Module '${m}' is required in the default apache configuration."
152 unsupported=1
153 fi
154 done
155
156 if [[ ${unsupported} -ne 0 ]] ; then
157 ewarn
158 ewarn "You have disabled one or more required modules"
159 ewarn "for the default apache configuration."
160 ewarn "Although this is not an error, please be"
161 ewarn "aware that this setup is UNSUPPORTED."
162 ewarn
163 ebeep 10
164 fi
165}
166
135# @ECLASS-VARIABLE: MODULE_DEPENDS 167# @ECLASS-VARIABLE: MODULE_DEPENDS
136# @DESCRIPTION: 168# @DESCRIPTION:
137# This variable needs to be set in the ebuild and contains a space-separated 169# This variable needs to be set in the ebuild and contains a space-separated
138# list of dependency tokens each with a module and the module it depends on 170# list of dependency tokens each with a module and the module it depends on
139# separated by a colon 171# separated by a colon
253 done 285 done
254 286
255 # sort and uniquify MY_MODS 287 # sort and uniquify MY_MODS
256 MY_MODS=$(echo ${MY_MODS} | tr ' ' '\n' | sort -u) 288 MY_MODS=$(echo ${MY_MODS} | tr ' ' '\n' | sort -u)
257 check_module_depends 289 check_module_depends
290 check_module_critical
258} 291}
259 292
260# @ECLASS-VARIABLE: MODULE_DEFINES 293# @ECLASS-VARIABLE: MODULE_DEFINES
261# @DESCRIPTION: 294# @DESCRIPTION:
262# This variable needs to be set in the ebuild and contains a space-separated 295# This variable needs to be set in the ebuild and contains a space-separated
348} 381}
349 382
350# @FUNCTION: apache-2_src_unpack 383# @FUNCTION: apache-2_src_unpack
351# @DESCRIPTION: 384# @DESCRIPTION:
352# This function applies patches, configures a custom file-system layout and 385# This function applies patches, configures a custom file-system layout and
353# rebuilds the configure scripts. The patch names are organized as follows: 386# rebuilds the configure scripts.
354#
355# 00-19 Gentoo specific (00_all_some-title.patch)
356# 20-39 Additional MPMs (20_all_${MPM}_some-title.patch)
357# 40-59 USE-flag based (40_all_${USE}_some-title.patch)
358# 60-79 Version specific (60_all_${PV}_some-title.patch)
359# 80-99 Security patches (80_all_${PV}_cve-####-####.patch)
360apache-2_src_unpack() { 387apache-2_src_unpack() {
361 unpack ${A} 388 unpack ${A}
362 cd "${S}" 389 cd "${S}"
363 390
364 # Use correct multilib libdir in gentoo patches 391 # Use correct multilib libdir in gentoo patches
371 # setup the filesystem layout config 398 # setup the filesystem layout config
372 cat "${GENTOO_PATCHDIR}"/patches/config.layout >> "${S}"/config.layout || \ 399 cat "${GENTOO_PATCHDIR}"/patches/config.layout >> "${S}"/config.layout || \
373 die "Failed preparing config.layout!" 400 die "Failed preparing config.layout!"
374 sed -i -e "s:version:${PF}:g" "${S}"/config.layout 401 sed -i -e "s:version:${PF}:g" "${S}"/config.layout
375 402
403 # apache2.8 instead of httpd.8 (bug #194828)
404 mv docs/man/{httpd,apache2}.8
405 sed -i -e 's/httpd\.8/apache2.8/g' Makefile.in
406
376 # patched-in MPMs need the build environment rebuilt 407 # patched-in MPMs need the build environment rebuilt
377 sed -i -e '/sinclude/d' configure.in 408 sed -i -e '/sinclude/d' configure.in
378 AT_GNUCONF_UPDATE=yes AT_M4DIR=build eautoreconf 409 AT_GNUCONF_UPDATE=yes AT_M4DIR=build eautoreconf
379
380 # apache2.8 instead of httpd.8 (bug #194828)
381 mv docs/man/{httpd,apache2}.8
382 sed -i -e 's/httpd\.8/apache2.8/g' Makefile.in
383} 410}
384 411
385# @FUNCTION: apache-2_src_compile 412# @FUNCTION: apache-2_src_compile
386# @DESCRIPTION: 413# @DESCRIPTION:
387# This function adds compiler flags and runs econf and emake based on MY_MPM and 414# This function adds compiler flags and runs econf and emake based on MY_MPM and

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

  ViewVC Help
Powered by ViewVC 1.1.20