/[gentoo-x86]/eclass/webapp.eclass
Gentoo

Diff of /eclass/webapp.eclass

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

Revision 1.62 Revision 1.63
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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/webapp.eclass,v 1.62 2008/03/04 18:54:41 hollow Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.63 2008/03/23 00:11:20 hollow Exp $
4# 4
5# @ECLASS: webapp.eclass 5# @ECLASS: webapp.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# web-apps@gentoo.org 7# web-apps@gentoo.org
8# @BLURB: functions for installing applications to run under a web server 8# @BLURB: functions for installing applications to run under a web server
9# @DESCRIPTION: 9# @DESCRIPTION:
10# The webapp eclass contains functions to handle web applications with 10# The webapp eclass contains functions to handle web applications with
11# webapp-config. Part of the implementation of GLEP #11 11# webapp-config. Part of the implementation of GLEP #11
12 12
13# @ECLASS-VARIABLE: WEBAPP_DEPEND 13# @ECLASS-VARIABLE: WEBAPP_DEPEND
14# @DESCRIPTION: 14# @DESCRIPTION:
15# An ebuild should use WEBAPP_DEPEND if a custom DEPEND needs to be build, most 15# An ebuild should use WEBAPP_DEPEND if a custom DEPEND needs to be built, most
16# notably in combination with WEBAPP_OPTIONAL. 16# notably in combination with WEBAPP_OPTIONAL.
17WEBAPP_DEPEND=">=app-admin/webapp-config-1.50.15" 17WEBAPP_DEPEND=">=app-admin/webapp-config-1.50.15"
18 18
19# @ECLASS-VARIABLE: WEBAPP_NO_AUTO_INSTALL 19# @ECLASS-VARIABLE: WEBAPP_NO_AUTO_INSTALL
20# @DESCRIPTION: 20# @DESCRIPTION:
137# PUBLIC FUNCTIONS 137# PUBLIC FUNCTIONS
138# ============================================================================== 138# ==============================================================================
139 139
140# @FUNCTION: need_httpd 140# @FUNCTION: need_httpd
141# @DESCRIPTION: 141# @DESCRIPTION:
142# Call this function AFTER your ebuild's DEPEND line if any of the available 142# Call this function AFTER your ebuilds DEPEND line if any of the available
143# webservers are able to run this application. 143# webservers are able to run this application.
144need_httpd() { 144need_httpd() {
145 DEPEND="${DEPEND} 145 DEPEND="${DEPEND}
146 || ( virtual/httpd-basic virtual/httpd-cgi virtual/httpd-fastcgi )" 146 || ( virtual/httpd-basic virtual/httpd-cgi virtual/httpd-fastcgi )"
147} 147}
148 148
149# @FUNCTION: need_httpd_cgi 149# @FUNCTION: need_httpd_cgi
150# @DESCRIPTION: 150# @DESCRIPTION:
151# Call this function AFTER your ebuild's DEPEND line if any of the available 151# Call this function AFTER your ebuilds DEPEND line if any of the available
152# CGI-capable webservers are able to run this application. 152# CGI-capable webservers are able to run this application.
153need_httpd_cgi() { 153need_httpd_cgi() {
154 DEPEND="${DEPEND} 154 DEPEND="${DEPEND}
155 || ( virtual/httpd-cgi virtual/httpd-fastcgi )" 155 || ( virtual/httpd-cgi virtual/httpd-fastcgi )"
156} 156}
157 157
158# @FUNCTION: need_httpd_fastcgi 158# @FUNCTION: need_httpd_fastcgi
159# @DESCRIPTION: 159# @DESCRIPTION:
160# Call this function AFTER your ebuild's DEPEND line if any of the available 160# Call this function AFTER your ebuilds DEPEND line if any of the available
161# FastCGI-capabale webservers are able to run this application. 161# FastCGI-capabale webservers are able to run this application.
162need_httpd_fastcgi() { 162need_httpd_fastcgi() {
163 DEPEND="${DEPEND} 163 DEPEND="${DEPEND}
164 virtual/httpd-fastcgi" 164 virtual/httpd-fastcgi"
165} 165}
319# You need to call this function in src_install() BEFORE anything else has run. 319# You need to call this function in src_install() BEFORE anything else has run.
320# For now we just create required webapp-config directories. 320# For now we just create required webapp-config directories.
321webapp_src_preinst() { 321webapp_src_preinst() {
322 debug-print-function $FUNCNAME $* 322 debug-print-function $FUNCNAME $*
323 323
324 # sanity checks, to catch bugs in the ebuild
325 if [[ ! -f "${T}/${SETUP_CHECK_FILE}" ]]; then
326 eerror
327 eerror "This ebuild did not call webapp_pkg_setup() at the beginning"
328 eerror "of the pkg_setup() function"
329 eerror
330 eerror "Please log a bug on http://bugs.gentoo.org"
331 eerror
332 eerror "You should use emerge -C to remove this package, as the"
333 eerror "installation is incomplete"
334 eerror
335 die "Ebuild did not call webapp_pkg_setup() - report to http://bugs.gentoo.org"
336 fi
337
324 dodir "${MY_HTDOCSDIR}" 338 dodir "${MY_HTDOCSDIR}"
325 dodir "${MY_HOSTROOTDIR}" 339 dodir "${MY_HOSTROOTDIR}"
326 dodir "${MY_CGIBINDIR}" 340 dodir "${MY_CGIBINDIR}"
327 dodir "${MY_ICONSDIR}" 341 dodir "${MY_ICONSDIR}"
328 dodir "${MY_ERRORSDIR}" 342 dodir "${MY_ERRORSDIR}"
413 # 427 #
414 # we used to just set a variable in the shell script, but we can 428 # we used to just set a variable in the shell script, but we can
415 # no longer rely on Portage calling both webapp_src_install() and 429 # no longer rely on Portage calling both webapp_src_install() and
416 # webapp_pkg_postinst() within the same shell process 430 # webapp_pkg_postinst() within the same shell process
417 touch "${D}/${MY_APPDIR}/${INSTALL_CHECK_FILE}" 431 touch "${D}/${MY_APPDIR}/${INSTALL_CHECK_FILE}"
418
419 # sanity checks, to catch bugs in the ebuild
420 if [[ ! -f "${T}/${SETUP_CHECK_FILE}" ]]; then
421 eerror
422 eerror "This ebuild did not call webapp_pkg_setup() at the beginning"
423 eerror "of the pkg_setup() function"
424 eerror
425 eerror "Please log a bug on http://bugs.gentoo.org"
426 eerror
427 eerror "You should use emerge -C to remove this package, as the"
428 eerror "installation is incomplete"
429 eerror
430 die "Ebuild did not call webapp_pkg_setup() - report to http://bugs.gentoo.org"
431 fi
432 432
433 chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${D}/" 433 chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${D}/"
434 chmod -R u-s "${D}/" 434 chmod -R u-s "${D}/"
435 chmod -R g-s "${D}/" 435 chmod -R g-s "${D}/"
436 436

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63

  ViewVC Help
Powered by ViewVC 1.1.20