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

Diff of /eclass/webapp.eclass

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

Revision 1.38 Revision 1.41
1# Copyright 1999-2005 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.38 2006/01/01 01:14:59 swegener Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.41 2006/05/19 19:24:21 flameeyes 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
9# 9#
10# Author(s) Stuart Herbert <stuart@gentoo.org> 10# Author(s) Stuart Herbert <stuart@gentoo.org>
11# Renat Lumpau <rl03@gentoo.org> 11# Renat Lumpau <rl03@gentoo.org>
12# Gunnar Wrobel <php@gunnarwrobel.org> 12# Gunnar Wrobel <wrobel@gentoo.org>
13# 13#
14# ------------------------------------------------------------------------ 14# ------------------------------------------------------------------------
15# 15#
16# The master copy of this eclass is held in our subversion repository. 16# The master copy of this eclass is held in our subversion repository.
17# http://svn.gnqs.org/projects/vhost-tools/browser/ 17# http://svn.gnqs.org/projects/vhost-tools/browser/
123# @param $1 - config file 123# @param $1 - config file
124# ------------------------------------------------------------------------ 124# ------------------------------------------------------------------------
125 125
126function webapp_configfile () 126function webapp_configfile ()
127{ 127{
128 local m=""
129 for m in "$@" ; do
128 webapp_checkfileexists "${1}" "${D}" 130 webapp_checkfileexists "${m}" "${D}"
129 131
130 local MY_FILE="$(webapp_strip_appdir ${1})" 132 local MY_FILE="$(webapp_strip_appdir "${m}")"
131 MY_FILE="$(webapp_strip_cwd ${MY_FILE})" 133 MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
132 134
133 einfo "(config) ${MY_FILE}" 135 einfo "(config) ${MY_FILE}"
134 echo "${MY_FILE}" >> ${D}/${WA_CONFIGLIST} 136 echo "${MY_FILE}" >> ${D}/${WA_CONFIGLIST}
137 done
135} 138}
136 139
137# ------------------------------------------------------------------------ 140# ------------------------------------------------------------------------
138# EXPORTED FUNCTION - FOR USE IN EBUILDS 141# EXPORTED FUNCTION - FOR USE IN EBUILDS
139# 142#
146function webapp_hook_script () 149function webapp_hook_script ()
147{ 150{
148 webapp_checkfileexists "${1}" 151 webapp_checkfileexists "${1}"
149 152
150 einfo "(hook) ${1}" 153 einfo "(hook) ${1}"
151 cp "${1}" "${D}/${MY_HOOKSCRIPTSDIR}/$(basename ${1})" || die "Unable to install ${1} into ${D}/${MY_HOOKSCRIPTSDIR}/" 154 cp "${1}" "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")" || die "Unable to install ${1} into ${D}/${MY_HOOKSCRIPTSDIR}/"
152 chmod 555 "${D}/${MY_HOOKSCRIPTSDIR}/$(basename ${1})" 155 chmod 555 "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")"
153} 156}
154 157
155# ------------------------------------------------------------------------ 158# ------------------------------------------------------------------------
156# EXPORTED FUNCTION - FOR USE IN EBUILDS 159# EXPORTED FUNCTION - FOR USE IN EBUILDS
157# 160#
199# 202#
200# ------------------------------------------------------------------------ 203# ------------------------------------------------------------------------
201 204
202function webapp_serverowned () 205function webapp_serverowned ()
203{ 206{
207 local a=""
208 local m=""
209 if [ "${1}" = "-R" ]; then
210 shift
211 for m in "$@" ; do
212 for a in $(find ${D}/${m}); do
213 a=${a/${D}\/\///}
214 webapp_checkfileexists "${a}" "$D"
215 local MY_FILE="$(webapp_strip_appdir "${a}")"
216 MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
217
218 einfo "(server owned) ${MY_FILE}"
219 echo "${MY_FILE}" >> "${D}/${WA_SOLIST}"
220 done
221 done
222 else
223 for m in "$@" ; do
204 webapp_checkfileexists "${1}" "$D" 224 webapp_checkfileexists "${m}" "$D"
205 local MY_FILE="$(webapp_strip_appdir ${1})" 225 local MY_FILE="$(webapp_strip_appdir "${m}")"
206 MY_FILE="$(webapp_strip_cwd ${MY_FILE})" 226 MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
207 227
208 einfo "(server owned) ${MY_FILE}" 228 einfo "(server owned) ${MY_FILE}"
209 echo "${MY_FILE}" >> "${D}/${WA_SOLIST}" 229 echo "${MY_FILE}" >> "${D}/${WA_SOLIST}"
230 done
231 fi
210} 232}
211 233
212# ------------------------------------------------------------------------ 234# ------------------------------------------------------------------------
213# EXPORTED FUNCTION - FOR USE IN EBUILDS 235# EXPORTED FUNCTION - FOR USE IN EBUILDS
214# 236#
230 # sort out what the name will be of the config file 252 # sort out what the name will be of the config file
231 253
232 local my_file 254 local my_file
233 255
234 if [ -z "${3}" ]; then 256 if [ -z "${3}" ]; then
235 my_file="${1}-$(basename ${2})" 257 my_file="${1}-$(basename "${2}")"
236 else 258 else
237 my_file="${1}-${3}" 259 my_file="${1}-${3}"
238 fi 260 fi
239 261
240 # warning: 262 # warning:
303 chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${D}/" 325 chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${D}/"
304 chmod -R u-s "${D}/" 326 chmod -R u-s "${D}/"
305 chmod -R g-s "${D}/" 327 chmod -R g-s "${D}/"
306 328
307 keepdir "${MY_PERSISTDIR}" 329 keepdir "${MY_PERSISTDIR}"
308 fowners "root:root" "${MY_PERSISTDIR}" 330 fowners "root:0" "${MY_PERSISTDIR}"
309 fperms 755 "${MY_PERSISTDIR}" 331 fperms 755 "${MY_PERSISTDIR}"
310 332
311 # to test whether or not the ebuild has correctly called this function 333 # to test whether or not the ebuild has correctly called this function
312 # we add an empty file to the filesystem 334 # we add an empty file to the filesystem
313 # 335 #

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.41

  ViewVC Help
Powered by ViewVC 1.1.20