| 1 | # Copyright 2004 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2005 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License, v2 or later |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # Author Michael Tindal <mtindal@gmail.com> |
|
|
| 4 | # $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.8 2005/01/21 00:00:53 trapni Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.23 2005/09/19 00:03:55 vericgar Exp $ |
| 5 | ECLASS=depend.apache |
4 | |
| 6 | INHERITED="$INHERITED $ECLASS" |
5 | inherit multilib |
| 7 | |
6 | |
| 8 | ###### |
7 | ###### |
| 9 | ## Apache Common Variables |
8 | ## Apache Common Variables |
| 10 | ## |
9 | ## |
| 11 | ## These are internal variables used by this, and other apache-related eclasses, |
10 | ## These are internal variables used by this, and other apache-related eclasses, |
| … | |
… | |
| 16 | #### |
15 | #### |
| 17 | ## APACHE_VERSION |
16 | ## APACHE_VERSION |
| 18 | ## |
17 | ## |
| 19 | ## Stores the version of apache we are going to be ebuilding. This variable is |
18 | ## Stores the version of apache we are going to be ebuilding. This variable is |
| 20 | ## set by the need_apache{|1|2} functions. |
19 | ## set by the need_apache{|1|2} functions. |
|
|
20 | ## |
|
|
21 | ## This needs to stay as '1' until apache2 is on by default -- although it |
|
|
22 | ## doesn't matter much as it's set by the need_apache functions. |
| 21 | #### |
23 | #### |
| 22 | APACHE_VERSION='2' |
24 | APACHE_VERSION='1' |
| 23 | |
25 | |
| 24 | #### |
26 | #### |
| 25 | ## APXS1, APXS2 |
27 | ## APXS1, APXS2 |
| 26 | ## |
28 | ## |
| 27 | ## Paths to the apxs tools |
29 | ## Paths to the apxs tools |
| … | |
… | |
| 40 | #### |
42 | #### |
| 41 | ## APACHE1_BASEDIR, APACHE2_BASEDIR |
43 | ## APACHE1_BASEDIR, APACHE2_BASEDIR |
| 42 | ## |
44 | ## |
| 43 | ## Paths to the server root directories |
45 | ## Paths to the server root directories |
| 44 | #### |
46 | #### |
|
|
47 | #APACHE1_BASEDIR="/usr/$(get_libdir)/apache" |
|
|
48 | #APACHE2_BASEDIR="/usr/$(get_libdir)/apache2" |
| 45 | APACHE1_BASEDIR="/usr/lib/apache" |
49 | APACHE1_BASEDIR="/usr/lib/apache" |
| 46 | APACHE2_BASEDIR="/usr/lib/apache2" |
50 | APACHE2_BASEDIR="/usr/lib/apache2" |
| 47 | |
51 | |
| 48 | #### |
52 | #### |
| 49 | ## APACHE1_CONFDIR, APACHE2_CONFDIR |
53 | ## APACHE1_CONFDIR, APACHE2_CONFDIR |
| … | |
… | |
| 61 | #### |
65 | #### |
| 62 | APACHE1_MODULES_CONFDIR="${APACHE1_CONFDIR}/modules.d" |
66 | APACHE1_MODULES_CONFDIR="${APACHE1_CONFDIR}/modules.d" |
| 63 | APACHE2_MODULES_CONFDIR="${APACHE2_CONFDIR}/modules.d" |
67 | APACHE2_MODULES_CONFDIR="${APACHE2_CONFDIR}/modules.d" |
| 64 | |
68 | |
| 65 | #### |
69 | #### |
| 66 | ## APACHE1_MODULES_VHOSTDIR, APACHE2_MODULES_VHOSTDIR |
70 | ## APACHE1_VHOSTDIR, APACHE2_VHOSTDIR |
| 67 | ## |
71 | ## |
| 68 | ## Paths where virtual host configuration files are kept |
72 | ## Paths where virtual host configuration files are kept |
| 69 | #### |
73 | #### |
| 70 | APACHE1_VHOSTDIR="${APACHE1_CONFDIR}/vhosts.d" |
74 | APACHE1_VHOSTDIR="${APACHE1_CONFDIR}/vhosts.d" |
| 71 | APACHE2_VHOSTDIR="${APACHE2_CONFDIR}/vhosts.d" |
75 | APACHE2_VHOSTDIR="${APACHE2_CONFDIR}/vhosts.d" |
| … | |
… | |
| 80 | |
84 | |
| 81 | #### |
85 | #### |
| 82 | ## APACHE1_DEPEND, APACHE2_DEPEND |
86 | ## APACHE1_DEPEND, APACHE2_DEPEND |
| 83 | ## |
87 | ## |
| 84 | ## Dependencies for apache 1.x and apache 2.x |
88 | ## Dependencies for apache 1.x and apache 2.x |
| 85 | ## |
|
|
| 86 | ## apache2 must be at least version 2.0.52-r3, this is lowest version |
89 | ## - apache2 must be at least version 2.0.54-r30, this is lowest version |
| 87 | ## containing our new overall changes -- trapni (Jan 21 2005) |
90 | ## containing our new overall changes -- trapni (Jan 21 2005) |
| 88 | ## apache1 must be at least version 1.3.33-r1, but how to |
91 | ## - apache1 must be at least version 1.3.33-r10, but how to |
| 89 | ## define the DEPEND here? (FIXME) -- trapni (Jan 21 2005) |
92 | ## define the DEPEND here? (FIXME) -- trapni (Jan 21 2005) |
|
|
93 | ## - currently not possible - bug #4315 -- vericgar (Jan 21 2005) |
| 90 | #### |
94 | #### |
| 91 | APACHE1_DEPEND="=net-www/apache-1*" |
95 | APACHE1_DEPEND="=net-www/apache-1*" |
| 92 | APACHE2_DEPEND=">=net-www/apache-2.0.52-r3" |
96 | APACHE2_DEPEND=">=net-www/apache-2.0.54-r30" |
|
|
97 | |
|
|
98 | #### |
|
|
99 | ## APACHE_DEPEND |
|
|
100 | ## |
|
|
101 | ## Dependency magic based on useflags to use the right DEPEND |
|
|
102 | #### |
|
|
103 | |
|
|
104 | NEED_APACHE_DEPEND="apache2? ( ${APACHE2_DEPEND} ) !apache2? ( ${APACHE1_DEPEND} )" |
|
|
105 | WANT_APACHE_DEPEND="apache2? ( ${APACHE2_DEPEND} ) !apache2? ( apache? ( ${APACHE1_DEPEND} ) )" |
|
|
106 | |
|
|
107 | #### |
|
|
108 | # uses_apache1() |
|
|
109 | # |
|
|
110 | # sets up all of the environment variables required by an apache1 module |
|
|
111 | #### |
|
|
112 | |
|
|
113 | uses_apache1() { |
|
|
114 | APACHE_VERSION='1' |
|
|
115 | APXS="$APXS1" |
|
|
116 | USE_APACHE2= |
|
|
117 | APACHECTL="${APACHECTL1}" |
|
|
118 | APACHE_BASEDIR="${APACHE1_BASEDIR}" |
|
|
119 | APACHE_CONFDIR="${APACHE1_CONFDIR}" |
|
|
120 | APACHE_MODULES_CONFDIR="${APACHE1_MODULES_CONFDIR}" |
|
|
121 | APACHE_VHOSTSDIR="${APACHE1_VHOSTSDIR}" |
|
|
122 | APACHE_MODULESDIR="${APACHE1_MODULESDIR}" |
|
|
123 | } |
|
|
124 | |
|
|
125 | #### |
|
|
126 | # uses_apache2() |
|
|
127 | # |
|
|
128 | # sets up all of the environment variables required by an apache2 module |
|
|
129 | #### |
|
|
130 | |
|
|
131 | uses_apache2() { |
|
|
132 | APACHE_VERSION='2' |
|
|
133 | USE_APACHE2=2 |
|
|
134 | APXS="$APXS2" |
|
|
135 | APACHECTL="${APACHECTL2}" |
|
|
136 | APACHE_BASEDIR="${APACHE2_BASEDIR}" |
|
|
137 | APACHE_CONFDIR="${APACHE2_CONFDIR}" |
|
|
138 | APACHE_MODULES_CONFDIR="${APACHE2_MODULES_CONFDIR}" |
|
|
139 | APACHE_VHOSTSDIR="${APACHE2_VHOSTSDIR}" |
|
|
140 | APACHE_MODULESDIR="${APACHE2_MODULESDIR}" |
|
|
141 | } |
|
|
142 | |
|
|
143 | doesnt_use_apache() { |
|
|
144 | APACHE_VERSION='0' |
|
|
145 | USE_APACHE= |
|
|
146 | } |
| 93 | |
147 | |
| 94 | #### |
148 | #### |
| 95 | ## need_apache1 |
149 | ## need_apache1 |
| 96 | ## |
150 | ## |
| 97 | ## An ebuild calls this to get the dependency information |
151 | ## An ebuild calls this to get the dependency information |
| … | |
… | |
| 102 | #### |
156 | #### |
| 103 | need_apache1() { |
157 | need_apache1() { |
| 104 | debug-print-function need_apache1 |
158 | debug-print-function need_apache1 |
| 105 | |
159 | |
| 106 | DEPEND="${DEPEND} ${APACHE1_DEPEND}" |
160 | DEPEND="${DEPEND} ${APACHE1_DEPEND}" |
|
|
161 | RDEPEND="${RDEPEND} ${APACHE1_DEPEND}" |
| 107 | APACHE_VERSION='1' |
162 | APACHE_VERSION='1' |
| 108 | } |
163 | } |
| 109 | |
164 | |
| 110 | #### |
165 | #### |
| 111 | ## need_apache2 |
166 | ## need_apache2 |
| … | |
… | |
| 118 | #### |
173 | #### |
| 119 | need_apache2() { |
174 | need_apache2() { |
| 120 | debug-print-function need_apache2 |
175 | debug-print-function need_apache2 |
| 121 | |
176 | |
| 122 | DEPEND="${DEPEND} ${APACHE2_DEPEND}" |
177 | DEPEND="${DEPEND} ${APACHE2_DEPEND}" |
|
|
178 | RDEPEND="${RDEPEND} ${APACHE2_DEPEND}" |
| 123 | APACHE_VERSION='2' |
179 | APACHE_VERSION='2' |
| 124 | } |
180 | } |
| 125 | |
181 | |
|
|
182 | #### |
|
|
183 | ## DO NOT CHANGE THIS FUNCTION UNLESS YOU UNDERSTAND THE CONSEQUENCES IT |
|
|
184 | ## WILL HAVE ON THE CACHE! There MUST be a apache2? () block in DEPEND for |
|
|
185 | ## things to work correct in the dependency calculation stage. |
|
|
186 | #### |
| 126 | need_apache() { |
187 | need_apache() { |
| 127 | debug-print-function need_apache |
188 | debug-print-function need_apache |
| 128 | |
189 | |
| 129 | IUSE="${IUSE} apache2" |
190 | IUSE="${IUSE} apache2" |
|
|
191 | DEPEND="${DEPEND} ${NEED_APACHE_DEPEND}" |
|
|
192 | RDEPEND="${RDEPEND} ${NEED_APACHE_DEPEND}" |
| 130 | if useq apache2; then |
193 | if useq apache2; then |
| 131 | need_apache2 |
194 | uses_apache2 |
| 132 | else |
195 | else |
| 133 | need_apache1 |
196 | uses_apache1 |
| 134 | fi |
197 | fi |
| 135 | } |
198 | } |
| 136 | |
199 | |
|
|
200 | want_apache() { |
|
|
201 | debug-print-function want_apache |
|
|
202 | |
|
|
203 | IUSE="${IUSE} apache apache2" |
|
|
204 | DEPEND="${DEPEND} ${WANT_APACHE_DEPEND}" |
|
|
205 | RDEPEND="${DEPEND} ${WANT_APACHE_DEPEND}" |
|
|
206 | if useq apache2 ; then |
|
|
207 | uses_apache2 |
|
|
208 | elif useq apache ; then |
|
|
209 | uses_apache1 |
|
|
210 | else |
|
|
211 | doesnt_use_apache |
|
|
212 | fi |
|
|
213 | } |