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

Diff of /eclass/webapp.eclass

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

Revision 1.9 Revision 1.10
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2004 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.9 2004/04/23 22:02:27 stuart Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.10 2004/04/28 22:18: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.4" 23DEPEND="$DEPEND >=net-www/webapp-config-1.5"
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
261 dodir ${MY_SQLSCRIPTSDIR} 261 dodir ${MY_SQLSCRIPTSDIR}
262} 262}
263 263
264function webapp_pkg_postinst () 264function webapp_pkg_postinst ()
265{ 265{
266 # if 'vhosts' is not set in your USE flags, we install a copy of
267 # this application in /var/www/localhost/htdocs/${PN}/ for you
268
269 if ! use vhosts ; then
266 G_HOSTNAME="localhost" 270 G_HOSTNAME="localhost"
267 . /etc/vhosts/webapp-config 271 . /etc/vhosts/webapp-config
268 272
269 use vhosts || /usr/sbin/webapp-config -I -u root -h localhost -d "${VHOST_ROOT}/htdocs/${PN}/" ${PN} ${PVR} 273 local my_mode=-I
274 local my_dir="${VHOST_ROOT}/htdocs/${PN}"
275
276 # are we installing afresh - or are we upgrading?
277 # find out by looking to see what (if anything) is installed
278 # in there already
279
280 local my_output="`/usr/sbin/webapp-config --show-installed -d $my_dir 2> /dev/null`"
281 if [ "$?" = 0 ]; then
282
283 # something is in there - but the question has to be ... what?
284
285 if [ "`echo $my_output | awk '{ print $1 }'`" = "${PN}" ]; then
286 # we have an older version of whatever it is our ebuild is
287 # trying to install ;-)
288 #
289 # this is the situation we can deal with
290
291 my_mode=-U
292 else
293 # this should never happen - but just in case ...
294 #
295 # whatever is in that directory, it isn't the application
296 # that we are currently trying to install
297 #
298 # rather than overwrite the contents, we bail with an error
299 # instead
300
301 die "$my_output is already installed in $my_dir"
302 fi
303 fi
304
305 /usr/sbin/webapp-config $my_mode -u root -d "$my_dir" ${PN} ${PVR}
306 fi
270} 307}

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

  ViewVC Help
Powered by ViewVC 1.1.20