public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Benedikt Boehm (hollow)" <hollow@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in eclass: webapp.eclass
Date: Fri, 22 Feb 2008 10:03:55 +0000	[thread overview]
Message-ID: <E1JSUl1-0002hk-VD@stork.gentoo.org> (raw)

hollow      08/02/22 10:03:55

  Modified:             webapp.eclass
  Log:
  document missing parts

Revision  Changes    Path
1.50                 eclass/webapp.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?rev=1.50&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?rev=1.50&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?r1=1.49&r2=1.50

Index: webapp.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- webapp.eclass	22 Feb 2008 09:33:45 -0000	1.49
+++ webapp.eclass	22 Feb 2008 10:03:55 -0000	1.50
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.49 2008/02/22 09:33:45 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.50 2008/02/22 10:03:55 hollow Exp $
 #
 # @ECLASS: webapp.eclass
 # @MAINTAINER:
@@ -43,7 +43,6 @@
 }
 
 # Check whether a specified file exists in the given directory (`.' by default)
-# or not.
 webapp_checkfileexists() {
 	local my_prefix
 
@@ -75,6 +74,43 @@
 	echo "${1}" | sed -e 's|/./|/|g;'
 }
 
+webapp_getinstalltype() {
+	# or are we upgrading?
+
+	if ! use vhosts ; then
+		# we only run webapp-config if vhosts USE flag is not set
+
+		local my_output
+
+		my_output="$(webapp_check_installedat)"
+
+		if [ "${?}" = "0" ] ; then
+			# something is already installed there
+			#
+			# make sure it isn't the same version
+
+			local my_pn="$(echo ${my_output} | awk '{ print $1 }')"
+			local my_pvr="$(echo ${my_output} | awk '{ print $2 }')"
+
+			REMOVE_PKG="${my_pn}-${my_pvr}"
+
+			if [ "${my_pn}" == "${PN}" ]; then
+				if [ "${my_pvr}" != "${PVR}" ]; then
+					elog "This is an upgrade"
+					IS_UPGRADE=1
+				else
+					elog "This is a re-installation"
+					IS_REPLACE=1
+				fi
+			else
+				elog "${my_output} is installed there"
+			fi
+		else
+			elog "This is an installation"
+		fi
+	fi
+}
+
 # ==============================================================================
 # PUBLIC FUNCTIONS
 # ==============================================================================
@@ -232,15 +268,32 @@
 	fi
 }
 
+# @FUNCTION: webapp_src_preinst
+# @DESCRIPTION:
+# You need to call this function in src_install() BEFORE anything else has run.
+# For now we just create required webapp-config directories.
+webapp_src_preinst() {
+	dodir "${MY_HTDOCSDIR}"
+	dodir "${MY_HOSTROOTDIR}"
+	dodir "${MY_CGIBINDIR}"
+	dodir "${MY_ICONSDIR}"
+	dodir "${MY_ERRORSDIR}"
+	dodir "${MY_SQLSCRIPTSDIR}"
+	dodir "${MY_HOOKSCRIPTSDIR}"
+	dodir "${MY_SERVERCONFIGDIR}"
+}
+
 # ==============================================================================
 # EXPORTED FUNCTIONS
 # ==============================================================================
 
 # @FUNCTION: webapp_src_install
 # @DESCRIPTION:
-# You need to call this function in src_install() AFTER everything else has run.
-# For now, we just make sure that root owns everything, and that there are no
-# setuid files.
+# This is the default src_install(). For now, we just make sure that root owns
+# everything, and that there are no setuid files.
+#
+# You need to call this function AFTER everything else has run in your custom
+# src_install().
 webapp_src_install() {
 	chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${D}/"
 	chmod -R u-s "${D}/"
@@ -262,8 +315,12 @@
 
 # @FUNCTION: webapp_pkg_setup
 # @DESCRIPTION:
-# You need to call this function in pkg_config() AFTER everything else has run.
-# If 'vhosts' USE flag is not set, auto-install this app.
+# The default pkg_setup() for this eclass. This will gather required variables
+# from webapp-config and check if there is an application installed to
+# `${ROOT}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set.
+#
+# You need to call this function BEFORE anything else has run in your custom
+# pkg_setup().
 webapp_pkg_setup() {
 	# add sanity checks here
 
@@ -305,56 +362,14 @@
 	fi
 }
 
-webapp_getinstalltype() {
-	# or are we upgrading?
-
-	if ! use vhosts ; then
-		# we only run webapp-config if vhosts USE flag is not set
-
-		local my_output
-
-		my_output="$(webapp_check_installedat)"
-
-		if [ "${?}" = "0" ] ; then
-			# something is already installed there
-			#
-			# make sure it isn't the same version
-
-			local my_pn="$(echo ${my_output} | awk '{ print $1 }')"
-			local my_pvr="$(echo ${my_output} | awk '{ print $2 }')"
-
-			REMOVE_PKG="${my_pn}-${my_pvr}"
-
-			if [ "${my_pn}" == "${PN}" ]; then
-				if [ "${my_pvr}" != "${PVR}" ]; then
-					elog "This is an upgrade"
-					IS_UPGRADE=1
-				else
-					elog "This is a re-installation"
-					IS_REPLACE=1
-				fi
-			else
-				elog "${my_output} is installed there"
-			fi
-		else
-			elog "This is an installation"
-		fi
-	fi
-}
-
-webapp_src_preinst() {
-	# create the directories that we need
-
-	dodir "${MY_HTDOCSDIR}"
-	dodir "${MY_HOSTROOTDIR}"
-	dodir "${MY_CGIBINDIR}"
-	dodir "${MY_ICONSDIR}"
-	dodir "${MY_ERRORSDIR}"
-	dodir "${MY_SQLSCRIPTSDIR}"
-	dodir "${MY_HOOKSCRIPTSDIR}"
-	dodir "${MY_SERVERCONFIGDIR}"
-}
-
+# @FUNCTION: webapp_pkg_postinst
+# @DESCRIPTION:
+# The default pkg_postinst() for this eclass. This installs the web application to
+# `${ROOT}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set. Otherwise
+# display a short notice how to install this application with webapp-config.
+#
+# You need to call this function AFTER everything else has run in your custom
+# pkg_postinst().
 webapp_pkg_postinst() {
 	webapp_read_config
 
@@ -425,6 +440,11 @@
 	return 0
 }
 
+# @FUNCTION: webapp_pkg_prerm
+# @DESCRIPTION:
+# This is the default pkg_prerm() for this eclass. If USE=vhosts is not set
+# remove all installed copies of this web application. Otherwise instruct the
+# user to manually remove those copies.
 webapp_pkg_prerm() {
 	# remove any virtual installs that there are
 



-- 
gentoo-commits@lists.gentoo.org mailing list



             reply	other threads:[~2008-02-22 10:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-22 10:03 Benedikt Boehm (hollow) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-07-02 14:02 [gentoo-commits] gentoo-x86 commit in eclass: webapp.eclass Devan Franchini (twitch153)
2012-07-18 14:59 Anthony G. Basile (blueness)
2012-07-15 22:45 Doug Goldstein (cardoe)
2011-07-27  7:50 Fabio Erculiani (lxnay)
2011-07-26 19:25 Fabio Erculiani (lxnay)
2011-07-12  7:48 Fabio Erculiani (lxnay)
2011-05-19 12:05 Tomas Chvatal (scarabeus)
2010-05-09 22:32 Jeremy Olexa (darkside)
2008-03-23  0:11 Benedikt Boehm (hollow)
2008-03-04 18:54 Benedikt Boehm (hollow)
2008-03-04 18:44 Benedikt Boehm (hollow)
2008-03-04 18:41 Benedikt Boehm (hollow)
2008-02-23 23:54 Benedikt Boehm (hollow)
2008-02-22 15:33 Benedikt Boehm (hollow)
2008-02-22 14:59 Benedikt Boehm (hollow)
2008-02-22 14:44 Benedikt Boehm (hollow)
2008-02-22 14:33 Benedikt Boehm (hollow)
2008-02-22 14:27 Benedikt Boehm (hollow)
2008-02-22 14:06 Benedikt Boehm (hollow)
2008-02-22 13:53 Benedikt Boehm (hollow)
2008-02-22 13:44 Benedikt Boehm (hollow)
2008-02-22  9:33 Benedikt Boehm (hollow)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1JSUl1-0002hk-VD@stork.gentoo.org \
    --to=hollow@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox