1 # $NetBSD: apache.mk,v 1.26 2011/03/12 14:07:13 wiz Exp $
3 # This file is meant to be included by packages that require an apache
6 # User-settable variables:
9 # The default apache server to use and install. If there already
10 # is an apache installed, this will have no effect.
12 # Possible values: apache13 apache2 apache22 apache24
14 # Package-settable variables:
17 # The list of apache packages that can be used as a dependency for
20 # Possible values: (see PKG_APACHE_DEFAULT)
23 # If apache2 is chosen by this file and this variable is set to
24 # "yes", a full dependency to the Apache Portable Runtime library
27 # Variables defined by this file:
30 # The Apache version that is actually used.
32 # Possible values: (see PKG_APACHE_DEFAULT)
35 # The package name prefix for apache modules.
37 # Possible values: ap13 ap2 ap22 ap24
40 .if
!defined
(APACHE_MK
)
44 _USER_VARS.apache
= PKG_APACHE_DEFAULT
45 _PKG_VARS.apache
= PKG_APACHE_ACCEPTED USE_APR
46 _SYS_VARS.apache
= PKG_APACHE APACHE_PKG_PREFIX
48 .
include "bsd.fast.prefs.mk"
50 PKG_APACHE_DEFAULT?
= apache22
51 BUILD_DEFS
+= PKG_APACHE_DEFAULT
52 BUILD_DEFS_EFFECTS
+= PKG_APACHE APACHE_PKG_PREFIX
54 # Package-settable variables
55 PKG_APACHE_ACCEPTED?
= ${_PKG_APACHES}
58 # The available apache packages:
59 _PKG_APACHES
= apache13 apache2 apache22 apache24
61 _APACHE_PKGBASE.apache13
= apache-1
*
62 _APACHE_PKG_PREFIX.apache13
= ap13
63 _APACHE_PKGSRCDIR.apache13
= ..
/..
/www
/apache
65 _APACHE_PKGBASE.apache2
= apache-2.0
*
66 _APACHE_PKG_PREFIX.apache2
= ap2
67 _APACHE_PKGSRCDIR.apache2
= ..
/..
/www
/apache2
69 _APACHE_PKGBASE.apache22
= apache-2.
[23]*
70 _APACHE_PKG_PREFIX.apache22
= ap22
71 _APACHE_PKGSRCDIR.apache22
= ..
/..
/www
/apache22
73 _APACHE_PKGBASE.apache24
= apache-2.
[456789]*
74 _APACHE_PKG_PREFIX.apache24
= ap24
75 _APACHE_PKGSRCDIR.apache24
= ..
/..
/www
/apache24
81 .if empty
(_PKG_APACHES
:M
${PKG_APACHE_DEFAULT})
82 PKG_FAIL_REASON
+= "[apache.mk] Invalid apache package \""${PKG_APACHE_DEFAULT
:Q
}"\" in PKG_APACHE_DEFAULT."
83 PKG_APACHE_DEFAULT
= apache2
86 .for _ap_ in
${PKG_APACHE_ACCEPTED}
87 . if empty
(_PKG_APACHES
:M
${_ap_})
88 PKG_FAIL_REASON
+= "[apache.mk] Invalid apache package \""${_ap_
:Q
}"\" in PKG_APACHE_ACCEPTED."
89 PKG_APACHE_ACCEPTED
= # none
93 # Mark the acceptable apaches and check which apache packages are installed.
94 .for _ap_ in
${PKG_APACHE_ACCEPTED}
95 _APACHE_OK.
${_ap_}= yes
96 _APACHE_INSTALLED.
${_ap_}!= \
97 if
${PKG_INFO} -qe
${_APACHE_PKGBASE.
${_ap_}:Q
}; then \
103 .for ap in
${_PKG_APACHES}
104 _APACHE_OK.
${ap}?
= no
109 # Use one of the installed apaches, ...
110 .for _ap_ in
${PKG_APACHE_ACCEPTED}
111 . if
${_APACHE_INSTALLED.
${_ap_}} == "yes"
116 # ... otherwise, prefer the default one if it's accepted, ...
117 .if
${_APACHE_OK.
${PKG_APACHE_DEFAULT}} == "yes"
118 PKG_APACHE?
= ${PKG_APACHE_DEFAULT}
121 # ... otherwise, just use the first accepted apache.
122 .for ap in
${PKG_APACHE_ACCEPTED}
126 .if defined
(PKG_APACHE
)
127 .
include "${_APACHE_PKGSRCDIR.${PKG_APACHE}}/buildlink3.mk"
129 PKG_FAIL_REASON
+= "[apache.mk] No acceptable apache package found."
133 APACHE_PKG_PREFIX
= ${_APACHE_PKG_PREFIX.
${PKG_APACHE}}
135 .if
(${PKG_APACHE} == "apache2") && !empty
(USE_APR
:M
[yY
][eE
][sS
])
136 .
include "../../devel/apr0/buildlink3.mk"
137 .elif
(${PKG_APACHE} != "apache13") && !empty
(USE_APR
:M
[Yy
][Ee
][Ss
])
138 .
include "../../devel/apr/buildlink3.mk"
139 .
include "../../devel/apr-util/buildlink3.mk"
143 # Variable assignment for multi-apache packages
144 MULTI
+= PKG_APACHE
=${PKG_APACHE}