| 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/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.46 2006/12/25 08:07:06 zmedico Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.47 2006/12/31 19:16:31 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 |
| 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 |
| 11 | # Renat Lumpau <rl03@gentoo.org> |
11 | # Renat Lumpau <rl03@gentoo.org> |
| 12 | # Gunnar Wrobel <wrobel@gentoo.org> |
12 | # Gunnar Wrobel <wrobel@gentoo.org> |
| 13 | # |
13 | # |
| 14 | # ------------------------------------------------------------------------ |
14 | # ------------------------------------------------------------------------ |
| 15 | # |
15 | # |
| … | |
… | |
| 22 | # |
22 | # |
| 23 | # ------------------------------------------------------------------------ |
23 | # ------------------------------------------------------------------------ |
| 24 | |
24 | |
| 25 | SLOT="${PVR}" |
25 | SLOT="${PVR}" |
| 26 | IUSE="vhosts" |
26 | IUSE="vhosts" |
| 27 | DEPEND="app-admin/webapp-config" |
27 | DEPEND=">=app-admin/webapp-config-1.50.15" |
| 28 | RDEPEND="${DEPEND}" |
28 | RDEPEND="${DEPEND}" |
| 29 | |
29 | |
| 30 | EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm |
30 | EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm |
| 31 | |
31 | |
| 32 | INSTALL_DIR="/${PN}" |
32 | INSTALL_DIR="/${PN}" |
| … | |
… | |
| 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="${ROOT}/etc/vhosts/webapp-config" |
| 39 | WEBAPP_CONFIG="${ROOT}/usr/sbin/webapp-config" |
39 | WEBAPP_CONFIG="${ROOT}/usr/sbin/webapp-config" |
|
|
40 | WEBAPP_CLEANER="${ROOT}/usr/sbin/webapp-cleaner" |
| 40 | |
41 | |
| 41 | # ------------------------------------------------------------------------ |
42 | # ------------------------------------------------------------------------ |
| 42 | # INTERNAL FUNCTION - USED BY THIS ECLASS ONLY |
43 | # INTERNAL FUNCTION - USED BY THIS ECLASS ONLY |
| 43 | # |
44 | # |
| 44 | # Load the config file /etc/vhosts/webapp-config |
45 | # Load the config file /etc/vhosts/webapp-config |
| … | |
… | |
| 486 | |
487 | |
| 487 | my_cmd="${WEBAPP_CONFIG} ${my_mode} -h localhost -u root -d ${INSTALL_DIR} ${PN} ${PVR}" |
488 | my_cmd="${WEBAPP_CONFIG} ${my_mode} -h localhost -u root -d ${INSTALL_DIR} ${PN} ${PVR}" |
| 488 | elog "Running ${my_cmd}" |
489 | elog "Running ${my_cmd}" |
| 489 | ${my_cmd} |
490 | ${my_cmd} |
| 490 | |
491 | |
| 491 | # remove the old version |
492 | # run webapp-cleaner instead of emerge |
| 492 | # |
493 | echo |
| 493 | # why do we do this? well ... |
494 | local cleaner="${WEBAPP_CLEANER} -p -C ${PN}" |
| 494 | # |
495 | einfo "Running ${cleaner}" |
| 495 | # normally, emerge -u installs a new version and then removes the |
496 | ${cleaner} |
| 496 | # old version. however, if the new version goes into a different |
|
|
| 497 | # slot to the old version, then the old version gets left behind |
|
|
| 498 | # |
|
|
| 499 | # if USE=-vhosts, then we want to remove the old version, because |
|
|
| 500 | # the user is relying on portage to do the magical thing for it |
|
|
| 501 | |
|
|
| 502 | if [ "${IS_UPGRADE}" = "1" ] ; then |
|
|
| 503 | elog "Removing old version ${REMOVE_PKG}" |
|
|
| 504 | ewarn "This action may result in a deadlock. Please refer to" |
|
|
| 505 | ewarn "http://bugs.gentoo.org/show_bug.cgi?id=124440 for more information." |
|
|
| 506 | |
|
|
| 507 | emerge -C "${REMOVE_PKG}" |
|
|
| 508 | fi |
|
|
| 509 | else |
497 | else |
| 510 | # vhosts flag is on |
498 | # vhosts flag is on |
| 511 | # |
499 | # |
| 512 | # let's tell the administrator what to do next |
500 | # let's tell the administrator what to do next |
| 513 | |
501 | |