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

Contents of /eclass/webapp-apache.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.30 - (show annotations) (download)
Mon Nov 30 04:19:36 2009 UTC (4 years, 9 months ago) by abcd
Branch: MAIN
CVS Tags: HEAD
Changes since 1.29: +1 -1 lines
FILE REMOVED
Remove eclasses that have been marked as deprecated for >=2 years; schedule other deprecated eclasses for removal

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/webapp-apache.eclass,v 1.29 2007/07/29 16:37:20 phreak Exp $
4 #
5 # Author: Stuart Herbert <stuart@gentoo.org>
6 #
7 # Based on discussions held on gentoo-dev mailing list, and a bug report
8 # contributed by Ian Leitch <port001@w0r.mine.nu> in bug #14870,
9 # and robbat2's mod_php ebuild
10 #
11 # This package will be offically deprecated when vhost-config and
12 # webapp-config from GLEP11 are released.
13
14 IUSE="apache2"
15 DEPEND="${DEPEND} www-servers/apache"
16
17 EXPORT_FUNCTIONS pkg_setup
18
19 # NOTE:
20 #
21 # It is deliberate that the functions in this eclass are called
22 # 'webapp-xxx' rather than 'webapp-apache-xxx'. This ensures
23 # that we can drop in eclasses for other web servers without
24 # having to change the ebuilds!
25
26 function webapp-apache-detect ()
27 {
28 APACHEVER=
29 has_version '=www-servers/apache-2*' && APACHEVER=2 && CONFVER=2
30 [ -z "${APACHEVER}" ] && has_version '=www-servers/apache-2*' && APACHEVER=2 && CONFVER=2
31
32 if [ "${APACHEVER}+" = "+" ]; then
33 # no apache version detected
34 return 1
35 fi
36
37 APACHECONF="/etc/apache${CONFVER}/conf/apache${CONFVER}.conf"
38 APACHECONF_COMMON="/etc/apache${CONFVER}/conf/commonapache${CONFVER}.conf"
39 APACHECONF_DIR="/etc/apache${CONFVER}/conf/"
40 WEBAPP_SERVER="Apache v${APACHEVER}"
41 }
42
43 # run the function, so we know which version of apache we are using
44
45 function webapp-detect () {
46 webapp-apache-detect || return 1
47 webapp-determine-installowner
48 webapp-determine-htdocsdir
49 webapp-determine-cgibindir
50
51 # explicit return here to ensure the return code
52 # from webapp-determine-cgibindir above isn't returned instead
53
54 return 0
55 }
56
57 function webapp-mkdirs () {
58 webapp-determine-htdocsdir
59 webapp-determine-cgibindir
60
61 keepdir "$HTTPD_ROOT"
62 fowners "$HTTPD_USER":"$HTTPD_GROUP" "$HTTPD_ROOT"
63 fperms 755 "$HTTPD_ROOT"
64
65 # explicit return here to ensure the return code
66 # from above isn't returned instead
67
68 return 0
69 }
70
71 function webapp-determine-htdocsdir ()
72 {
73 webapp-determine-installowner
74
75 # HTTPD_ROOT="`grep '^DocumentRoot' ${APACHECONF} | cut -d ' ' -f 2`"
76 # [ -z "${HTTPD_ROOT}" ] && HTTPD_ROOT="/home/httpd/htdocs/"
77 # temporary fix for webapps
78 HTTPD_ROOT="/var/www/localhost/htdocs/"
79 }
80
81 function webapp-determine-cgibindir ()
82 {
83 #HTTPD_CGIBIN="`grep 'ScriptAlias /cgi-bin/' ${APACHECONF_COMMON} | cut -d ' ' -f 7`"
84 #[ -z "${HTTPD_CGIBIN}" ] && HTTPD_CGIBIN="/home/httpd/cgi-bin/"
85 # temporary fix for webapps
86 HTTPD_CGIBIN="/var/www/localhost/cgi-bin/"
87 }
88
89 function webapp-determine-installowner ()
90 {
91 HTTPD_USER="apache"
92 HTTPD_GROUP="apache"
93 }
94
95
96 function webapp-pkg_setup ()
97 {
98 if [ "$1" == "1" ]; then
99 msg="I couldn't find an installation of Apache"
100 eerror "${msg}"
101 die "${msg}"
102 fi
103
104 ewarn "Ebuilds (like this one) that use the webapp-apache.eclass need to"
105 ewarn "be converted to use the new webapp.eclass, to be compatible with"
106 ewarn "webapp-config."
107 ewarn
108 ewarn "Please file a bug on http://bugs.gentoo.org/, stating that this"
109 ewarn "ebuild needs converting to use the new approach."
110 }

  ViewVC Help
Powered by ViewVC 1.1.20