1 |
hollow 07/11/25 14:27:53 |
2 |
|
3 |
Modified: depend.apache.eclass apache-module.eclass |
4 |
Log: |
5 |
remove deprecated apache1 functions; remove bogus need_apache logic; convert to standardized documentation comments |
6 |
|
7 |
Revision Changes Path |
8 |
1.35 eclass/depend.apache.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.35&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?rev=1.35&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/depend.apache.eclass?r1=1.34&r2=1.35 |
13 |
|
14 |
Index: depend.apache.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v |
17 |
retrieving revision 1.34 |
18 |
retrieving revision 1.35 |
19 |
diff -u -r1.34 -r1.35 |
20 |
--- depend.apache.eclass 8 Sep 2007 14:06:12 -0000 1.34 |
21 |
+++ depend.apache.eclass 25 Nov 2007 14:27:52 -0000 1.35 |
22 |
@@ -1,184 +1,97 @@ |
23 |
# Copyright 1999-2007 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.34 2007/09/08 14:06:12 hollow Exp $ |
26 |
- |
27 |
-inherit multilib |
28 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.35 2007/11/25 14:27:52 hollow Exp $ |
29 |
|
30 |
+# @ECLASS: depend.apache.eclass |
31 |
+# @MAINTAINER: apache-devs@g.o |
32 |
+# @BLURB: Functions to allow ebuilds to depend on apache |
33 |
+# @DESCRIPTION: |
34 |
# This eclass handles depending on apache in a sane way and providing |
35 |
# information about where certain interfaces are located. |
36 |
- |
37 |
-# NOTE: If you use this, be sure you use the need_* call after you have |
38 |
-# defined DEPEND and RDEPEND. Also note that you can not rely on the |
39 |
-# automatic RDEPEND=DEPEND that portage does if you use this eclass. |
40 |
+# |
41 |
+# @NOTE: If you use this, be sure you use the need_* call after you have defined |
42 |
+# DEPEND and RDEPEND. Also note that you can not rely on the automatic |
43 |
+# RDEPEND=DEPEND that portage does if you use this eclass. |
44 |
+# |
45 |
# See bug 107127 for more information. |
46 |
|
47 |
-###### |
48 |
-## Apache Common Variables |
49 |
-## |
50 |
-## These are internal variables used by this, and other apache-related eclasses, |
51 |
-## and thus should not need to be used by the ebuilds themselves (the ebuilds |
52 |
-## should know what version of Apache they are building against). |
53 |
-###### |
54 |
- |
55 |
-#### |
56 |
-## APACHE_VERSION |
57 |
-## |
58 |
-## Stores the version of apache we are going to be ebuilding. This variable is |
59 |
-## set by the need_apache{|1|2} functions. |
60 |
-## |
61 |
-#### |
62 |
+inherit multilib |
63 |
+ |
64 |
+# ============================================================================== |
65 |
+# INTERNAL VARIABLES |
66 |
+# ============================================================================== |
67 |
+ |
68 |
+# @ECLASS-VARIABLE: APACHE_VERSION |
69 |
+# @DESCRIPTION: |
70 |
+# Stores the version of apache we are going to be ebuilding. This variable is |
71 |
+# set by the need_apache functions. |
72 |
#APACHE_VERSION="2" |
73 |
|
74 |
-#### |
75 |
-## APXS1, APXS2 |
76 |
-## |
77 |
-## Paths to the apxs tools |
78 |
-#### |
79 |
-APXS1="/usr/sbin/apxs" |
80 |
+# @ECLASS-VARIABLE: APXS2 |
81 |
+# @DESCRIPTION: |
82 |
+# Paths to the apxs tool |
83 |
APXS2="/usr/sbin/apxs2" |
84 |
|
85 |
-#### |
86 |
-## APACHECTL1, APACHECTL2 |
87 |
-## |
88 |
-## Paths to the apachectl tools |
89 |
-#### |
90 |
-APACHECTL1="/usr/sbin/apachectl" |
91 |
+# @ECLASS-VARIABLE: APACHECTL2 |
92 |
+# @DESCRIPTION: |
93 |
+# Path to the apachectl tool |
94 |
APACHECTL2="/usr/sbin/apache2ctl" |
95 |
|
96 |
-#### |
97 |
-## APACHE1_BASEDIR, APACHE2_BASEDIR |
98 |
-## |
99 |
-## Paths to the server root directories |
100 |
-#### |
101 |
-APACHE1_BASEDIR="/usr/$(get_libdir)/apache" |
102 |
+# @ECLASS-VARIABLE: APACHE2_BASEDIR |
103 |
+# @DESCRIPTION: |
104 |
+# Path to the server root directory |
105 |
APACHE2_BASEDIR="/usr/$(get_libdir)/apache2" |
106 |
|
107 |
-#### |
108 |
-## APACHE1_CONFDIR, APACHE2_CONFDIR |
109 |
-## |
110 |
-## Paths to the configuration file directories |
111 |
-#### |
112 |
-APACHE1_CONFDIR="/etc/apache" |
113 |
+# @ECLASS-VARIABLE: APACHE2_CONFDIR |
114 |
+# @DESCRIPTION: |
115 |
+# Path to the configuration file directory |
116 |
APACHE2_CONFDIR="/etc/apache2" |
117 |
|
118 |
-#### |
119 |
-## APACHE1_MODULES_CONFDIR, APACHE2_MODULES_CONFDIR |
120 |
-## |
121 |
-## Paths where module configuration files are kept |
122 |
-#### |
123 |
-APACHE1_MODULES_CONFDIR="${APACHE1_CONFDIR}/modules.d" |
124 |
+# @ECLASS-VARIABLE: APACHE2_MODULES_CONFDIR |
125 |
+# @DESCRIPTION: |
126 |
+# Path where module configuration files are kept |
127 |
APACHE2_MODULES_CONFDIR="${APACHE2_CONFDIR}/modules.d" |
128 |
|
129 |
-#### |
130 |
-## APACHE1_VHOSTDIR, APACHE2_VHOSTDIR |
131 |
-## |
132 |
-## Paths where virtual host configuration files are kept |
133 |
-#### |
134 |
-APACHE1_VHOSTDIR="${APACHE1_CONFDIR}/vhosts.d" |
135 |
+# @ECLASS-VARIABLE: APACHE2_VHOSTDIR |
136 |
+# @DESCRIPTION: |
137 |
+# Path where virtual host configuration files are kept |
138 |
APACHE2_VHOSTDIR="${APACHE2_CONFDIR}/vhosts.d" |
139 |
|
140 |
-#### |
141 |
-## APACHE1_MODULESDIR, APACHE2_MODULESDIR |
142 |
-## |
143 |
-## Paths where we install modules |
144 |
-#### |
145 |
-APACHE1_MODULESDIR="${APACHE1_BASEDIR}/modules" |
146 |
+# @ECLASS-VARIABLE: APACHE2_MODULESDIR |
147 |
+# @DESCRIPTION: |
148 |
+# Path where we install modules |
149 |
APACHE2_MODULESDIR="${APACHE2_BASEDIR}/modules" |
150 |
|
151 |
-#### |
152 |
-## APACHE1_DEPEND, APACHE2_DEPEND |
153 |
-## APACHE2_0_DEPEND, APACHE2_2_DEPEND |
154 |
-## |
155 |
-## Dependencies for Apache 1.x and Apache 2.x |
156 |
-#### |
157 |
-APACHE1_DEPEND="=www-servers/apache-1*" |
158 |
+# @ECLASS-VARIABLE: APACHE2_DEPEND |
159 |
+# @DESCRIPTION: |
160 |
+# Dependencies for Apache 2.x |
161 |
APACHE2_DEPEND="=www-servers/apache-2*" |
162 |
+ |
163 |
+# @ECLASS-VARIABLE: APACHE2_0_DEPEND |
164 |
+# @DESCRIPTION: |
165 |
+# Dependencies for Apache 2.0.x |
166 |
APACHE2_0_DEPEND="=www-servers/apache-2.0*" |
167 |
-APACHE2_2_DEPEND="=www-servers/apache-2.2*" |
168 |
|
169 |
-#### |
170 |
-## NEED_APACHE_DEPEND |
171 |
-## |
172 |
-## Dependency magic based on useflags to use the right DEPEND |
173 |
-## If you change this, please check the DEPENDS in need_apache() |
174 |
-#### |
175 |
+# @ECLASS-VARIABLE: APACHE2_2_DEPEND |
176 |
+# @DESCRIPTION: |
177 |
+# Dependencies for Apache 2.2.x |
178 |
+APACHE2_2_DEPEND="=www-servers/apache-2.2*" |
179 |
|
180 |
-NEED_APACHE_DEPEND="${APACHE2_DEPEND}" |
181 |
+# @ECLASS-VARIABLE: WANT_APACHE_DEPEND |
182 |
+# @DESCRIPTION: |
183 |
+# Dependency magic based on useflag to use the right DEPEND |
184 |
WANT_APACHE_DEPEND="apache2? ( ${APACHE2_DEPEND} )" |
185 |
|
186 |
-#### |
187 |
-## apr_config/apu_config |
188 |
-## |
189 |
-## Version magic to get the correct apr-config/apu-config |
190 |
-## based on the (probably) installed version of apache. |
191 |
-## This is needed to get modules to link to the same apr/apu |
192 |
-## as apache (i.e. link 0.9 for 2.0, 1.x for 2.2) |
193 |
-#### |
194 |
-apr_config() { |
195 |
- local default="${1:-1}" |
196 |
- if [[ "${USE_APACHE}" == "2" ]]; then |
197 |
- if has_version ${APACHE2_0_DEPEND}; then |
198 |
- echo apr-config |
199 |
- else |
200 |
- echo apr-1-config |
201 |
- fi |
202 |
- else |
203 |
- if [[ "${default}" == "0" ]]; then |
204 |
- echo apr-config |
205 |
- elif [[ "${default}" == "1" ]]; then |
206 |
- echo apr-1-config |
207 |
- else |
208 |
- die "Unknown version specifier: ${default}" |
209 |
- fi |
210 |
- fi |
211 |
-} |
212 |
- |
213 |
-apu_config() { |
214 |
- local default="${1:-1}" |
215 |
- if [[ "${USE_APACHE}" == "2" ]]; then |
216 |
- if has_version ${APACHE2_0_DEPEND}; then |
217 |
- echo apu-config |
218 |
- else |
219 |
- echo apu-1-config |
220 |
- fi |
221 |
- else |
222 |
- if [[ "${default}" == "0" ]]; then |
223 |
- echo apu-config |
224 |
- elif [[ "${default}" == "1" ]]; then |
225 |
- echo apu-1-config |
226 |
- else |
227 |
- die "Unknown version specifier: ${default}" |
228 |
- fi |
229 |
- fi |
230 |
-} |
231 |
- |
232 |
-#### |
233 |
-# uses_apache1() - !!! DEPRECATED !!! |
234 |
-#### |
235 |
- |
236 |
-uses_apache1() { |
237 |
- debug-print-function $FUNCNAME $* |
238 |
- # WARNING: Do not use these variables with anything that is put |
239 |
- # into the dependency cache (DEPEND/RDEPEND/etc) |
240 |
- APACHE_VERSION="1" |
241 |
- APXS="${APXS1}" |
242 |
- USE_APACHE="1" |
243 |
- APACHECTL="${APACHECTL1}" |
244 |
- APACHE_BASEDIR="${APACHE1_BASEDIR}" |
245 |
- APACHE_CONFDIR="${APACHE1_CONFDIR}" |
246 |
- APACHE_MODULES_CONFDIR="${APACHE1_MODULES_CONFDIR}" |
247 |
- APACHE_VHOSTSDIR="${APACHE1_VHOSTSDIR}" |
248 |
- APACHE_MODULESDIR="${APACHE1_MODULESDIR}" |
249 |
-} |
250 |
- |
251 |
-#### |
252 |
-# uses_apache2() |
253 |
-# |
254 |
-# sets up all of the environment variables required by an apache2 module |
255 |
-#### |
256 |
- |
257 |
+# ============================================================================== |
258 |
+# INTERNAL FUNCTIONS |
259 |
+# ============================================================================== |
260 |
+ |
261 |
+# @FUNCTION: uses_apache2 |
262 |
+# @DESCRIPTION: |
263 |
+# sets up all of the environment variables required for an apache2 module |
264 |
uses_apache2() { |
265 |
debug-print-function $FUNCNAME $* |
266 |
+ |
267 |
# WARNING: Do not use these variables with anything that is put |
268 |
# into the dependency cache (DEPEND/RDEPEND/etc) |
269 |
APACHE_VERSION="2" |
270 |
@@ -192,129 +105,131 @@ |
271 |
APACHE_MODULESDIR="${APACHE2_MODULESDIR}" |
272 |
} |
273 |
|
274 |
+# @FUNCTION: doesnt_use_apache |
275 |
+# @DESCRIPTION: |
276 |
+# sets up all of the environment variables required for optional apache usage |
277 |
doesnt_use_apache() { |
278 |
debug-print-function $FUNCNAME $* |
279 |
+ |
280 |
APACHE_VERSION="0" |
281 |
USE_APACHE="0" |
282 |
} |
283 |
|
284 |
-#### |
285 |
-## need_apache1 - !!! DEPRECATED !!! |
286 |
-#### |
287 |
-need_apache1() { |
288 |
+# ============================================================================== |
289 |
+# PUBLIC FUNCTIONS |
290 |
+# ============================================================================== |
291 |
+ |
292 |
+# @FUNCTION: want_apache |
293 |
+# @DESCRIPTION: |
294 |
+# An ebuild calls this to get the dependency information for optional apache-2.x |
295 |
+# support. |
296 |
+want_apache() { |
297 |
debug-print-function $FUNCNAME $* |
298 |
|
299 |
- DEPEND="${DEPEND} ${APACHE1_DEPEND}" |
300 |
- RDEPEND="${RDEPEND} ${APACHE1_DEPEND}" |
301 |
- APACHE_VERSION="1" |
302 |
+ IUSE="${IUSE} apache2" |
303 |
+ DEPEND="${DEPEND} ${WANT_APACHE_DEPEND}" |
304 |
+ RDEPEND="${RDEPEND} ${WANT_APACHE_DEPEND}" |
305 |
+ |
306 |
+ if use apache2 ; then |
307 |
+ uses_apache2 |
308 |
+ else |
309 |
+ doesnt_use_apache |
310 |
+ fi |
311 |
} |
312 |
|
313 |
-#### |
314 |
-## need_apache2 |
315 |
-## |
316 |
-## An ebuild calls this to get the dependency information |
317 |
-## for apache-2.x. An ebuild should use this in order for |
318 |
-## future changes to the build infrastructure to happen |
319 |
-## seamlessly. All an ebuild needs to do is include the |
320 |
-## line need_apache2 somewhere. |
321 |
-#### |
322 |
+# @FUNCTION: need_apache2 |
323 |
+# @DESCRIPTION: |
324 |
+# An ebuild calls this to get the dependency information for apache-2.x. An |
325 |
+# ebuild should use this in order for future changes to the build infrastructure |
326 |
+# to happen seamlessly. All an ebuild needs to do is include the line |
327 |
+# need_apache2 somewhere. |
328 |
need_apache2() { |
329 |
debug-print-function $FUNCNAME $* |
330 |
|
331 |
DEPEND="${DEPEND} ${APACHE2_DEPEND}" |
332 |
RDEPEND="${RDEPEND} ${APACHE2_DEPEND}" |
333 |
- APACHE_VERSION="2" |
334 |
+ uses_apache2 |
335 |
} |
336 |
|
337 |
-#### |
338 |
-## need_apache2_0 |
339 |
-## |
340 |
-## Works like need_apache2 above, but its used by modules |
341 |
-## that only support apache 2.0 and do not work with |
342 |
-## higher versions. |
343 |
-## |
344 |
-#### |
345 |
+# @FUNCTION: need_apache2_0 |
346 |
+# @DESCRIPTION: |
347 |
+# Works like need_apache2 above, but its used by modules that only support |
348 |
+# apache 2.0 and do not work with higher versions. |
349 |
need_apache2_0() { |
350 |
debug-print-function $FUNCNAME $* |
351 |
|
352 |
DEPEND="${DEPEND} ${APACHE2_0_DEPEND}" |
353 |
RDEPEND="${RDEPEND} ${APACHE2_0_DEPEND}" |
354 |
- APACHE_VERSION="2" |
355 |
+ uses_apache2 |
356 |
} |
357 |
|
358 |
-#### |
359 |
-## need_apache2_2 |
360 |
-## |
361 |
-## Works like need_apache2 above, but its used by modules |
362 |
-## that only support apache 2.2 and do not work with |
363 |
-## lower versions. |
364 |
-## |
365 |
-#### |
366 |
+# @FUNCTION: need_apache2_2 |
367 |
+# @DESCRIPTION: |
368 |
+# Works like need_apache2 above, but its used by modules that only support |
369 |
+# apache 2.2 and do not work with lower versions. |
370 |
need_apache2_2() { |
371 |
debug-print-function $FUNCNAME $* |
372 |
|
373 |
DEPEND="${DEPEND} ${APACHE2_2_DEPEND}" |
374 |
RDEPEND="${RDEPEND} ${APACHE2_2_DEPEND}" |
375 |
- APACHE_VERSION="2" |
376 |
+ uses_apache2 |
377 |
} |
378 |
|
379 |
-#### |
380 |
-## DO NOT CHANGE THIS FUNCTION UNLESS YOU UNDERSTAND THE CONSEQUENCES IT |
381 |
-## WILL HAVE ON THE CACHE! |
382 |
-## |
383 |
-## This function can take a variable amount of arguments specifying the |
384 |
-## versions of apache the ebuild supports |
385 |
-## |
386 |
-## If no arguments are specified, then all versions are assumed to be supported |
387 |
-## |
388 |
-## Currently supported versions: 2.0 2.2 2.x |
389 |
-#### |
390 |
+# @FUNCTION: need_apache |
391 |
+# @DESCRIPTION: |
392 |
+# Legacy alias for need_apache2 |
393 |
need_apache() { |
394 |
- debug-print-function $FUNCNAME $* |
395 |
+ need_apache2 |
396 |
+} |
397 |
|
398 |
- local supports2x supports20 supports22 |
399 |
+# @FUNCTION: apr_config |
400 |
+# @DESCRIPTION: |
401 |
+# Version magic to get the correct apr-config binary based on the (probably) |
402 |
+# installed version of apache. This is needed to get modules to link to the |
403 |
+# same apr/apu as apache (i.e. link 0.9 for 2.0, 1.x for 2.2) |
404 |
+apr_config() { |
405 |
+ debug-print-function $FUNCNAME $* |
406 |
|
407 |
- if [[ $# -eq 0 ]] ; then |
408 |
- supports2x="yes" |
409 |
+ local default="${1:-1}" |
410 |
+ if [[ "${USE_APACHE}" == "2" ]]; then |
411 |
+ if has_version ${APACHE2_0_DEPEND}; then |
412 |
+ echo apr-config |
413 |
+ else |
414 |
+ echo apr-1-config |
415 |
+ fi |
416 |
else |
417 |
- while [[ $# -gt 0 ]] ; do |
418 |
- case "$1" in |
419 |
- 2.0) supports20="yes"; shift;; |
420 |
- 2.2) supports22="yes"; shift;; |
421 |
- 2.x) supports2x="yes"; shift;; |
422 |
- *) die "Unknown version specifier: $1";; |
423 |
- esac |
424 |
- done |
425 |
- fi |
426 |
- |
427 |
- if [[ "${supports20}" == "yes" ]] && [[ "${supports22}" == "yes" ]] ; then |
428 |
- supports2x="yes" |
429 |
- fi |
430 |
- |
431 |
- debug-print "supports20: ${supports20}" |
432 |
- debug-print "supports22: ${supports22}" |
433 |
- debug-print "supports2x: ${supports2x}" |
434 |
- |
435 |
- if [[ "${supports2x}" == "yes" ]] ; then |
436 |
- need_apache2 |
437 |
- elif [[ "${supports20}" == "yes" ]] ; then |
438 |
- need_apache2_0 |
439 |
- elif [[ "${supports22}" == "yes" ]] ; then |
440 |
- need_apache2_2 |
441 |
+ if [[ "${default}" == "0" ]]; then |
442 |
+ echo apr-config |
443 |
+ elif [[ "${default}" == "1" ]]; then |
444 |
+ echo apr-1-config |
445 |
+ else |
446 |
+ die "Unknown version specifier: ${default}" |
447 |
+ fi |
448 |
fi |
449 |
- |
450 |
- uses_apache2 |
451 |
} |
452 |
|
453 |
-want_apache() { |
454 |
+# @FUNCTION: apu_config |
455 |
+# @DESCRIPTION: |
456 |
+# Version magic to get the correct apu-config binary based on the (probably) |
457 |
+# installed version of apache. This is needed to get modules to link to the |
458 |
+# same apr/apu as apache (i.e. link 0.9 for 2.0, 1.x for 2.2) |
459 |
+apu_config() { |
460 |
debug-print-function $FUNCNAME $* |
461 |
|
462 |
- IUSE="${IUSE} apache2" |
463 |
- DEPEND="${DEPEND} ${WANT_APACHE_DEPEND}" |
464 |
- RDEPEND="${RDEPEND} ${WANT_APACHE_DEPEND}" |
465 |
- if use apache2 ; then |
466 |
- uses_apache2 |
467 |
+ local default="${1:-1}" |
468 |
+ if [[ "${USE_APACHE}" == "2" ]]; then |
469 |
+ if has_version ${APACHE2_0_DEPEND}; then |
470 |
+ echo apu-config |
471 |
+ else |
472 |
+ echo apu-1-config |
473 |
+ fi |
474 |
else |
475 |
- doesnt_use_apache |
476 |
+ if [[ "${default}" == "0" ]]; then |
477 |
+ echo apu-config |
478 |
+ elif [[ "${default}" == "1" ]]; then |
479 |
+ echo apu-1-config |
480 |
+ else |
481 |
+ die "Unknown version specifier: ${default}" |
482 |
+ fi |
483 |
fi |
484 |
} |
485 |
|
486 |
|
487 |
|
488 |
1.20 eclass/apache-module.eclass |
489 |
|
490 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/apache-module.eclass?rev=1.20&view=markup |
491 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/apache-module.eclass?rev=1.20&content-type=text/plain |
492 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/apache-module.eclass?r1=1.19&r2=1.20 |
493 |
|
494 |
Index: apache-module.eclass |
495 |
=================================================================== |
496 |
RCS file: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v |
497 |
retrieving revision 1.19 |
498 |
retrieving revision 1.20 |
499 |
diff -u -r1.19 -r1.20 |
500 |
--- apache-module.eclass 12 May 2007 02:28:51 -0000 1.19 |
501 |
+++ apache-module.eclass 25 Nov 2007 14:27:52 -0000 1.20 |
502 |
@@ -1,89 +1,71 @@ |
503 |
# Copyright 1999-2007 Gentoo Foundation |
504 |
# Distributed under the terms of the GNU General Public License v2 |
505 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.19 2007/05/12 02:28:51 chtekk Exp $ |
506 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.20 2007/11/25 14:27:52 hollow Exp $ |
507 |
|
508 |
-inherit depend.apache |
509 |
- |
510 |
-# This eclass provides a common set of functions for Apache modules. |
511 |
- |
512 |
-# NOTE: If you use this, be sure you use the need_* call after you have |
513 |
-# defined DEPEND and RDEPEND. Also note that you can not rely on the |
514 |
-# automatic RDEPEND=DEPEND that Portage does if you use this eclass. |
515 |
+# @ECLASS: apache-module |
516 |
+# @MAINTAINER: apache-devs@g.o |
517 |
+# @BLURB: Provides a common set of functions for apache modules |
518 |
+# @DESCRIPTION: |
519 |
+# This eclass handles apache modules in a sane way and providing information |
520 |
+# about where certain interfaces are located. |
521 |
+# |
522 |
+# @NOTE: If you use this, be sure you use the need_* call after you have defined |
523 |
+# DEPEND and RDEPEND. Also note that you can not rely on the automatic |
524 |
+# RDEPEND=DEPEND that Portage does if you use this eclass. |
525 |
+# |
526 |
# See bug 107127 for more information. |
527 |
|
528 |
-###### |
529 |
-## Common ebuild variables |
530 |
-###### |
531 |
- |
532 |
-#### |
533 |
-## APXS1_S, APXS2_S |
534 |
-## |
535 |
-## Paths to temporary build directories |
536 |
-#### |
537 |
-APXS1_S="" |
538 |
+inherit depend.apache |
539 |
+ |
540 |
+# ============================================================================== |
541 |
+# INTERNAL VARIABLES |
542 |
+# ============================================================================== |
543 |
+ |
544 |
+# @ECLASS-VARIABLE: APXS2_S |
545 |
+# @DESCRIPTION: |
546 |
+# Path to temporary build directory |
547 |
APXS2_S="" |
548 |
|
549 |
-#### |
550 |
-## APXS1_ARGS, APXS2_ARGS |
551 |
-## |
552 |
-## Arguments to pass to the apxs tool |
553 |
-#### |
554 |
-APXS1_ARGS="" |
555 |
+# @ECLASS-VARIABLE: APXS2_ARGS |
556 |
+# @DESCRIPTION: |
557 |
+# Arguments to pass to the apxs tool |
558 |
APXS2_ARGS="" |
559 |
|
560 |
-#### |
561 |
-## APACHE1_MOD_FILE, APACHE2_MOD_FILE |
562 |
-## |
563 |
-## Name of the module that src_install installs (only, minus the .so) |
564 |
-#### |
565 |
-APACHE1_MOD_FILE="" |
566 |
+# @ECLASS-VARIABLE: APACHE2_MOD_FILE |
567 |
+# @DESCRIPTION: |
568 |
+# Name of the module that src_install installs (minus the .so) |
569 |
APACHE2_MOD_FILE="" |
570 |
|
571 |
-#### |
572 |
-## APACHE1_MOD_CONF, APACHE2_MOD_CONF |
573 |
-## |
574 |
-## Configuration file installed by src_install |
575 |
-#### |
576 |
-APACHE1_MOD_CONF="" |
577 |
+# @ECLASS-VARIABLE: APACHE2_MOD_CONF |
578 |
+# @DESCRIPTION: |
579 |
+# Configuration file installed by src_install |
580 |
APACHE2_MOD_CONF="" |
581 |
|
582 |
-#### |
583 |
-## APACHE1_MOD_DEFINE, APACHE2_MOD_DEFINE |
584 |
-## |
585 |
-## Name of define (eg FOO) to use in conditional loading of the installed |
586 |
-## module/it's config file, multiple defines should be space separated |
587 |
-#### |
588 |
-APACHE1_MOD_DEFINE="" |
589 |
+# @ECLASS-VARIABLE: APACHE2_MOD_DEFINE |
590 |
+# @DESCRIPTION: |
591 |
+# Name of define (eg FOO) to use in conditional loading of the installed |
592 |
+# module/it's config file, multiple defines should be space separated |
593 |
APACHE2_MOD_DEFINE="" |
594 |
|
595 |
-#### |
596 |
-## DOCFILES |
597 |
-## |
598 |
-## If the exported src_install() is being used, and ${DOCFILES} is non-zero, |
599 |
-## some sed-fu is applied to split out html documentation (if any) from normal |
600 |
-## documentation, and dodoc'd or dohtml'd |
601 |
-#### |
602 |
+# @ECLASS-VARIABLE: DOCFILES |
603 |
+# @DESCRIPTION: |
604 |
+# If the exported src_install() is being used, and ${DOCFILES} is non-zero, some |
605 |
+# sed-fu is applied to split out html documentation (if any) from normal |
606 |
+# documentation, and dodoc'd or dohtml'd |
607 |
DOCFILES="" |
608 |
|
609 |
-###### |
610 |
-## Utility functions |
611 |
-###### |
612 |
- |
613 |
-#### |
614 |
-## apache_cd_dir |
615 |
-## |
616 |
-## Return the path to our temporary build dir |
617 |
-#### |
618 |
+# ============================================================================== |
619 |
+# PUBLIC FUNCTIONS |
620 |
+# ============================================================================== |
621 |
+ |
622 |
+# @FUNCTION: apache_cd_dir |
623 |
+# @DESCRIPTION: |
624 |
+# Return the path to our temporary build dir |
625 |
apache_cd_dir() { |
626 |
debug-print-function $FUNCNAME $* |
627 |
|
628 |
- if [[ "${APACHE_VERSION}" == "1" ]] ; then |
629 |
- [[ -n "${APXS1_S}" ]] && CD_DIR="${APXS1_S}" |
630 |
- else |
631 |
- [[ -n "${APXS2_S}" ]] && CD_DIR="${APXS2_S}" |
632 |
- fi |
633 |
+ [[ -n "${APXS2_S}" ]] && CD_DIR="${APXS2_S}" |
634 |
|
635 |
- # XXX - Is this really needed? Can't we just return ${S}? |
636 |
if [[ -z "${CD_DIR}" ]] ; then |
637 |
if [[ -d "${S}/src" ]] ; then |
638 |
CD_DIR="${S}/src" |
639 |
@@ -96,34 +78,24 @@ |
640 |
echo "${CD_DIR}" |
641 |
} |
642 |
|
643 |
-#### |
644 |
-## apache_mod_file |
645 |
-## |
646 |
-## Return the path to the module file |
647 |
-#### |
648 |
+# @FUNCTION: apache_mod_file |
649 |
+# @DESCRIPTION: |
650 |
+# Return the path to the module file |
651 |
apache_mod_file() { |
652 |
debug-print-function $FUNCNAME $* |
653 |
|
654 |
- if [[ "${APACHE_VERSION}" == "1" ]] ; then |
655 |
- [[ -n "${APACHE1_MOD_FILE}" ]] && MOD_FILE="${APACHE1_MOD_FILE}" |
656 |
- [[ -z "${MOD_FILE}" ]] && MOD_FILE="$(apache_cd_dir)/${PN}.so" |
657 |
- else |
658 |
- [[ -n "${APACHE2_MOD_FILE}" ]] && MOD_FILE="${APACHE2_MOD_FILE}" |
659 |
- [[ -z "${MOD_FILE}" ]] && MOD_FILE="$(apache_cd_dir)/.libs/${PN}.so" |
660 |
- fi |
661 |
+ [[ -n "${APACHE2_MOD_FILE}" ]] && MOD_FILE="${APACHE2_MOD_FILE}" |
662 |
+ [[ -z "${MOD_FILE}" ]] && MOD_FILE="$(apache_cd_dir)/.libs/${PN}.so" |
663 |
|
664 |
debug-print apache_mod_file: "MOD_FILE=${MOD_FILE}" |
665 |
echo "${MOD_FILE}" |
666 |
} |
667 |
|
668 |
-#### |
669 |
-## apache_doc_magic |
670 |
-## |
671 |
-## Some magic for picking out html files from ${DOCFILES}. It takes |
672 |
-## an optional first argument `html'; if the first argument is equals |
673 |
-## `html', only html files are returned, otherwise normal (non-html) |
674 |
-## docs are returned. |
675 |
-#### |
676 |
+# @FUNCTION: apache_doc_magic |
677 |
+# @DESCRIPTION: |
678 |
+# Some magic for picking out html files from ${DOCFILES}. It takes an optional |
679 |
+# first argument `html'; if the first argument is equals `html', only html files |
680 |
+# are returned, otherwise normal (non-html) docs are returned. |
681 |
apache_doc_magic() { |
682 |
debug-print-function $FUNCNAME $* |
683 |
|
684 |
@@ -139,88 +111,11 @@ |
685 |
fi |
686 |
} |
687 |
|
688 |
-###### |
689 |
-## Apache 1.x ebuild functions - !!! DEPRECATED !!! |
690 |
-###### |
691 |
- |
692 |
-#### |
693 |
-## apache1_src_compile - !!! DEPRECATED !!! |
694 |
-#### |
695 |
-apache1_src_compile() { |
696 |
- debug-print-function $FUNCNAME $* |
697 |
- |
698 |
- CD_DIR=$(apache_cd_dir) |
699 |
- cd ${CD_DIR} || die "cd ${CD_DIR} failed" |
700 |
- APXS1_ARGS="${APXS1_ARGS:--c ${PN}.c}" |
701 |
- ${APXS1} ${APXS1_ARGS} || die "${APXS1} ${APXS1_ARGS} failed" |
702 |
-} |
703 |
- |
704 |
-#### |
705 |
-## apache1_src_install - !!! DEPRECATED !!! |
706 |
-#### |
707 |
-apache1_src_install() { |
708 |
- debug-print-function $FUNCNAME $* |
709 |
- |
710 |
- CD_DIR=$(apache_cd_dir) |
711 |
- cd ${CD_DIR} || die "cd ${CD_DIR} failed" |
712 |
- |
713 |
- MOD_FILE=$(apache_mod_file) |
714 |
- |
715 |
- exeinto ${APACHE1_MODULESDIR} |
716 |
- doexe ${MOD_FILE} || die "internal ebuild error: '${MOD_FILE}' not found" |
717 |
- [ -n "${APACHE1_EXECFILES}" ] && doexe ${APACHE1_EXECFILES} |
718 |
- |
719 |
- if [ -n "${APACHE1_MOD_CONF}" ] ; then |
720 |
- insinto ${APACHE1_MODULES_CONFDIR} |
721 |
- doins ${FILESDIR}/${APACHE1_MOD_CONF}.conf || die "internal ebuild error: '${FILESDIR}/${APACHE1_MOD_CONF}.conf' not found." |
722 |
- fi |
723 |
- |
724 |
- cd ${S} |
725 |
- |
726 |
- if [ -n "${DOCFILES}" ] ; then |
727 |
- OTHER_DOCS=$(apache_doc_magic) |
728 |
- HTML_DOCS=$(apache_doc_magic html) |
729 |
- |
730 |
- [ -n "${OTHER_DOCS}" ] && dodoc ${OTHER_DOCS} |
731 |
- [ -n "${HTML_DOCS}" ] && dohtml ${HTML_DOCS} |
732 |
- fi |
733 |
-} |
734 |
- |
735 |
-#### |
736 |
-## apache1_pkg_postinst - !!! DEPRECATED !!! |
737 |
-#### |
738 |
-apache1_pkg_postinst() { |
739 |
- debug-print-function $FUNCNAME $* |
740 |
- |
741 |
- if [ -n "${APACHE1_MOD_DEFINE}" ]; then |
742 |
- local my_opts="-D ${APACHE1_MOD_DEFINE// / -D }" |
743 |
- |
744 |
- einfo |
745 |
- einfo "To enable ${PN}, you need to edit your /etc/conf.d/apache file and" |
746 |
- einfo "add '${my_opts}' to APACHE_OPTS." |
747 |
- einfo |
748 |
- fi |
749 |
- if [ -n "${APACHE1_MOD_CONF}" ] ; then |
750 |
- einfo |
751 |
- einfo "Configuration file installed as" |
752 |
- einfo " ${APACHE1_MODULES_CONFDIR}/$(basename ${APACHE1_MOD_CONF}).conf" |
753 |
- einfo "You may want to edit it before turning the module on in /etc/conf.d/apache" |
754 |
- einfo |
755 |
- fi |
756 |
-} |
757 |
- |
758 |
-###### |
759 |
-## Apache 2.x ebuild functions |
760 |
-###### |
761 |
- |
762 |
-#### |
763 |
-## apache2_pkg_setup |
764 |
-## |
765 |
-## Checks to see if APACHE2_MT_UNSAFE is set to anything other than "no". If it is, then |
766 |
-## we check what the MPM style used by Apache is, if it isnt prefork, we let the user |
767 |
-## know they need prefork, and then exit the build. |
768 |
-#### |
769 |
-apache2_pkg_setup() { |
770 |
+# @FUNCTION: apache-module_pkg_setup |
771 |
+# @DESCRIPTION: |
772 |
+# Checks to see if APACHE2_SAFE_MPMS is set and if the currently installed MPM |
773 |
+# does appear in the list. |
774 |
+apache-module_pkg_setup() { |
775 |
debug-print-function $FUNCNAME $* |
776 |
|
777 |
if [[ -n "${APACHE2_SAFE_MPMS}" ]] ; then |
778 |
@@ -241,14 +136,12 @@ |
779 |
fi |
780 |
} |
781 |
|
782 |
-#### |
783 |
-## apache2_src_compile |
784 |
-## |
785 |
-## The default action is to call ${APXS2} with the value of |
786 |
-## ${APXS2_ARGS}. If a module requires a different build setup |
787 |
-## than this, use ${APXS2} in your own src_compile routine. |
788 |
-#### |
789 |
-apache2_src_compile() { |
790 |
+# @FUNCTION: apache-module_src_compile |
791 |
+# @DESCRIPTION: |
792 |
+# The default action is to call ${APXS2} with the value of ${APXS2_ARGS}. If a |
793 |
+# module requires a different build setup than this, use ${APXS2} in your own |
794 |
+# src_compile routine. |
795 |
+apache-module_src_compile() { |
796 |
debug-print-function $FUNCNAME $* |
797 |
|
798 |
CD_DIR=$(apache_cd_dir) |
799 |
@@ -257,17 +150,16 @@ |
800 |
${APXS2} ${APXS2_ARGS} || die "${APXS2} ${APXS2_ARGS} failed" |
801 |
} |
802 |
|
803 |
-#### |
804 |
-## apache2_src_install |
805 |
-## |
806 |
-## This installs the files into apache's directories. The module is installed |
807 |
-## from a directory chosen as above (APXS2_S or ${S}/src). In addition, |
808 |
-## this function can also set the executable permission on files listed in EXECFILES. |
809 |
-## The configuration file name is listed in CONFFILE without the .conf extensions, |
810 |
-## so if you configuration is 55_mod_foo.conf, CONFFILE would be 55_mod_foo. |
811 |
-## DOCFILES contains the list of files you want filed as documentation. |
812 |
-#### |
813 |
-apache2_src_install() { |
814 |
+# @FUNCTION: apache-module_src_install |
815 |
+# @DESCRIPTION: |
816 |
+# This installs the files into apache's directories. The module is installed |
817 |
+# from a directory chosen as above (APXS2_S or ${S}/src). In addition, this |
818 |
+# function can also set the executable permission on files listed in |
819 |
+# APACHE2_EXECFILES. The configuration file name is listed in APACHE2_MOD_CONF |
820 |
+# without the .conf extensions, so if you configuration is 55_mod_foo.conf, |
821 |
+# APACHE2_MOD_CONF would be 55_mod_foo. DOCFILES contains the list of files you |
822 |
+# want filed as documentation. |
823 |
+apache-module_src_install() { |
824 |
debug-print-function $FUNCNAME $* |
825 |
|
826 |
CD_DIR=$(apache_cd_dir) |
827 |
@@ -300,7 +192,10 @@ |
828 |
fi |
829 |
} |
830 |
|
831 |
-apache2_pkg_postinst() { |
832 |
+# @FUNCTION: apache-module_pkg_postinst |
833 |
+# @DESCRIPTION: |
834 |
+# This prints out information about the installed module and how to enable it. |
835 |
+apache-module_pkg_postinst() { |
836 |
debug-print-function $FUNCNAME $* |
837 |
|
838 |
if [[ -n "${APACHE2_MOD_DEFINE}" ]] ; then |
839 |
@@ -330,59 +225,12 @@ |
840 |
fi |
841 |
|
842 |
if [[ -n "${INSTALLED_MPM_UNSAFE}" ]] ; then |
843 |
- ewarn "You have one or more MPMs installed that will not work with" |
844 |
- ewarn "this module (${PN}). Please make sure that you only enable" |
845 |
- ewarn "this module if you are using one of the following MPMs:" |
846 |
+ ewarn "Your installed MPM will not work with this module (${PN})." |
847 |
+ ewarn "Please make sure that you only enable this module" |
848 |
+ ewarn "if you are using one of the following MPMs:" |
849 |
ewarn " ${INSTALLED_MPM_SAFE}" |
850 |
fi |
851 |
fi |
852 |
} |
853 |
|
854 |
-###### |
855 |
-## Apache dual (1.x or 2.x) ebuild functions - Apache 1.X DEPRECATED! |
856 |
-## |
857 |
-## This is where the magic happens. We provide dummy routines of all of the functions |
858 |
-## provided by all of the specifics. We use APACHE_ECLASS_VER_* to see which versions |
859 |
-## to call. If a function is provided by a given section (ie pkg_postinst in Apache 2.x) |
860 |
-## the exported routine simply does nothing. |
861 |
-###### |
862 |
- |
863 |
-apache-module_pkg_setup() { |
864 |
- debug-print-function $FUNCNAME $* |
865 |
- |
866 |
- if [[ ${APACHE_VERSION} -eq "2" ]] ; then |
867 |
- apache2_pkg_setup |
868 |
- fi |
869 |
-} |
870 |
- |
871 |
-apache-module_src_compile() { |
872 |
- debug-print-function $FUNCNAME $* |
873 |
- |
874 |
- if [[ ${APACHE_VERSION} -eq "1" ]] ; then |
875 |
- apache1_src_compile |
876 |
- else |
877 |
- apache2_src_compile |
878 |
- fi |
879 |
-} |
880 |
- |
881 |
-apache-module_src_install() { |
882 |
- debug-print-function $FUNCNAME $* |
883 |
- |
884 |
- if [[ ${APACHE_VERSION} -eq "1" ]] ; then |
885 |
- apache1_src_install |
886 |
- else |
887 |
- apache2_src_install |
888 |
- fi |
889 |
-} |
890 |
- |
891 |
-apache-module_pkg_postinst() { |
892 |
- debug-print-function $FUNCNAME $* |
893 |
- |
894 |
- if [[ ${APACHE_VERSION} -eq "1" ]] ; then |
895 |
- apache1_pkg_postinst |
896 |
- else |
897 |
- apache2_pkg_postinst |
898 |
- fi |
899 |
-} |
900 |
- |
901 |
EXPORT_FUNCTIONS pkg_setup src_compile src_install pkg_postinst |
902 |
|
903 |
|
904 |
|
905 |
-- |
906 |
gentoo-commits@g.o mailing list |