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

Diff of /eclass/webapp.eclass

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

Revision 1.61 Revision 1.66
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.61 2008/03/04 18:44:01 hollow Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.66 2011/05/19 12:05:13 scarabeus 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
14# @DESCRIPTION:
15# An ebuild should use WEBAPP_DEPEND if a custom DEPEND needs to be built, most
16# notably in combination with WEBAPP_OPTIONAL.
17WEBAPP_DEPEND=">=app-admin/webapp-config-1.50.15"
18
13# @ECLASS-VARIABLE: WEBAPP_NO_AUTO_INSTALL 19# @ECLASS-VARIABLE: WEBAPP_NO_AUTO_INSTALL
14# @DESCRIPTION: 20# @DESCRIPTION:
15# An ebuild sets this to `yes' if an automatic installation and/or upgrade is 21# An ebuild sets this to `yes' if an automatic installation and/or upgrade is
16# not possible. The ebuild should overwrite pkg_postinst() and explain the 22# not possible. The ebuild should overwrite pkg_postinst() and explain the
17# reason for this BEFORE calling webapp_pkg_postinst(). 23# reason for this BEFORE calling webapp_pkg_postinst().
22# you also need to take care of USE-flags and dependencies. 28# you also need to take care of USE-flags and dependencies.
23 29
24if [[ "${WEBAPP_OPTIONAL}" != "yes" ]]; then 30if [[ "${WEBAPP_OPTIONAL}" != "yes" ]]; then
25 [[ "${WEBAPP_NO_AUTO_INSTALL}" == "yes" ]] || IUSE="vhosts" 31 [[ "${WEBAPP_NO_AUTO_INSTALL}" == "yes" ]] || IUSE="vhosts"
26 SLOT="${PVR}" 32 SLOT="${PVR}"
27 DEPEND=">=app-admin/webapp-config-1.50.15" 33 DEPEND="${WEBAPP_DEPEND}"
28 RDEPEND="${DEPEND}" 34 RDEPEND="${DEPEND}"
29fi 35fi
30 36
31EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm 37EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm
32 38
131# PUBLIC FUNCTIONS 137# PUBLIC FUNCTIONS
132# ============================================================================== 138# ==============================================================================
133 139
134# @FUNCTION: need_httpd 140# @FUNCTION: need_httpd
135# @DESCRIPTION: 141# @DESCRIPTION:
136# 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
137# webservers are able to run this application. 143# webservers are able to run this application.
138need_httpd() { 144need_httpd() {
139 DEPEND="${DEPEND} 145 DEPEND="${DEPEND}
140 || ( virtual/httpd-basic virtual/httpd-cgi virtual/httpd-fastcgi )" 146 || ( virtual/httpd-basic virtual/httpd-cgi virtual/httpd-fastcgi )"
141} 147}
142 148
143# @FUNCTION: need_httpd_cgi 149# @FUNCTION: need_httpd_cgi
144# @DESCRIPTION: 150# @DESCRIPTION:
145# 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
146# CGI-capable webservers are able to run this application. 152# CGI-capable webservers are able to run this application.
147need_httpd_cgi() { 153need_httpd_cgi() {
148 DEPEND="${DEPEND} 154 DEPEND="${DEPEND}
149 || ( virtual/httpd-cgi virtual/httpd-fastcgi )" 155 || ( virtual/httpd-cgi virtual/httpd-fastcgi )"
150} 156}
151 157
152# @FUNCTION: need_httpd_fastcgi 158# @FUNCTION: need_httpd_fastcgi
153# @DESCRIPTION: 159# @DESCRIPTION:
154# 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
155# FastCGI-capabale webservers are able to run this application. 161# FastCGI-capabale webservers are able to run this application.
156need_httpd_fastcgi() { 162need_httpd_fastcgi() {
157 DEPEND="${DEPEND} 163 DEPEND="${DEPEND}
158 virtual/httpd-fastcgi" 164 virtual/httpd-fastcgi"
159} 165}
313# 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.
314# For now we just create required webapp-config directories. 320# For now we just create required webapp-config directories.
315webapp_src_preinst() { 321webapp_src_preinst() {
316 debug-print-function $FUNCNAME $* 322 debug-print-function $FUNCNAME $*
317 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
338 # Hint, see the webapp_read_config() function to find where these are
339 # defined.
318 dodir "${MY_HTDOCSDIR}" 340 dodir "${MY_HTDOCSDIR}"
319 dodir "${MY_HOSTROOTDIR}" 341 dodir "${MY_HOSTROOTDIR}"
320 dodir "${MY_CGIBINDIR}" 342 dodir "${MY_CGIBINDIR}"
321 dodir "${MY_ICONSDIR}" 343 dodir "${MY_ICONSDIR}"
322 dodir "${MY_ERRORSDIR}" 344 dodir "${MY_ERRORSDIR}"
407 # 429 #
408 # we used to just set a variable in the shell script, but we can 430 # we used to just set a variable in the shell script, but we can
409 # no longer rely on Portage calling both webapp_src_install() and 431 # no longer rely on Portage calling both webapp_src_install() and
410 # webapp_pkg_postinst() within the same shell process 432 # webapp_pkg_postinst() within the same shell process
411 touch "${D}/${MY_APPDIR}/${INSTALL_CHECK_FILE}" 433 touch "${D}/${MY_APPDIR}/${INSTALL_CHECK_FILE}"
412
413 # sanity checks, to catch bugs in the ebuild
414 if [[ ! -f "${T}/${SETUP_CHECK_FILE}" ]]; then
415 eerror
416 eerror "This ebuild did not call webapp_pkg_setup() at the beginning"
417 eerror "of the pkg_setup() function"
418 eerror
419 eerror "Please log a bug on http://bugs.gentoo.org"
420 eerror
421 eerror "You should use emerge -C to remove this package, as the"
422 eerror "installation is incomplete"
423 eerror
424 die "Ebuild did not call webapp_pkg_setup() - report to http://bugs.gentoo.org"
425 fi
426 434
427 chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${D}/" 435 chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${D}/"
428 chmod -R u-s "${D}/" 436 chmod -R u-s "${D}/"
429 chmod -R g-s "${D}/" 437 chmod -R g-s "${D}/"
430 438

Legend:
Removed from v.1.61  
changed lines
  Added in v.1.66

  ViewVC Help
Powered by ViewVC 1.1.20