Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 206973 | Differences between
and this patch

Collapse All | Expand All

(-)trac-current/app-admin/webapp-config/webapp-config-1.50.16-r2.ebuild (-2 / +10 lines)
Lines 22-27 Link Here
22
	cd "${S}"
22
	cd "${S}"
23
	epatch "${FILESDIR}"/${P}-apache-move.patch
23
	epatch "${FILESDIR}"/${P}-apache-move.patch
24
	epatch "${FILESDIR}"/${P}-baselayout2.patch
24
	epatch "${FILESDIR}"/${P}-baselayout2.patch
25
	epatch "${FILESDIR}"/${P}-gentoo-prefix.patch
26
	eprefixify \
27
		${S}/WebappConfig/config.py \
28
		${S}/WebappConfig/db.py \
29
		${S}/WebappConfig/sandbox.py \
30
		${S}/WebappConfig/wrapper.py \
31
		${S}/sbin/webapp-cleaner \
32
		${S}/config/webapp-config
25
}
33
}
26
34
27
src_install() {
35
src_install() {
Lines 31-37 Link Here
31
	# distutils does not provide for specifying two different script install
39
	# distutils does not provide for specifying two different script install
32
	# locations. Since we only install one script here the following should
40
	# locations. Since we only install one script here the following should
33
	# be ok
41
	# be ok
34
	distutils_src_install --install-scripts="/usr/sbin"
42
	distutils_src_install --install-scripts="${EPREFIX}/usr/sbin"
35
43
36
	dodir /etc/vhosts
44
	dodir /etc/vhosts
37
	cp config/webapp-config ${ED}/etc/vhosts/
45
	cp config/webapp-config ${ED}/etc/vhosts/
Lines 59-65 Link Here
59
pkg_postinst() {
67
pkg_postinst() {
60
	echo
68
	echo
61
	elog "Now that you have upgraded webapp-config, you **must** update your"
69
	elog "Now that you have upgraded webapp-config, you **must** update your"
62
	elog "config files in /etc/vhosts/webapp-config before you emerge any"
70
	elog "config files in ${EPREFIX}/etc/vhosts/webapp-config before you emerge any"
63
	elog "packages that use webapp-config."
71
	elog "packages that use webapp-config."
64
	echo
72
	echo
65
	epause 5
73
	epause 5
(-)trac-current/eclass/webapp.eclass (-41 / +43 lines)
Lines 1-6 Link Here
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/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/eclass/webapp.eclass,v 1.48 2007/01/03 20:16:39 rl03 Exp $
3
# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.48 2007/01/03 20:16:39 rl03 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
Lines 35-43 Link Here
35
35
36
INSTALL_CHECK_FILE="installed_by_webapp_eclass"
36
INSTALL_CHECK_FILE="installed_by_webapp_eclass"
37
37
38
ETC_CONFIG="${ROOT}/etc/vhosts/webapp-config"
38
ETC_CONFIG="${EROOT}/etc/vhosts/webapp-config"
39
WEBAPP_CONFIG="${ROOT}/usr/sbin/webapp-config"
39
WEBAPP_CONFIG="${EROOT}/usr/sbin/webapp-config"
40
WEBAPP_CLEANER="${ROOT}/usr/sbin/webapp-cleaner"
40
WEBAPP_CLEANER="${EROOT}/usr/sbin/webapp-cleaner"
41
41
42
# ------------------------------------------------------------------------
42
# ------------------------------------------------------------------------
43
# INTERNAL FUNCTION - USED BY THIS ECLASS ONLY
43
# INTERNAL FUNCTION - USED BY THIS ECLASS ONLY
Lines 134-140 Link Here
134
		MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
134
		MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
135
135
136
		elog "(config) ${MY_FILE}"
136
		elog "(config) ${MY_FILE}"
137
		echo "${MY_FILE}" >> ${D}/${WA_CONFIGLIST}
137
		echo "${MY_FILE}" >> ${ED}/${WA_CONFIGLIST#${EPREFIX}}
138
	done
138
	done
139
}
139
}
140
140
Lines 152-159 Link Here
152
	webapp_checkfileexists "${1}"
152
	webapp_checkfileexists "${1}"
153
153
154
	elog "(hook) ${1}"
154
	elog "(hook) ${1}"
155
	cp "${1}" "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")" || die "Unable to install ${1} into ${D}/${MY_HOOKSCRIPTSDIR}/"
155
	cp "${1}" "${ED}/${MY_HOOKSCRIPTSDIR#${EPREFIX}}/$(basename "${1}")" || 
156
	chmod 555 "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")"
156
		die "Unable to install ${1} into ${ED}/${MY_HOOKSCRIPTSDIR#${EPREFIX}}/"
157
	chmod 555 "${ED}/${MY_HOOKSCRIPTSDIR#${EPREFIX}}/$(basename "${1}")"
157
}
158
}
158
159
159
# ------------------------------------------------------------------------
160
# ------------------------------------------------------------------------
Lines 170-176 Link Here
170
	webapp_checkfileexists "${2}"
171
	webapp_checkfileexists "${2}"
171
172
172
	elog "(info) ${2} (lang: ${1})"
173
	elog "(info) ${2} (lang: ${1})"
173
	cp "${2}" "${D}/${MY_APPDIR}/postinst-${1}.txt"
174
	cp "${2}" "${ED}/${MY_APPDIR#${EPREFIX}}/postinst-${1}.txt"
174
}
175
}
175
176
176
# ------------------------------------------------------------------------
177
# ------------------------------------------------------------------------
Lines 187-193 Link Here
187
	webapp_checkfileexists "${2}"
188
	webapp_checkfileexists "${2}"
188
189
189
	elog "(info) ${2} (lang: ${1})"
190
	elog "(info) ${2} (lang: ${1})"
190
	cp "${2}" "${D}/${MY_APPDIR}/postupgrade-${1}.txt"
191
	cp "${2}" "${ED}/${MY_APPDIR#${EPREFIX}}/postupgrade-${1}.txt"
191
}
192
}
192
193
193
# ------------------------------------------------------------------------
194
# ------------------------------------------------------------------------
Lines 210-233 Link Here
210
	if [ "${1}" = "-R" ]; then
211
	if [ "${1}" = "-R" ]; then
211
		shift
212
		shift
212
		for m in "$@" ; do
213
		for m in "$@" ; do
213
			for a in $(find ${D}/${m}); do
214
			for a in $(find ${ED}/${m}); do
214
				a=${a/${D}\/\///}
215
				a=${a/${ED}\/\///}
215
				webapp_checkfileexists "${a}" "$D"
216
				webapp_checkfileexists "${a}" "${D}"
216
				local MY_FILE="$(webapp_strip_appdir "${a}")"
217
				local MY_FILE="$(webapp_strip_appdir "${a}")"
217
				MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
218
				MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
218
219
219
				elog "(server owned) ${MY_FILE}"
220
				elog "(server owned) ${MY_FILE}"
220
				echo "${MY_FILE}" >> "${D}/${WA_SOLIST}"
221
				echo "${MY_FILE}" >> "${ED}/${WA_SOLIST#${EPREFIX}}"
221
			done
222
			done
222
		done
223
		done
223
	else
224
	else
224
		for m in "$@" ; do
225
		for m in "$@" ; do
225
			webapp_checkfileexists "${m}" "$D"
226
			webapp_checkfileexists "${m}" "${D}"
226
			local MY_FILE="$(webapp_strip_appdir "${m}")"
227
			local MY_FILE="$(webapp_strip_appdir "${m}")"
227
			MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
228
			MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
228
229
229
			elog "(server owned) ${MY_FILE}"
230
			elog "(server owned) ${MY_FILE}"
230
			echo "${MY_FILE}" >> "${D}/${WA_SOLIST}"
231
			echo "${MY_FILE}" >> "${ED}/${WA_SOLIST#${EPREFIX}}"
231
		done
232
		done
232
	fi
233
	fi
233
}
234
}
Lines 266-272 Link Here
266
	# the other scripts that also rely upon these names
267
	# the other scripts that also rely upon these names
267
268
268
	elog "(${1}) config file '${my_file}'"
269
	elog "(${1}) config file '${my_file}'"
269
	cp "${2}" "${D}/${MY_SERVERCONFIGDIR}/${my_file}"
270
	cp "${2}" "${ED}/${MY_SERVERCONFIGDIR#${EPREFIX}}/${my_file}"
270
}
271
}
271
272
272
# ------------------------------------------------------------------------
273
# ------------------------------------------------------------------------
Lines 290-297 Link Here
290
	# scripts for specific database engines go into their own subdirectory
291
	# scripts for specific database engines go into their own subdirectory
291
	# just to keep things readable on the filesystem
292
	# just to keep things readable on the filesystem
292
293
293
	if [ ! -d "${D}/${MY_SQLSCRIPTSDIR}/${1}" ]; then
294
	if [ ! -d "${ED}/${MY_SQLSCRIPTSDIR#${EPREFIX}}/${1}" ]; then
294
		mkdir -p "${D}/${MY_SQLSCRIPTSDIR}/${1}" || die "unable to create directory ${D}/${MY_SQLSCRIPTSDIR}/${1}"
295
		mkdir -p "${ED}/${MY_SQLSCRIPTSDIR#${EPREFIX}}/${1}" || \
296
			die "unable to create directory ${ED}/${MY_SQLSCRIPTSDIR#${EPREFIX}}/${1}"
295
	fi
297
	fi
296
298
297
	# warning:
299
	# warning:
Lines 303-315 Link Here
303
	if [ -n "${3}" ]; then
305
	if [ -n "${3}" ]; then
304
		# yes we are
306
		# yes we are
305
		elog "(${1}) upgrade script from ${PN}-${PVR} to ${3}"
307
		elog "(${1}) upgrade script from ${PN}-${PVR} to ${3}"
306
		cp "${2}" "${D}${MY_SQLSCRIPTSDIR}/${1}/${3}_to_${PVR}.sql"
308
		cp "${2}" "${ED}${MY_SQLSCRIPTSDIR#${EPREFIX}}/${1}/${3}_to_${PVR}.sql"
307
		chmod 600 "${D}${MY_SQLSCRIPTSDIR}/${1}/${3}_to_${PVR}.sql"
309
		chmod 600 "${ED}${MY_SQLSCRIPTSDIR#${EPREFIX}}/${1}/${3}_to_${PVR}.sql"
308
	else
310
	else
309
		# no, we are not
311
		# no, we are not
310
		elog "(${1}) create script for ${PN}-${PVR}"
312
		elog "(${1}) create script for ${PN}-${PVR}"
311
		cp "${2}" "${D}/${MY_SQLSCRIPTSDIR}/${1}/${PVR}_create.sql"
313
		cp "${2}" "${ED}/${MY_SQLSCRIPTSDIR#${EPREFIX}}/${1}/${PVR}_create.sql"
312
		chmod 600 "${D}/${MY_SQLSCRIPTSDIR}/${1}/${PVR}_create.sql"
314
		chmod 600 "${ED}/${MY_SQLSCRIPTSDIR#${EPREFIX}}/${1}/${PVR}_create.sql"
313
	fi
315
	fi
314
}
316
}
315
317
Lines 323-335 Link Here
323
325
324
function webapp_src_install ()
326
function webapp_src_install ()
325
{
327
{
326
	chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${D}/"
328
	#chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${ED}/"
327
	chmod -R u-s "${D}/"
329
	chmod -R u-s "${ED}/"
328
	chmod -R g-s "${D}/"
330
	chmod -R g-s "${ED}/"
329
331
330
	keepdir "${MY_PERSISTDIR}"
332
	keepdir "${MY_PERSISTDIR#${EPREFIX}}"
331
	fowners "root:0" "${MY_PERSISTDIR}"
333
	fowners "root:0" "${MY_PERSISTDIR#${EPREFIX}}"
332
	fperms 755 "${MY_PERSISTDIR}"
334
	fperms 755 "${MY_PERSISTDIR#${EPREFIX}}"
333
335
334
	# to test whether or not the ebuild has correctly called this function
336
	# to test whether or not the ebuild has correctly called this function
335
	# we add an empty file to the filesystem
337
	# we add an empty file to the filesystem
Lines 338-344 Link Here
338
	# no longer rely on Portage calling both webapp_src_install() and
340
	# no longer rely on Portage calling both webapp_src_install() and
339
	# webapp_pkg_postinst() within the same shell process
341
	# webapp_pkg_postinst() within the same shell process
340
342
341
	touch "${D}/${MY_APPDIR}/${INSTALL_CHECK_FILE}"
343
	touch "${ED}/${MY_APPDIR#${EPREFIX}}/${INSTALL_CHECK_FILE}"
342
}
344
}
343
345
344
# ------------------------------------------------------------------------
346
# ------------------------------------------------------------------------
Lines 367-373 Link Here
367
	# non-webapp-config solution?
369
	# non-webapp-config solution?
368
370
369
	if ! use vhosts ; then
371
	if ! use vhosts ; then
370
		local my_dir="${ROOT}${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}"
372
		local my_dir="${EROOT}${VHOST_ROOT}/${MY_HTDOCSBASE#${EPREFIX}}/${PN}"
371
		local my_output
373
		local my_output
372
374
373
		if [ -d "${my_dir}" ] ; then
375
		if [ -d "${my_dir}" ] ; then
Lines 433-446 Link Here
433
{
435
{
434
	# create the directories that we need
436
	# create the directories that we need
435
437
436
	dodir "${MY_HTDOCSDIR}"
438
	dodir "${MY_HTDOCSDIR#${EPREFIX}}"
437
	dodir "${MY_HOSTROOTDIR}"
439
	dodir "${MY_HOSTROOTDIR#${EPREFIX}}"
438
	dodir "${MY_CGIBINDIR}"
440
	dodir "${MY_CGIBINDIR#${EPREFIX}}"
439
	dodir "${MY_ICONSDIR}"
441
	dodir "${MY_ICONSDIR#${EPREFIX}}"
440
	dodir "${MY_ERRORSDIR}"
442
	dodir "${MY_ERRORSDIR#${EPREFIX}}"
441
	dodir "${MY_SQLSCRIPTSDIR}"
443
	dodir "${MY_SQLSCRIPTSDIR#${EPREFIX}}"
442
	dodir "${MY_HOOKSCRIPTSDIR}"
444
	dodir "${MY_HOOKSCRIPTSDIR#${EPREFIX}}"
443
	dodir "${MY_SERVERCONFIGDIR}"
445
	dodir "${MY_SERVERCONFIGDIR#${EPREFIX}}"
444
}
446
}
445
447
446
function webapp_pkg_postinst ()
448
function webapp_pkg_postinst ()
Lines 449-455 Link Here
449
451
450
	# sanity checks, to catch bugs in the ebuild
452
	# sanity checks, to catch bugs in the ebuild
451
453
452
	if [ ! -f "${ROOT}${MY_APPDIR}/${INSTALL_CHECK_FILE}" ]; then
454
	if [ ! -f "${EROOT}${MY_APPDIR#${EPREFIX}}/${INSTALL_CHECK_FILE}" ]; then
453
		eerror
455
		eerror
454
		eerror "This ebuild did not call webapp_src_install() at the end"
456
		eerror "This ebuild did not call webapp_src_install() at the end"
455
		eerror "of the src_install() function"
457
		eerror "of the src_install() function"
Lines 463-469 Link Here
463
	fi
465
	fi
464
466
465
	# if 'vhosts' is not set in your USE flags, we install a copy of
467
	# if 'vhosts' is not set in your USE flags, we install a copy of
466
	# this application in ${ROOT}/var/www/localhost/htdocs/${PN}/ for you
468
	# this application in ${EROOT}/var/www/localhost/htdocs/${PN}/ for you
467
469
468
	if ! use vhosts ; then
470
	if ! use vhosts ; then
469
		echo
471
		echo
(-)trac-current/www-apps/trac/trac-0.10.4.ebuild (-3 / +9 lines)
Lines 105-110 Link Here
105
	webapp_pkg_setup
105
	webapp_pkg_setup
106
}
106
}
107
107
108
src_unpack() {
109
	unpack "${A}"
110
	cd ${S}
111
	epatch ${FILESDIR}/${P}-sqlite-backend.patch
112
}
113
108
src_install () {
114
src_install () {
109
	# project environments might go in here
115
	# project environments might go in here
110
	keepdir /var/lib/trac
116
	keepdir /var/lib/trac
Lines 122-131 Link Here
122
	# if needed, install cgi/fcgi scripts for webapp-config
128
	# if needed, install cgi/fcgi scripts for webapp-config
123
	local my_dir=${ED}/usr/share/trac
129
	local my_dir=${ED}/usr/share/trac
124
	if use cgi ; then
130
	if use cgi ; then
125
		mv ${my_dir}/cgi-bin/trac.cgi ${ED}${MY_CGIBINDIR} || die
131
		mv ${my_dir}/cgi-bin/trac.cgi ${ED}${MY_CGIBINDIR#${EPREFIX}} || die
126
	fi
132
	fi
127
	if use fastcgi ; then
133
	if use fastcgi ; then
128
		mv ${my_dir}/cgi-bin/trac.fcgi ${ED}${MY_CGIBINDIR} || die
134
		mv ${my_dir}/cgi-bin/trac.fcgi ${ED}${MY_CGIBINDIR#${EPREFIX}} || die
129
	fi
135
	fi
130
	rm -rf ${my_dir}/cgi-bin || die
136
	rm -rf ${my_dir}/cgi-bin || die
131
137
Lines 134-140 Link Here
134
	done
140
	done
135
141
136
	# copy graphics, css & js
142
	# copy graphics, css & js
137
	cp -r htdocs/* ${ED}/${MY_HTDOCSDIR}
143
	cp -r htdocs/* ${ED}/${MY_HTDOCSDIR#${EPREFIX}}
138
144
139
	webapp_src_install
145
	webapp_src_install
140
146

Return to bug 206973