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

Contents of /eclass/depend.apache.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Jul 16 10:48:22 2004 UTC (10 years ago) by stuart
Branch: MAIN
Initial import

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 ECLASS="depend.apache"
6 INHERITED="$INHERITED $ECLASS"
7 IUSE="apache apache2"
8
9 # call this function to work out which version of the apache web server
10 # your ebuild should be installing itself to use
11
12 detect_apache_useflags() {
13 USE_APACHE1=
14 USE_APACHE2=
15 USE_APACHE_MULTIPLE=
16
17 useq apache2 && USE_APACHE2=1
18 useq apache && USE_APACHE1=1
19
20 [ -n "$USE_APACHE1" ] && [ -n "$USE_APACHE2" ] && USE_APACHE_MULTIPLE=1
21 }
22
23 detect_apache_installed() {
24 HAS_APACHE1=
25 HAS_APACHE2=
26 HAS_APACHE_MULTIPLE=
27 HAS_APACHE_ANY=
28
29 has_version '=net-www/apache-1*' && HAS_APACHE1=1 && HAS_APACHE_ANY=1
30 has_version '=net-www/apache-2*' && HAS_APACHE2=1 && HAS_APACHE_ANY=1
31
32 [ -n "${HAVE_APACHE1}" ] && [ -n "${HAVE_APACHE2}" && HAVE_APACHE_MULTIPLE=1
33 }
34
35 # call this function from your pkg_setup
36
37 depend_apache() {
38 detect_apache_installed
39 detect_apache_useflags
40
41 # deal with the multiple cases first - much easier
42 if [ -n "$USE_APACHE_MULTIPLE" ]; then
43 echo
44 eerror "You have both the apache and apache2 USE flags set"
45 eerror
46 eerror "Please set only ONE of these USE flags, and try again"
47 echo
48 die "Multiple Apache USE flags set - you can only have one set at a time"
49 fi
50
51 if [ -n "$USE_APACHE2" ] ; then
52 if [ -z "$HAS_APACHE2" -a -n "$HAS_APACHE_ANY" ] ; then
53 echo
54 eerror "You have the 'apache2' USE flag set, but only have Apache v1 installed"
55 eerror "If you really meant to upgrade to Apache v2, please install Apache v2"
56 eerror "before installing $CATEGORY/${PN}-${PVR}"
57 echo
58 die "Automatic upgrade of Apache would be forced; avoiding"
59 else
60 einfo "Apache 2 support enabled"
61 DETECT_APACHE=2
62 return
63 fi
64 fi
65
66 if [ -n "$USE_APACHE1" ]; then
67 if [ -z "$HAS_APACHE1" -a -n "$HAS_APACHE_ANY" ]; then
68 echo
69 eerror "You have the 'apache' USE flag set, but only have a later version of"
70 eerror "Apache installed on your computer. Please use the 'apache2' USE flag"
71 eerror "or downgrade to Apache v1 before installing $CATEGORY/${PN}-${PVR}"
72 echo
73 die "Avoiding installing older version of Apache"
74 else
75 einfo "Apache 1 support enabled"
76 DETECT_APACHE=1
77 return
78 fi
79 fi
80 }

  ViewVC Help
Powered by ViewVC 1.1.20