/[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.18 Revision 1.27
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2012 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.18 2009/09/20 08:37:23 hollow Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/apache-2.eclass,v 1.27 2012/03/05 08:20:52 patrick Exp $
4
5EAPI="2"
6 4
7# @ECLASS: apache-2.eclass 5# @ECLASS: apache-2.eclass
8# @MAINTAINER: 6# @MAINTAINER:
9# apache-devs@gentoo.org 7# apache-devs@gentoo.org
10# @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
241 if use ssl ; then 239 if use ssl ; then
242 MY_CONF="${MY_CONF} --with-ssl=/usr --enable-ssl=${mod_type}" 240 MY_CONF="${MY_CONF} --with-ssl=/usr --enable-ssl=${mod_type}"
243 MY_MODS="${MY_MODS} ssl" 241 MY_MODS="${MY_MODS} ssl"
244 else 242 else
245 MY_CONF="${MY_CONF} --without-ssl --disable-ssl" 243 MY_CONF="${MY_CONF} --without-ssl --disable-ssl"
246 fi
247
248 if use threads || has ${MY_MPM} ${IUSE_MPMS_THREAD} ; then
249 MY_CONF="${MY_CONF} --enable-cgid=${mod_type}"
250 MY_MODS="${MY_MODS} cgid"
251 else
252 MY_CONF="${MY_CONF} --enable-cgi=${mod_type}"
253 MY_MODS="${MY_MODS} cgi"
254 fi 244 fi
255 245
256 if use suexec ; then 246 if use suexec ; then
257 elog "You can manipulate several configure options of suexec" 247 elog "You can manipulate several configure options of suexec"
258 elog "through the following environment variables:" 248 elog "through the following environment variables:"
432 mv docs/man/{httpd,apache2}.8 422 mv docs/man/{httpd,apache2}.8
433 sed -i -e 's/httpd\.8/apache2.8/g' Makefile.in 423 sed -i -e 's/httpd\.8/apache2.8/g' Makefile.in
434 424
435 # patched-in MPMs need the build environment rebuilt 425 # patched-in MPMs need the build environment rebuilt
436 sed -i -e '/sinclude/d' configure.in 426 sed -i -e '/sinclude/d' configure.in
437 AT_GNUCONF_UPDATE=yes AT_M4DIR=build eautoreconf 427 AT_M4DIR=build eautoreconf
438} 428}
439 429
440# @FUNCTION: apache-2_src_configure 430# @FUNCTION: apache-2_src_configure
441# @DESCRIPTION: 431# @DESCRIPTION:
442# This function adds compiler flags and runs econf and emake based on MY_MPM and 432# This function adds compiler flags and runs econf and emake based on MY_MPM and
443# MY_CONF 433# MY_CONF
444apache-2_src_configure() { 434apache-2_src_configure() {
445 # Instead of filtering --as-needed (bug #128505), append --no-as-needed 435 # Instead of filtering --as-needed (bug #128505), append --no-as-needed
446 # Thanks to Harald van Dijk 436 # Thanks to Harald van Dijk
447 # ... but only on platforms that use a GNU linker!
448 case ${CHOST} in
449 *-solaris* | *-*bsd* | *-linux-gnu)
450 append-ldflags -Wl,--no-as-needed 437 append-ldflags $(no-as-needed)
451 ;;
452 esac
453 438
454 # peruser MPM debugging with -X is nearly impossible 439 # peruser MPM debugging with -X is nearly impossible
455 if has peruser ${IUSE_MPMS} && use apache2_mpms_peruser ; then 440 if has peruser ${IUSE_MPMS} && use apache2_mpms_peruser ; then
456 use debug && append-flags -DMPM_PERUSER_DEBUG 441 use debug && append-flags -DMPM_PERUSER_DEBUG
457 fi 442 fi
489 keepdir /etc/apache2/modules.d 474 keepdir /etc/apache2/modules.d
490 475
491 generate_load_module 476 generate_load_module
492 insinto /etc/apache2 477 insinto /etc/apache2
493 doins -r "${GENTOO_PATCHDIR}"/conf/* 478 doins -r "${GENTOO_PATCHDIR}"/conf/*
494 doins docs/conf/magic 479 use apache2_modules_mime_magic && doins docs/conf/magic
495 480
496 insinto /etc/logrotate.d 481 insinto /etc/logrotate.d
497 newins "${GENTOO_PATCHDIR}"/scripts/apache2-logrotate apache2 482 newins "${GENTOO_PATCHDIR}"/scripts/apache2-logrotate apache2
498 483
499 # generate a sane default APACHE2_OPTS 484 # generate a sane default APACHE2_OPTS
500 APACHE2_OPTS="-D DEFAULT_VHOST -D INFO" 485 APACHE2_OPTS="-D DEFAULT_VHOST -D INFO"
501 use doc && APACHE2_OPTS="${APACHE2_OPTS} -D MANUAL" 486 use doc && APACHE2_OPTS="${APACHE2_OPTS} -D MANUAL"
502 use ssl && APACHE2_OPTS="${APACHE2_OPTS} -D SSL -D SSL_DEFAULT_VHOST" 487 use ssl && APACHE2_OPTS="${APACHE2_OPTS} -D SSL -D SSL_DEFAULT_VHOST"
503 use suexec && APACHE2_OPTS="${APACHE2_OPTS} -D SUEXEC" 488 use suexec && APACHE2_OPTS="${APACHE2_OPTS} -D SUEXEC"
504 if hasq negotiation ${APACHE2_MODULES} && use apache2_modules_negotiation; then 489 if has negotiation ${APACHE2_MODULES} && use apache2_modules_negotiation; then
505 APACHE2_OPTS="${APACHE2_OPTS} -D LANGUAGE" 490 APACHE2_OPTS="${APACHE2_OPTS} -D LANGUAGE"
506 fi 491 fi
507 492
508 sed -i -e "s:APACHE2_OPTS=\".*\":APACHE2_OPTS=\"${APACHE2_OPTS}\":" \ 493 sed -i -e "s:APACHE2_OPTS=\".*\":APACHE2_OPTS=\"${APACHE2_OPTS}\":" \
509 "${GENTOO_PATCHDIR}"/init/apache2.confd || die "sed failed" 494 "${GENTOO_PATCHDIR}"/init/apache2.confd || die "sed failed"
579 564
580 if [[ ! -e "${ROOT}/var/www/localhost" ]] ; then 565 if [[ ! -e "${ROOT}/var/www/localhost" ]] ; then
581 mkdir -p "${ROOT}/var/www/localhost/htdocs" 566 mkdir -p "${ROOT}/var/www/localhost/htdocs"
582 echo "<html><body><h1>It works!</h1></body></html>" > "${ROOT}/var/www/localhost/htdocs/index.html" 567 echo "<html><body><h1>It works!</h1></body></html>" > "${ROOT}/var/www/localhost/htdocs/index.html"
583 fi 568 fi
569
570 echo
571 elog "Attention: cgi and cgid modules are now handled via APACHE2_MODULES flags"
572 elog "in /etc/make.conf. Make sure to enable those in order to compile them."
573 elog "In general, you should use 'cgid' with threaded MPMs and 'cgi' otherwise."
574 echo
575
584} 576}
585 577
586EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_install pkg_postinst 578EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_install pkg_postinst

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.20