/[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.22 Revision 1.28
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.22 2010/08/21 19:39:52 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/apache-2.eclass,v 1.28 2012/03/29 15:35:04 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
486 # generate a sane default APACHE2_OPTS 484 # generate a sane default APACHE2_OPTS
487 APACHE2_OPTS="-D DEFAULT_VHOST -D INFO" 485 APACHE2_OPTS="-D DEFAULT_VHOST -D INFO"
488 use doc && APACHE2_OPTS="${APACHE2_OPTS} -D MANUAL" 486 use doc && APACHE2_OPTS="${APACHE2_OPTS} -D MANUAL"
489 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"
490 use suexec && APACHE2_OPTS="${APACHE2_OPTS} -D SUEXEC" 488 use suexec && APACHE2_OPTS="${APACHE2_OPTS} -D SUEXEC"
491 if hasq negotiation ${APACHE2_MODULES} && use apache2_modules_negotiation; then 489 if has negotiation ${APACHE2_MODULES} && use apache2_modules_negotiation; then
492 APACHE2_OPTS="${APACHE2_OPTS} -D LANGUAGE" 490 APACHE2_OPTS="${APACHE2_OPTS} -D LANGUAGE"
493 fi 491 fi
494 492
495 sed -i -e "s:APACHE2_OPTS=\".*\":APACHE2_OPTS=\"${APACHE2_OPTS}\":" \ 493 sed -i -e "s:APACHE2_OPTS=\".*\":APACHE2_OPTS=\"${APACHE2_OPTS}\":" \
496 "${GENTOO_PATCHDIR}"/init/apache2.confd || die "sed failed" 494 "${GENTOO_PATCHDIR}"/init/apache2.confd || die "sed failed"
539 537
540 # empty dirs 538 # empty dirs
541 for i in /var/lib/dav /var/log/apache2 /var/cache/apache2 ; do 539 for i in /var/lib/dav /var/log/apache2 /var/cache/apache2 ; do
542 keepdir ${i} 540 keepdir ${i}
543 fowners apache:apache ${i} 541 fowners apache:apache ${i}
544 fperms 0755 ${i} 542 fperms 0750 ${i}
545 done 543 done
546} 544}
547 545
548# @FUNCTION: apache-2_pkg_postinst 546# @FUNCTION: apache-2_pkg_postinst
549# @DESCRIPTION: 547# @DESCRIPTION:
550# This function creates test certificates if SSL is enabled and installs the 548# This function creates test certificates if SSL is enabled and installs the
551# default index.html to /var/www/localhost if it does not exist. We do this here 549# default index.html to /var/www/localhost if it does not exist. We do this here
552# because the default webroot is a copy of the files that exist elsewhere and we 550# because the default webroot is a copy of the files that exist elsewhere and we
553# don't want them to be managed/removed by portage when apache is upgraded. 551# don't want them to be managed/removed by portage when apache is upgraded.
554apache-2_pkg_postinst() { 552apache-2_pkg_postinst() {
553 # fix previously wrong set permissions Bug#398899
554 einfo "Sanitizing directory permissions ..."
555 for i in /var/lib/dav /var/log/apache2 /var/cache/apache2 ; do
556 chmod 0750 ${i}
557 done
558
555 if use ssl && [[ ! -e "${ROOT}/etc/ssl/apache2/server.pem" ]]; then 559 if use ssl && [[ ! -e "${ROOT}/etc/ssl/apache2/server.pem" ]]; then
556 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Apache HTTP Server}" 560 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Apache HTTP Server}"
557 install_cert /etc/ssl/apache2/server 561 install_cert /etc/ssl/apache2/server
558 ewarn 562 ewarn
559 ewarn "The location of SSL certificates has changed. If you are" 563 ewarn "The location of SSL certificates has changed. If you are"
569 echo "<html><body><h1>It works!</h1></body></html>" > "${ROOT}/var/www/localhost/htdocs/index.html" 573 echo "<html><body><h1>It works!</h1></body></html>" > "${ROOT}/var/www/localhost/htdocs/index.html"
570 fi 574 fi
571 575
572 echo 576 echo
573 elog "Attention: cgi and cgid modules are now handled via APACHE2_MODULES flags" 577 elog "Attention: cgi and cgid modules are now handled via APACHE2_MODULES flags"
574 elog "make sure to enable those in order to compile them. In general, you should" 578 elog "in /etc/make.conf. Make sure to enable those in order to compile them."
575 elog "use 'cgi' with non-multithreaded MPMs (such as prefork) and 'cgid' with" 579 elog "In general, you should use 'cgid' with threaded MPMs and 'cgi' otherwise."
576 elog "multithreaded ones (such as worker)"
577 echo 580 echo
578 581
579} 582}
580 583
581EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_install pkg_postinst 584EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_install pkg_postinst

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.20