/[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.38 Revision 1.39
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 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.38 2014/08/05 14:19:19 ottxor Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/apache-2.eclass,v 1.39 2014/08/07 07:37:54 polynomial-c Exp $
4 4
5# @ECLASS: apache-2.eclass 5# @ECLASS: apache-2.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# apache-devs@gentoo.org 7# apache-devs@gentoo.org
8# @BLURB: Provides a common set of functions for apache-2.x ebuilds 8# @BLURB: Provides a common set of functions for apache-2.x ebuilds
179# apache configuration. 179# apache configuration.
180check_module_critical() { 180check_module_critical() {
181 local unsupported=0 181 local unsupported=0
182 182
183 for m in ${MODULE_CRITICAL} ; do 183 for m in ${MODULE_CRITICAL} ; do
184 if ! has ${m} ${MY_MODS} ; then 184 if ! has ${m} ${MY_MODS[@]} ; then
185 ewarn "Module '${m}' is required in the default apache configuration." 185 ewarn "Module '${m}' is required in the default apache configuration."
186 unsupported=1 186 unsupported=1
187 fi 187 fi
188 done 188 done
189 189
208# This internal function makes sure that all inter-module dependencies are 208# This internal function makes sure that all inter-module dependencies are
209# satisfied with the current module selection 209# satisfied with the current module selection
210check_module_depends() { 210check_module_depends() {
211 local err=0 211 local err=0
212 212
213 for m in ${MY_MODS} ; do 213 for m in ${MY_MODS[@]} ; do
214 for dep in ${MODULE_DEPENDS} ; do 214 for dep in ${MODULE_DEPENDS} ; do
215 if [[ "${m}" == "${dep%:*}" ]] ; then 215 if [[ "${m}" == "${dep%:*}" ]] ; then
216 if ! use apache2_modules_${dep#*:} ; then 216 if ! use apache2_modules_${dep#*:} ; then
217 eerror "Module '${m}' depends on '${dep#*:}'" 217 eerror "Module '${m}' depends on '${dep#*:}'"
218 err=1 218 err=1
247 mod_type="static" 247 mod_type="static"
248 else 248 else
249 mod_type="shared" 249 mod_type="shared"
250 fi 250 fi
251 251
252 MY_CONF="--enable-so=static" 252 MY_CONF=( --enable-so=static )
253 MY_MODS=()
253 254
254 if use ldap ; then 255 if use ldap ; then
255 MY_CONF+=" --enable-authnz_ldap=${mod_type} --enable-ldap=${mod_type}" 256 MY_CONF+=( --enable-authnz_ldap=${mod_type} --enable-ldap=${mod_type} )
256 MY_MODS+=" ldap authnz_ldap" 257 MY_MODS+=( ldap authnz_ldap )
257 else 258 else
258 MY_CONF+=" --disable-authnz_ldap --disable-ldap" 259 MY_CONF+=( --disable-authnz_ldap --disable-ldap )
259 fi 260 fi
260 261
261 if use ssl ; then 262 if use ssl ; then
262 MY_CONF+=" --with-ssl="${EPREFIX}"/usr --enable-ssl=${mod_type}" 263 MY_CONF+=( --with-ssl="${EPREFIX}"/usr --enable-ssl=${mod_type} )
263 MY_MODS+=" ssl" 264 MY_MODS+=( ssl )
264 else 265 else
265 MY_CONF+=" --without-ssl --disable-ssl" 266 MY_CONF+=( --without-ssl --disable-ssl )
266 fi 267 fi
267 268
268 if use suexec ; then 269 if use suexec ; then
269 elog "You can manipulate several configure options of suexec" 270 elog "You can manipulate several configure options of suexec"
270 elog "through the following environment variables:" 271 elog "through the following environment variables:"
271 elog 272 elog
272 elog " SUEXEC_SAFEPATH: Default PATH for suexec (default: "${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/bin)" 273 elog " SUEXEC_SAFEPATH: Default PATH for suexec (default: '${EPREFIX}/usr/local/bin:${EPREFIX}/usr/bin:${EPREFIX}/bin')"
273 elog " SUEXEC_LOGFILE: Path to the suexec logfile (default: "${EPREFIX}"/var/log/apache2/suexec_log)" 274 elog " SUEXEC_LOGFILE: Path to the suexec logfile (default: '${EPREFIX}/var/log/apache2/suexec_log')"
274 elog " SUEXEC_CALLER: Name of the user Apache is running as (default: apache)" 275 elog " SUEXEC_CALLER: Name of the user Apache is running as (default: apache)"
275 elog " SUEXEC_DOCROOT: Directory in which suexec will run scripts (default: "${EPREFIX}"/var/www)" 276 elog " SUEXEC_DOCROOT: Directory in which suexec will run scripts (default: '${EPREFIX}/var/www')"
276 elog " SUEXEC_MINUID: Minimum UID, which is allowed to run scripts via suexec (default: 1000)" 277 elog " SUEXEC_MINUID: Minimum UID, which is allowed to run scripts via suexec (default: 1000)"
277 elog " SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)" 278 elog " SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)"
278 elog " SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)" 279 elog " SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)"
279 elog " SUEXEC_UMASK: Umask for the suexec process (default: 077)" 280 elog " SUEXEC_UMASK: Umask for the suexec process (default: 077)"
280 elog 281 elog
281 282
282 MY_CONF+=" --with-suexec-safepath=${SUEXEC_SAFEPATH:-"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/bin}" 283 MY_CONF+=( --with-suexec-safepath="${SUEXEC_SAFEPATH:-${EPREFIX}/usr/local/bin:${EPREFIX}/usr/bin:${EPREFIX}/bin}" )
283 MY_CONF+=" --with-suexec-logfile=${SUEXEC_LOGFILE:-"${EPREFIX}"/var/log/apache2/suexec_log}" 284 MY_CONF+=( --with-suexec-logfile="${SUEXEC_LOGFILE:-${EPREFIX}/var/log/apache2/suexec_log}" )
284 MY_CONF+=" --with-suexec-bin="${EPREFIX}"/usr/sbin/suexec" 285 MY_CONF+=( --with-suexec-bin="${EPREFIX}/usr/sbin/suexec" )
285 MY_CONF+=" --with-suexec-userdir=${SUEXEC_USERDIR:-public_html}" 286 MY_CONF+=( --with-suexec-userdir=${SUEXEC_USERDIR:-public_html} )
286 MY_CONF+=" --with-suexec-caller=${SUEXEC_CALLER:-apache}" 287 MY_CONF+=( --with-suexec-caller=${SUEXEC_CALLER:-apache} )
287 MY_CONF+=" --with-suexec-docroot=${SUEXEC_DOCROOT:-"${EPREFIX}"/var/www}" 288 MY_CONF+=( --with-suexec-docroot="${SUEXEC_DOCROOT:-${EPREFIX}/var/www}" )
288 MY_CONF+=" --with-suexec-uidmin=${SUEXEC_MINUID:-1000}" 289 MY_CONF+=( --with-suexec-uidmin=${SUEXEC_MINUID:-1000} )
289 MY_CONF+=" --with-suexec-gidmin=${SUEXEC_MINGID:-100}" 290 MY_CONF+=( --with-suexec-gidmin=${SUEXEC_MINGID:-100} )
290 MY_CONF+=" --with-suexec-umask=${SUEXEC_UMASK:-077}" 291 MY_CONF+=( --with-suexec-umask=${SUEXEC_UMASK:-077} )
291 MY_CONF+=" --enable-suexec=${mod_type}" 292 MY_CONF+=( --enable-suexec=${mod_type} )
292 MY_MODS+=" suexec" 293 MY_MODS+=( suexec )
293 else 294 else
294 MY_CONF+=" --disable-suexec" 295 MY_CONF+=( --disable-suexec )
295 fi 296 fi
296 297
297 for x in ${IUSE_MODULES} ; do 298 for x in ${IUSE_MODULES} ; do
298 if use apache2_modules_${x} ; then 299 if use apache2_modules_${x} ; then
299 MY_CONF+=" --enable-${x}=${mod_type}" 300 MY_CONF+=( --enable-${x}=${mod_type} )
300 MY_MODS+=" ${x}" 301 MY_MODS+=( ${x} )
301 else 302 else
302 MY_CONF+=" --disable-${x}" 303 MY_CONF+=( --disable-${x} )
303 fi 304 fi
304 done 305 done
305 306
306 # sort and uniquify MY_MODS 307 # sort and uniquify MY_MODS
307 MY_MODS=$(echo ${MY_MODS} | tr ' ' '\n' | sort -u) 308 MY_MODS=( $(echo ${MY_MODS[@]} | tr ' ' '\n' | sort -u) )
308 check_module_depends 309 check_module_depends
309 check_module_critical 310 check_module_critical
310} 311}
311 312
312# @VARIABLE: MODULE_DEFINES 313# @VARIABLE: MODULE_DEFINES
327 sed -i -e "/%%LOAD_MODULE%%/d" \ 328 sed -i -e "/%%LOAD_MODULE%%/d" \
328 "${GENTOO_PATCHDIR}"/conf/httpd.conf 329 "${GENTOO_PATCHDIR}"/conf/httpd.conf
329 return 330 return
330 fi 331 fi
331 332
332 for m in ${MY_MODS} ; do 333 for m in ${MY_MODS[@]} ; do
333 if [[ -e "${mod_dir}/mod_${m}.so" ]] ; then 334 if [[ -e "${mod_dir}/mod_${m}.so" ]] ; then
334 for def in ${MODULE_DEFINES} ; do 335 for def in ${MODULE_DEFINES} ; do
335 if [[ "${m}" == "${def%:*}" ]] ; then 336 if [[ "${m}" == "${def%:*}" ]] ; then
336 mod_lines="${mod_lines}\n<IfDefine ${def#*:}>" 337 mod_lines="${mod_lines}\n<IfDefine ${def#*:}>"
337 endit=1 338 endit=1
389 390
390 setup_mpm 391 setup_mpm
391 setup_modules 392 setup_modules
392 393
393 if use debug; then 394 if use debug; then
394 MY_CONF+=" --enable-maintainer-mode --enable-exception-hook" 395 MY_CONF+=( --enable-maintainer-mode --enable-exception-hook )
395 fi 396 fi
396 397
397 elog "Please note that you need SysV IPC support in your kernel." 398 elog "Please note that you need SysV IPC support in your kernel."
398 elog "Make sure CONFIG_SYSVIPC=y is set." 399 elog "Make sure CONFIG_SYSVIPC=y is set."
399 elog 400 elog
505 --with-pcre="${T}"/pcre-config \ 506 --with-pcre="${T}"/pcre-config \
506 --with-z="${EPREFIX}"/usr \ 507 --with-z="${EPREFIX}"/usr \
507 --with-port=80 \ 508 --with-port=80 \
508 --with-program-name=apache2 \ 509 --with-program-name=apache2 \
509 --enable-layout=Gentoo \ 510 --enable-layout=Gentoo \
510 ${MY_CONF} || die "econf failed!" 511 "${MY_CONF[@]}"
511 512
512 sed -i -e 's:apache2\.conf:httpd.conf:' include/ap_config_auto.h 513 sed -i -e 's:apache2\.conf:httpd.conf:' include/ap_config_auto.h
513} 514}
514 515
515# @FUNCTION: apache-2_src_install 516# @FUNCTION: apache-2_src_install
516# @DESCRIPTION: 517# @DESCRIPTION:
517# This function runs `emake install' and generates, installs and adapts the gentoo 518# This function runs `emake install' and generates, installs and adapts the gentoo
518# specific configuration files found in the tarball 519# specific configuration files found in the tarball
519apache-2_src_install() { 520apache-2_src_install() {
520 emake DESTDIR="${D}" MKINSTALLDIRS="mkdir -p" install || die "make install failed" 521 emake DESTDIR="${D}" MKINSTALLDIRS="mkdir -p" install
521 522
522 # install our configuration files 523 # install our configuration files
523 keepdir /etc/apache2/vhosts.d 524 keepdir /etc/apache2/vhosts.d
524 keepdir /etc/apache2/modules.d 525 keepdir /etc/apache2/modules.d
525 526

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

  ViewVC Help
Powered by ViewVC 1.1.20