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

Diff of /eclass/webapp.eclass

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

Revision 1.8 Revision 1.9
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
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.8 2004/04/23 14:19:35 stuart Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.9 2004/04/23 22:02:27 stuart Exp $
4# 4#
5# eclass/webapp.eclass 5# eclass/webapp.eclass
6# Eclass for installing applications to run under a web server 6# Eclass for installing applications to run under a web server
7# 7#
8# Part of the implementation of GLEP #11 8# Part of the implementation of GLEP #11
18 18
19ECLASS=webapp 19ECLASS=webapp
20INHERITED="$INHERITED $ECLASS" 20INHERITED="$INHERITED $ECLASS"
21SLOT="${PVR}" 21SLOT="${PVR}"
22IUSE="$IUSE vhosts" 22IUSE="$IUSE vhosts"
23DEPEND="$DEPEND >=net-www/webapp-config-1.3" 23DEPEND="$DEPEND >=net-www/webapp-config-1.4"
24 24
25EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install 25EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install
26 26
27# ------------------------------------------------------------------------ 27# ------------------------------------------------------------------------
28# INTERNAL FUNCTION - USED BY THIS ECLASS ONLY 28# INTERNAL FUNCTION - USED BY THIS ECLASS ONLY
35# @return 0 on success, never returns on an error 35# @return 0 on success, never returns on an error
36# ------------------------------------------------------------------------ 36# ------------------------------------------------------------------------
37 37
38function webapp_checkfileexists () 38function webapp_checkfileexists ()
39{ 39{
40 local my_prefix
41
42 [ -n "$2" ] && my_prefix="$2/" || my_prefix=
43
40 if [ ! -e $1 ]; then 44 if [ ! -e ${my_prefix}$1 ]; then
41 msg="ebuild fault: file $1 not found" 45 msg="ebuild fault: file $1 not found"
42 eerror "$msg" 46 eerror "$msg"
43 eerror "Please report this as a bug at http://bugs.gentoo.org/" 47 eerror "Please report this as a bug at http://bugs.gentoo.org/"
44 die "$msg" 48 die "$msg"
45 fi 49 fi
241 if [ -d "${D}${MY_APPROOT}/${MY_APPSUFFIX}" ]; then 245 if [ -d "${D}${MY_APPROOT}/${MY_APPSUFFIX}" ]; then
242 # yes we are 246 # yes we are
243 ewarn "Removing existing copy of ${PN}-${PVR}" 247 ewarn "Removing existing copy of ${PN}-${PVR}"
244 rm -rf "${D}${MY_APPROOT}/${MY_APPSUFFIX}" 248 rm -rf "${D}${MY_APPROOT}/${MY_APPSUFFIX}"
245 fi 249 fi
250}
246 251
252function webapp_src_preinst ()
253{
247 # create the directories that we need 254 # create the directories that we need
248 255
249 mkdir -p ${D}${MY_HTDOCSDIR} 256 dodir ${MY_HTDOCSDIR}
250 mkdir -p ${D}${MY_HOSTROOTDIR} 257 dodir ${MY_HOSTROOTDIR}
251 mkdir -p ${D}${MY_CGIBINDIR} 258 dodir ${MY_CGIBINDIR}
252 mkdir -p ${D}${MY_ICONSDIR} 259 dodir ${MY_ICONSDIR}
253 mkdir -p ${D}${MY_ERRORSDIR} 260 dodir ${MY_ERRORSDIR}
254 mkdir -p ${D}${MY_SQLSCRIPTSDIR} 261 dodir ${MY_SQLSCRIPTSDIR}
255} 262}
256 263
257function webapp_pkg_postinst () 264function webapp_pkg_postinst ()
258{ 265{
259 G_HOSTNAME="localhost" 266 G_HOSTNAME="localhost"
260 . /etc/vhosts/webapp-config 267 . /etc/vhosts/webapp-config
261 268
262 use vhosts || /usr/sbin/webapp-config -I -u root -d "${VHOST_ROOT}/htdocs/${PN}/" ${PN} ${PVR} 269 use vhosts || /usr/sbin/webapp-config -I -u root -h localhost -d "${VHOST_ROOT}/htdocs/${PN}/" ${PN} ${PVR}
263} 270}

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.20