Lines 1-131
Link Here
|
|
|
1 |
#-*- tab-width: 4; -*- |
2 |
# ex:ts=4 |
3 |
# |
1 |
# $FreeBSD$ |
4 |
# $FreeBSD$ |
2 |
# |
5 |
# |
3 |
# bsd.apache.mk - Apache related macros. |
6 |
# apache.mk - Apache related macros. |
4 |
# Author: Clement Laforet <clement@FreeBSD.org> |
7 |
# Author: Clement Laforet <clement@FreeBSD.org> |
5 |
# Author: Olli Hauer <ohauer@FreeBSD.org> |
8 |
# Author: Olli Hauer <ohauer@FreeBSD.org> |
|
|
9 |
# Author: Bernard Spil <brnrd@FreeSBD.org> |
6 |
# |
10 |
# |
7 |
# Please view me with 4 column tabs! |
11 |
# Please view me with 4 column tabs! |
8 |
|
12 |
|
9 |
# ========================================================================= |
13 |
# Feature: apache |
10 |
# User controlled parameters for usage in /etc/make.conf: |
14 |
# Usage: USES=apache or USES=apache:args |
|
|
15 |
# Valid args: <version>, build, run, server |
11 |
# |
16 |
# |
12 |
# DEFAULT_VERSIONS - define the default apache version |
17 |
# version If your port requires a specific Apache httpd version, you can |
13 |
# valid args: apache=2.2, apache=2.4 |
18 |
# set this to [min]-[max] or min+ or -max or an explicit version |
14 |
# |
19 |
# |
15 |
# APACHE_PORT - use www/apache22-(event|itk|peruser|worker)-mpm |
20 |
# USES=apache:2.2 # Only use Apache 2.2 |
16 |
# instead www/apache22. Use this parameter only in |
21 |
# USES=apache:2.4+ # Use Apache 2.4 or newer |
17 |
# combination with "DEFAULT_VERSIONS+= apache=2.2" |
22 |
# USES=apache:2.2-2.4 # Use Apache 2.2 or 2.4 |
|
|
23 |
# USES=apache:-2.4 # Use Apache 2.4 or earlier |
24 |
# USES=apache # Use the default apache version |
18 |
# |
25 |
# |
19 |
# Example entry in /etc/make.conf: |
26 |
# Valid version numbers are specified in the variable |
20 |
# - Set apache22 as default version |
27 |
# APACHE_SUPPORTED_VERSIONS below |
21 |
# DEFAULT_VERSIONS+= apache=2.2 |
|
|
22 |
# |
28 |
# |
23 |
# - Additional use a special www/apache22-$MPM port |
29 |
# build Indicates that Apache is needed at build time and adds it to |
24 |
# APACHE_PORT= www/apache22-event-mpm |
30 |
# BUILD_DEPENDS. |
|
|
31 |
# run Indicates that Apache is needed at run time and adds it to |
32 |
# RUN_DEPENDS. |
33 |
# server Indicates that the port is a server port. |
25 |
# |
34 |
# |
26 |
# Note: |
35 |
# If build and run are omitted, Apache will be added as BUILD_DEPENDS and |
27 |
# - This parameters should never be used in the Makefile of a port! |
36 |
# RUN_DEPENDS |
28 |
# - To get a list of "possible" APACHE_PORT values execute the command: |
|
|
29 |
# $> awk '/apache22-/ {print "www/" $3}' ports/www/Makefile |
30 |
# |
37 |
# |
31 |
# ========================================================================= |
38 |
# Variables, which can be set by the port: |
32 |
# |
39 |
# |
33 |
# This script will be included if one of the following parameter |
40 |
# AP_FAST_BUILD automatic module build |
34 |
# is defined in the Makefile of the port |
|
|
35 |
# |
41 |
# |
36 |
# USE_APACHE - Set apache and apxs as build and run dependency |
42 |
# AP_GENPLIST automatic PLIST generation plus add |
37 |
# USE_APACHE_BUILD - Set apache and apxs as build dependency |
43 |
# the module disabled into httpd.conf |
38 |
# USE_APACHE_RUN - Set apache and apxs as run dependency |
44 |
# (only if no pkg-plist exist) |
39 |
# |
45 |
# |
40 |
# The following example is representative of all three possible |
46 |
# MODULENAME Name of the Apache module |
41 |
# parameters to use. |
47 |
# default: ${PORTNAME} |
|
|
48 |
# SHORTMODNAME Short name of the Apache module |
49 |
# default: ${MODULENAME:S/mod_//} |
50 |
# SRC_FILE Source file of the APACHE MODULE |
51 |
# default: ${MODULENAME}.c |
42 |
# |
52 |
# |
43 |
# Examples: |
53 |
# Variables, for internal use by the Apache ports framework only |
44 |
# USE_APACHE= 22 # specify exact version |
54 |
# The following values for USE_APACHE are reserved and only valid |
45 |
# USE_APACHE= 22+ # specify [min] version, no [max] version |
55 |
# in apache-server ports! |
46 |
# USE_APACHE= 22-24 # specify [min]-[max] range |
56 |
# USES= apache:server,2.2 |
47 |
# USE_APACHE= -22 # specify [max] version, no [min] version |
|
|
48 |
# |
57 |
# |
49 |
# Note: |
|
|
50 |
# - If "+" is specified and no apache is installed, then |
51 |
# ${DEFAULT_APACHE_VERSION} will be used. |
52 |
# |
58 |
# |
53 |
# - Valid version numbers are specified in the variable |
59 |
# The following variables can be read by ports and must not be modified |
54 |
# APACHE_SUPPORTED_VERSION below |
60 |
# |
|
|
61 |
# APACHE_VERSION The major-minor release version of the chosen |
62 |
# Apache server, e.g. 2.2 or 2.4 |
55 |
# |
63 |
# |
56 |
# - The following values for USE_APACHE are reserverd and only valid |
64 |
# APACHEETCDIR Location of the Apache configuration directory |
57 |
# in apache-server ports! |
65 |
# Default: ${LOCALBASE}/etc/apache24 |
58 |
# USE_APACHE= common22 |
|
|
59 |
# |
66 |
# |
|
|
67 |
# APACHEINCLUDEDIR Location of the Apache include files |
68 |
# Default: ${LOCALBASE}/include/apache24 |
60 |
# |
69 |
# |
61 |
# The following variables can be used (ro) in ports Makefile |
70 |
# APACHEMODDIR Location of the Apache modules |
62 |
# ========================================================================= |
71 |
# Default: ${LOCALBASE}/libxexec/apache24 |
63 |
# - APACHE_VERSION |
|
|
64 |
# - APACHEETCDIR |
65 |
# - APACHEINCLUDEDIR |
66 |
# - APACHEMODDIR |
67 |
# - DEFAULT_APACHE_VERSION |
68 |
# |
72 |
# |
|
|
73 |
# APACHE_DEFAULT Default Apache version |
69 |
# |
74 |
# |
70 |
# Parameters for building third party apache modules: |
|
|
71 |
# ========================================================================= |
72 |
# - AP_FAST_BUILD # automatic module build |
73 |
# |
74 |
# - AP_GENPLIST # automatic PLIST generation plus add |
75 |
# # the module disabled into httpd.conf |
76 |
# # (only if no pkg-plist exist) |
77 |
# |
78 |
# - MODULENAME # default: ${PORTNAME} |
79 |
# - SHORTMODNAME # default: ${MODULENAME:S/mod_//} |
80 |
# - SRC_FILE # default: ${MODULENAME}.c |
81 |
# |
82 |
# |
83 |
|
75 |
|
84 |
.if !defined(Apache_Pre_Include) |
76 |
.if !defined(_INCLUDE_USES_APACHE_PRE_MK) |
|
|
77 |
_INCLUDE_USES_APACHE_PRE_MK= yes |
78 |
_USES_POST+= apache |
85 |
|
79 |
|
86 |
Apache_Pre_Include= bsd.apache.mk |
|
|
87 |
|
88 |
.if defined(DEFAULT_APACHE_VER) |
89 |
WARNING+= "DEFAULT_APACHE_VER is defined, consider using DEFAULT_VERSIONS+=apache=${DEFAULT_APACHE_VER} instead" |
90 |
.endif |
91 |
|
92 |
DEFAULT_APACHE_VERSION?= ${APACHE_DEFAULT:S/.//} |
93 |
# When adding a version, please keep the comment in |
80 |
# When adding a version, please keep the comment in |
94 |
# Mk/bsd.default-versions.mk in sync. |
81 |
# Mk/bsd.default-versions.mk in sync. |
95 |
APACHE_SUPPORTED_VERSION= 24 22 # preferred version first |
82 |
_APACHE_SUPPORTED_VERSIONS= 2.4 2.2 2.5 # preferred version first |
96 |
|
83 |
|
97 |
# Print warnings |
84 |
# Print warnings |
98 |
_ERROR_MSG= : Error from bsd.apache.mk. |
85 |
_ERROR_MSG= : Error from apache.mk. |
99 |
|
86 |
|
100 |
# Important Note: |
87 |
# Important Note: |
101 |
# Keep apache version in ascending order! |
|
|
102 |
# The "+" sign is only valid as last sign, not between |
88 |
# The "+" sign is only valid as last sign, not between |
103 |
# two versions or in combination with range! |
89 |
# two versions or in combination with range! |
104 |
.if defined(USE_APACHE) && !empty(USE_APACHE) |
90 |
.if defined(apache_ARGS) && !empty(apache_ARGS) |
105 |
. if ${USE_APACHE:Mcommon*} != "" |
91 |
# Preserve original arguments list |
106 |
AP_PORT_IS_SERVER= yes |
92 |
_APACHE_ARGS= ${apache_ARGS} |
107 |
. elif ${USE_APACHE:C/\-//:S/^22//:S/^24//:C/\+$//} == "" |
93 |
. if ${_APACHE_ARGS:Mserver} |
108 |
AP_PORT_IS_MODULE= yes |
94 |
_APACHE_PORT_IS_SERVER= yes |
109 |
. if ${USE_APACHE:C/\-//:S/^22//:S/^24//} == "+" |
95 |
_APACHE_ARGS:= ${_APACHE_ARGS:Nserver} |
110 |
AP_PLUS= yes |
|
|
111 |
. endif |
112 |
. else |
113 |
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} ) |
114 |
. endif |
96 |
. endif |
115 |
# Catch unknown apache versions and silly USE_APACHE constructs |
97 |
. if ${_APACHE_ARGS:Mbuild} |
116 |
. if empty(AP_PORT_IS_SERVER) && empty(AP_PORT_IS_MODULE) |
98 |
_APACHE_BUILD_DEP= yes |
117 |
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} ) |
99 |
_APACHE_ARGS:= ${_APACHE_ARGS:Nbuild} |
118 |
. endif |
100 |
. endif |
119 |
# Catch USE_APACHE [min]-[max]+ |
101 |
. if ${_APACHE_ARGS:Mrun} |
120 |
. if defined(AP_PLUS) && ${USE_APACHE:C/[.+0-9]//g} == "-" |
102 |
_APACHE_RUN_DEP= yes |
121 |
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} ) |
103 |
_APACHE_ARGS:= ${_APACHE_ARGS:Nrun} |
122 |
. endif |
104 |
. endif |
123 |
.elif defined(USE_APACHE) |
105 |
. if empty(_APACHE_ARGS) |
124 |
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE ( no version specified ) |
106 |
_APACHE_ARGS= ${APACHE_DEFAULT} |
125 |
.endif # defined(USE_APACHE) |
107 |
. endif |
|
|
108 |
# _APACHE_ARGS must now contain a version(-range) |
109 |
. if !empty(_APACHE_ARGS:C/^2\.[0-9]//:S/^-//:C/^2\.[0-9]//:C/\+$//) |
110 |
IGNORE= ${_ERROR_MSG} Illegal use of USES= ${USES:Mapache*} |
111 |
# Catch USES= apache:[min]-[max]+ |
112 |
. elif ${apache_ARGS:C/[.a-z0-9]//g} == "-+" |
113 |
IGNORE= ${_ERROR_MSG} Illegal use of USES= ${USES:Mapache*} |
114 |
. endif |
115 |
.endif # defined(apache_ARGS) |
126 |
|
116 |
|
|
|
117 |
# The port does not specify a build, run or server dependency, assume both |
118 |
# build and run are required. |
119 |
.if !defined(_APACHE_BUILD_DEP) && !defined(_APACHE_RUN_DEP) && \ |
120 |
!defined(_APACHE_PORT_IS_SERVER) |
121 |
_APACHE_BUILD_DEP= yes |
122 |
_APACHE_RUN_DEP= yes |
123 |
.endif |
124 |
|
125 |
.if defined(DEFAULT_APACHE_VER) |
126 |
IGNORE+= "DEFAULT_APACHE_VER is defined, consider using DEFAULT_VERSIONS+=apache=${DEFAULT_APACHE_VER} instead" |
127 |
.endif |
128 |
|
129 |
.if defined(WITH_MODULES) || defined(WITHOUT_MODULES) |
130 |
IGNORE= ${_ERROR_MSG} WITH(OUT)_MODULES has been removed, use www_${PORTNAME}_(UN)SET |
131 |
.endif |
132 |
|
127 |
# =============================================================== |
133 |
# =============================================================== |
128 |
.if defined(AP_PORT_IS_SERVER) |
134 |
.if defined(_APACHE_PORT_IS_SERVER) |
|
|
135 |
|
129 |
# Module selection |
136 |
# Module selection |
130 |
.for category in ${DEFAULT_MODULES_CATEGORIES} |
137 |
.for category in ${DEFAULT_MODULES_CATEGORIES} |
131 |
DEFAULT_MODULES+= ${${category}_MODULES} |
138 |
DEFAULT_MODULES+= ${${category}_MODULES} |
Lines 135-171
Link Here
|
135 |
AVAILABLE_MODULES+= ${${category}_MODULES} |
142 |
AVAILABLE_MODULES+= ${${category}_MODULES} |
136 |
.endfor |
143 |
.endfor |
137 |
|
144 |
|
138 |
# detect invalid lowercase params in make.conf |
|
|
139 |
# keep this check until end of 2012 |
140 |
.if defined(WITH_STATIC_MODULES) && ${WITH_STATIC_MODULES:M[a-z]*} |
141 |
IGNORE= lowercase WITH_STATIC_MODULES="${WITH_STATIC_MODULES}"\ |
142 |
detected (make.conf), they shoud be UPPERCASE |
143 |
.endif |
144 |
|
145 |
# Setting "@comment " as default. |
146 |
.for module in ${AVAILABLE_MODULES:O} |
147 |
${module}PLIST_SUB= "@comment " |
148 |
_DISABLE_MODULES+= --disable-${module:tl} |
149 |
.endfor |
150 |
|
151 |
# Configure |
152 |
# dirty hacks to make sure all modules are disabled before we select them |
153 |
.if ${USE_APACHE:Mcommon2*} |
154 |
CONFIGURE_ARGS+= ${_DISABLE_MODULES:O:u} |
155 |
.endif |
156 |
|
157 |
# OPTIONS handling |
145 |
# OPTIONS handling |
158 |
.for module in ${AVAILABLE_MODULES} |
146 |
.for module in ${AVAILABLE_MODULES} |
159 |
. if ${PORT_OPTIONS:M${module}} |
147 |
. if ${PORT_OPTIONS:M${module}} |
160 |
_APACHE_MODULES+= ${module} |
148 |
_APACHE_ENABLED_MODS+= ${module} |
161 |
. else |
149 |
. else |
162 |
WITHOUT_MODULES+= ${module} |
150 |
_APACHE_DISABLED_MODS+= ${module} |
163 |
. endif |
151 |
. endif |
164 |
.endfor |
152 |
.endfor |
165 |
|
153 |
|
166 |
.if !defined(WITH_STATIC_APACHE) |
154 |
.if !defined(WITH_STATIC_APACHE) |
167 |
# FYI |
|
|
168 |
#DYNAMIC_MODULES= so |
169 |
CONFIGURE_ARGS+= --enable-so |
155 |
CONFIGURE_ARGS+= --enable-so |
170 |
.else |
156 |
.else |
171 |
CONFIGURE_ARGS+= --disable-so |
157 |
CONFIGURE_ARGS+= --disable-so |
Lines 173-179
Link Here
|
173 |
.endif |
159 |
.endif |
174 |
|
160 |
|
175 |
.if ${PORT_OPTIONS:MSUEXEC} |
161 |
.if ${PORT_OPTIONS:MSUEXEC} |
176 |
_APACHE_MODULES+= ${SUEXEC_MODULES} |
162 |
_APACHE_ENABLED_MODS+= ${SUEXEC_MODULES} |
177 |
SUEXEC_CONFARGS= with-suexec |
163 |
SUEXEC_CONFARGS= with-suexec |
178 |
|
164 |
|
179 |
# SUEXEC_DOCROOT should exist |
165 |
# SUEXEC_DOCROOT should exist |
Lines 204-257
Link Here
|
204 |
. endif |
190 |
. endif |
205 |
.endif |
191 |
.endif |
206 |
|
192 |
|
207 |
.if !defined(WITHOUT_MODULES) |
193 |
.if !defined(_APACHE_DISABLED_MODS) |
208 |
APACHE_MODULES= ${_APACHE_MODULES} |
194 |
APACHE_MODULES= ${_APACHE_ENABLED_MODS} |
209 |
.else |
195 |
.else |
210 |
.for module in ${_APACHE_MODULES:O:u} |
196 |
.for module in ${_APACHE_ENABLED_MODS:O:u} |
211 |
. if !${WITHOUT_MODULES:M${module}} |
197 |
. if !${_APACHE_DISABLED_MODS:M${module}} |
212 |
APACHE_MODULES+= ${module} |
198 |
APACHE_MODULES+= ${module} |
213 |
. endif |
199 |
. endif |
214 |
.endfor |
200 |
.endfor |
215 |
.endif |
201 |
.endif |
216 |
|
202 |
|
217 |
.if defined(WITH_STATIC_MODULES) |
203 |
.if defined(WITH_STATIC_APACHE) || defined(WITH_ALL_STATIC_MODULES) |
218 |
.for module in ${APACHE_MODULES} |
|
|
219 |
. if ${WITH_STATIC_MODULES:M${module}} |
220 |
_CONFIGURE_ARGS+= --enable-${module:tl}=static |
221 |
. else |
222 |
_CONFIGURE_ARGS+= --enable-${module:tl}=shared |
223 |
. endif |
224 |
.endfor |
225 |
CONFIGURE_ARGS+= ${_CONFIGURE_ARGS:O} |
226 |
.elif defined(WITH_STATIC_APACHE) || defined(WITH_ALL_STATIC_MODULES) |
227 |
WITH_STATIC_MODULES= ${APACHE_MODULES} |
204 |
WITH_STATIC_MODULES= ${APACHE_MODULES} |
228 |
CONFIGURE_ARGS+= --enable-modules="${APACHE_MODULES:O:tl}" |
|
|
229 |
.else |
230 |
CONFIGURE_ARGS+= --enable-mods-shared="${APACHE_MODULES:O:tl}" |
231 |
.endif |
205 |
.endif |
232 |
|
206 |
|
233 |
# ==================================== |
207 |
.for module in ${AVAILABLE_MODULES} |
234 |
# start pkg-plist adjustments |
208 |
. if !empty(WITH_STATIC_MODULES:M${module}) |
235 |
.if defined(WITH_STATIC_MODULES) |
209 |
CONFIGURE_ARGS+= --enable-${module:tl}=static |
236 |
.for module in ${APACHE_MODULES} |
210 |
PLIST_SUB+= MOD_${module}="@comment " |
237 |
. if !${WITH_STATIC_MODULES:M${module}} |
211 |
. elif !empty(APACHE_MODULES:M${module}) |
238 |
_SHARED_MODULES+= ${module} |
212 |
CONFIGURE_ARGS+= --enable-${module:tl}=shared |
|
|
213 |
PLIST_SUB+= MOD_${module}="" |
214 |
. else |
215 |
CONFIGURE_ARGS+= --disable-${module:tl} |
216 |
PLIST_SUB+= MOD_${module}="@comment " |
239 |
. endif |
217 |
. endif |
240 |
.endfor |
218 |
.endfor |
241 |
|
219 |
|
242 |
SHARED_MODULES= ${_SHARED_MODULES} |
|
|
243 |
.elif !defined(WITH_ALL_STATIC_MODULES) |
244 |
SHARED_MODULES= ${APACHE_MODULES} |
245 |
.endif |
246 |
|
247 |
.for module in ${SHARED_MODULES} |
248 |
${module}PLIST_SUB= "" |
249 |
.endfor |
250 |
|
251 |
.for module in ${AVAILABLE_MODULES:O:u} |
252 |
PLIST_SUB+= MOD_${module}=${${module}PLIST_SUB} |
253 |
.endfor |
254 |
|
255 |
# pkg-plist workaround STATIC support |
220 |
# pkg-plist workaround STATIC support |
256 |
.if ${PORT_OPTIONS:MSUEXEC} |
221 |
.if ${PORT_OPTIONS:MSUEXEC} |
257 |
PLIST_SUB+= SUEXEC="" |
222 |
PLIST_SUB+= SUEXEC="" |
Lines 265-277
Link Here
|
265 |
PLIST_SUB+= FORENSIC="@comment " |
230 |
PLIST_SUB+= FORENSIC="@comment " |
266 |
.endif |
231 |
.endif |
267 |
|
232 |
|
268 |
# end pkg-plist adjustments |
233 |
#### End of _APACHE_PORT_IS_SERVER #### |
269 |
|
234 |
|
270 |
#### End of AP_PORT_IS_SERVER #### |
|
|
271 |
|
272 |
# =============================================================== |
235 |
# =============================================================== |
273 |
.elif defined(AP_PORT_IS_MODULE) || defined(USE_APACHE_RUN) || defined(USE_APACHE_BUILD) |
236 |
.else |
274 |
APXS?= ${LOCALBASE}/sbin/apxs |
|
|
275 |
HTTPD?= ${LOCALBASE}/sbin/httpd |
237 |
HTTPD?= ${LOCALBASE}/sbin/httpd |
276 |
|
238 |
|
277 |
MODULENAME?= ${PORTNAME} |
239 |
MODULENAME?= ${PORTNAME} |
Lines 279-357
Link Here
|
279 |
SRC_FILE?= ${MODULENAME}.c |
241 |
SRC_FILE?= ${MODULENAME}.c |
280 |
|
242 |
|
281 |
.if exists(${HTTPD}) |
243 |
.if exists(${HTTPD}) |
282 |
_APACHE_VERSION!= ${HTTPD} -v | ${SED} -ne 's/^Server version: Apache\/\([0-9]\)\.\([0-9]*\).*/\1\2/p' |
244 |
_APACHE_VERSION!= ${HTTPD} -v | ${SED} -ne 's/^Server version: Apache\/\([1-9]\.[0-9]*\).*/\1/p' |
283 |
.elif defined(APACHE_PORT) |
|
|
284 |
_APACHE_VERSION!= ${ECHO_CMD} ${APACHE_PORT} | ${SED} -ne 's,.*/apache\([0-9]*\).*,\1,p' |
285 |
.endif |
245 |
.endif |
286 |
|
246 |
|
287 |
.if defined(USE_APACHE) |
247 |
# Validate Apache version whether it meets the version restriction. |
288 |
_USE_APACHE:= ${USE_APACHE} |
248 |
_APACHE_VERSION_CHECK:= ${_APACHE_ARGS:C/^([1-9]\.[0-9])$/\1-\1/} |
289 |
.elif defined(USE_APACHE_BUILD) |
249 |
_APACHE_VERSION_MIN_TMP:= ${_APACHE_VERSION_CHECK:C/([1-9]\.[0-9])[-+].*/\1/} |
290 |
_USE_APACHE:= ${USE_APACHE_BUILD} |
250 |
_APACHE_VERSION_MIN:= ${_APACHE_VERSION_MIN_TMP:M[1-9].[0-9]} |
291 |
.elif defined(USE_APACHE_RUN) |
251 |
_APACHE_VERSION_MAX_TMP:= ${_APACHE_VERSION_CHECK:C/.*-([1-9]\.[0-9])/\1/} |
292 |
_USE_APACHE:= ${USE_APACHE_RUN} |
252 |
_APACHE_VERSION_MAX:= ${_APACHE_VERSION_MAX_TMP:M[1-9].[0-9]} |
293 |
.endif |
|
|
294 |
|
253 |
|
295 |
_APACHE_VERSION_CHECK:= ${_USE_APACHE:C/^([1-9][0-9])$/\1-\1/} |
254 |
# Remove from _WANTED_VERSIONS that which is not wanted |
296 |
_APACHE_VERSION_MINIMUM_TMP:= ${_APACHE_VERSION_CHECK:C/([1-9][0-9])[-+].*/\1/} |
255 |
_APACHE_WANTED_VERSIONS= ${_APACHE_SUPPORTED_VERSIONS} |
297 |
_APACHE_VERSION_MINIMUM:= ${_APACHE_VERSION_MINIMUM_TMP:M[1-9][0-9]} |
256 |
.for _ver in ${_APACHE_SUPPORTED_VERSIONS:O} |
298 |
_APACHE_VERSION_MAXIMUM_TMP:= ${_APACHE_VERSION_CHECK:C/.*-([1-9][0-9])/\1/} |
257 |
. if !empty(_APACHE_VERSION_MIN) && ${_ver} < ${_APACHE_VERSION_MIN} |
299 |
_APACHE_VERSION_MAXIMUM:= ${_APACHE_VERSION_MAXIMUM_TMP:M[1-9][0-9]} |
258 |
_APACHE_WANTED_VERSIONS:= ${_APACHE_WANTED_VERSIONS:N${_ver}} |
300 |
|
|
|
301 |
# ============================================================== |
302 |
# num+ |
303 |
.if ${_USE_APACHE:M*+} |
304 |
_APACHE_WANTED_VERSIONS= ${DEFAULT_APACHE_VERSION} |
305 |
|
306 |
# -num |
307 |
.elif ${_USE_APACHE:M\-[0-9][0-9]} |
308 |
.for _v in ${APACHE_SUPPORTED_VERSION:O} |
309 |
. if ${_APACHE_VERSION_MAXIMUM} >= ${_v} |
310 |
_APACHE_WANTED_VERSIONS+= ${_v} |
311 |
. endif |
259 |
. endif |
312 |
.endfor |
260 |
. if !empty(_APACHE_VERSION_MAX) && ${_ver} > ${_APACHE_VERSION_MAX} |
313 |
|
261 |
_APACHE_WANTED_VERSIONS:= ${_APACHE_WANTED_VERSIONS:N${_ver}} |
314 |
# num-num |
|
|
315 |
.elif ${_USE_APACHE:M[0-9][0-9]-[0-9][0-9]} |
316 |
.for _v in ${APACHE_SUPPORTED_VERSION} |
317 |
. if ${_APACHE_VERSION_MINIMUM} <= ${_v} && ${_APACHE_VERSION_MAXIMUM} >= ${_v} |
318 |
_APACHE_WANTED_VERSIONS+= ${_v} |
319 |
. endif |
262 |
. endif |
320 |
.endfor |
263 |
.endfor |
321 |
|
264 |
|
322 |
# num |
265 |
# Check if installed Apache version matches a wanted version |
323 |
.elif ${_USE_APACHE:M[0-9][0-9]} |
266 |
.if defined(_APACHE_VERSION) && $(_APACHE_WANTED_VERSIONS:M${_APACHE_VERSION}) |
324 |
_APACHE_WANTED_VERSIONS= ${_USE_APACHE:M[0-9][0-9]} |
267 |
_APACHE_WANTED_VERSION= ${_APACHE_VERSION} |
325 |
.endif |
268 |
.endif |
326 |
# ============================================================== |
269 |
# Select Apache version if not already set |
327 |
|
270 |
.for _ver in ${APACHE_DEFAULT} ${_APACHE_SUPPORTED_VERSIONS} |
328 |
.if !defined(_APACHE_WANTED_VERSIONS) |
271 |
. if !defined(_APACHE_WANTED_VERSION) && ${_APACHE_WANTED_VERSIONS:M${_ver}} |
329 |
_APACHE_WANTED_VERSIONS= ${DEFAULT_APACHE_VERSION} |
272 |
_APACHE_WANTED_VERSION= ${_ver} |
330 |
.endif |
|
|
331 |
|
332 |
.for _v in ${_APACHE_WANTED_VERSIONS:O:u} |
333 |
_APACHE_HIGHEST_VERSION:= ${_v} |
334 |
. if defined (_APACHE_VERSION) && ${_APACHE_VERSION} == ${_v} |
335 |
_APACHE_WANTED_VERSION:= ${_v} |
336 |
. endif |
273 |
. endif |
337 |
.endfor |
274 |
.endfor |
338 |
|
275 |
|
339 |
.if !defined(_APACHE_WANTED_VERSION) |
276 |
.if defined(_APACHE_VERSION) && ${_APACHE_VERSION} != ${APACHE_VERSION} |
340 |
# next line is broken on 8.x and 9.x but working on 10 |
277 |
BROKEN= ${_ERROR_MSG} Apache ${_APACHE_VERSION} is installed and port requires ${_APACHE_WANTED_VERSION} |
341 |
#_APACHE_WANTED_VERSION:= ${_APACHE_WANTED_VERSIONS:O:u:M${DEFAULT_APACHE_VERSION}} |
|
|
342 |
# working line on 8.x, 9.x, 10 |
343 |
_APACHE_WANTED_VERSION:= ${_APACHE_WANTED_VERSIONS:O:u:MDEFAULT_APACHE_VERSION} |
344 |
. if empty(_APACHE_WANTED_VERSION) |
345 |
_APACHE_WANTED_VERSION:= ${_APACHE_HIGHEST_VERSION} |
346 |
. endif |
347 |
.endif |
278 |
.endif |
348 |
|
279 |
|
349 |
.if defined(_APACHE_VERSION) && ${_APACHE_VERSION} != ${_APACHE_WANTED_VERSION} |
280 |
APACHE_VERSION:= ${_APACHE_WANTED_VERSION} |
350 |
BROKEN= ${_ERROR_MSG} apache${_APACHE_VERSION} is installed (or APACHE_PORT is defined) and port requires apache${_APACHE_VERSION_NONSUPPORTED} |
281 |
|
|
|
282 |
.if ${APACHE_VERSION} >= 2.5 |
283 |
APXS?= ${LOCALBASE}/bin/apxs |
284 |
.else |
285 |
APXS?= ${LOCALBASE}/sbin/apxs |
351 |
.endif |
286 |
.endif |
352 |
|
287 |
|
353 |
APACHE_VERSION:= ${_APACHE_WANTED_VERSION} |
|
|
354 |
|
355 |
.if exists(${APXS}) |
288 |
.if exists(${APXS}) |
356 |
APXS_PREFIX!= ${APXS} -q prefix 2> /dev/null || echo NULL |
289 |
APXS_PREFIX!= ${APXS} -q prefix 2> /dev/null || echo NULL |
357 |
. if ${APXS_PREFIX} == NULL |
290 |
. if ${APXS_PREFIX} == NULL |
Lines 362-371
Link Here
|
362 |
. endif |
295 |
. endif |
363 |
.endif |
296 |
.endif |
364 |
|
297 |
|
365 |
APACHEMODDIR= libexec/apache${APACHE_VERSION} |
298 |
APACHEMODDIR= libexec/apache${APACHE_VERSION:S/.//} |
366 |
APACHEINCLUDEDIR=include/apache${APACHE_VERSION} |
299 |
APACHEINCLUDEDIR= include/apache${APACHE_VERSION:S/.//} |
367 |
APACHEETCDIR= etc/apache${APACHE_VERSION} |
300 |
APACHEETCDIR= etc/apache${APACHE_VERSION:S/.//} |
368 |
APACHE_PORT?= www/apache${APACHE_VERSION} |
301 |
.if ${APACHE_VERSION} == 2.5 |
|
|
302 |
APACHE_PORT?= www/apache${APACHE_VERSION:S/.//}-devel |
303 |
.else |
304 |
APACHE_PORT?= www/apache${APACHE_VERSION:S/.//} |
305 |
.endif |
369 |
|
306 |
|
370 |
PLIST_SUB+= APACHEMODDIR="${APACHEMODDIR}" \ |
307 |
PLIST_SUB+= APACHEMODDIR="${APACHEMODDIR}" \ |
371 |
APACHEINCLUDEDIR="${APACHEINCLUDEDIR}" \ |
308 |
APACHEINCLUDEDIR="${APACHEINCLUDEDIR}" \ |
Lines 376-392
Link Here
|
376 |
APACHEETCDIR="${APACHEETCDIR}" \ |
313 |
APACHEETCDIR="${APACHEETCDIR}" \ |
377 |
APACHE_VERSION="${APACHE_VERSION}" |
314 |
APACHE_VERSION="${APACHE_VERSION}" |
378 |
|
315 |
|
379 |
APACHE_PKGNAMEPREFIX= ap${APACHE_VERSION}- |
316 |
APACHE_PKGNAMEPREFIX= ap${APACHE_VERSION:S/.//}- |
380 |
|
317 |
|
381 |
.if defined(AP_FAST_BUILD) |
318 |
.if defined(AP_FAST_BUILD) |
382 |
PKGNAMEPREFIX?= ${APACHE_PKGNAMEPREFIX} |
319 |
PKGNAMEPREFIX?= ${APACHE_PKGNAMEPREFIX} |
383 |
.endif |
320 |
.endif |
384 |
|
321 |
|
385 |
.if defined(USE_APACHE) || defined(USE_APACHE_BUILD) |
322 |
.if defined(_APACHE_BUILD_DEP) |
386 |
BUILD_DEPENDS+= ${APXS}:${APACHE_PORT} |
323 |
BUILD_DEPENDS+= ${APXS}:${APACHE_PORT} |
387 |
.endif |
324 |
.endif |
388 |
|
325 |
|
389 |
.if defined(USE_APACHE) || defined(USE_APACHE_RUN) |
326 |
.if defined(_APACHE_RUN_DEP) |
390 |
RUN_DEPENDS+= ${APXS}:${APACHE_PORT} |
327 |
RUN_DEPENDS+= ${APXS}:${APACHE_PORT} |
391 |
.endif |
328 |
.endif |
392 |
|
329 |
|
Lines 404-444
Link Here
|
404 |
AP_EXTRAS+= -L ${AP_LIB} |
341 |
AP_EXTRAS+= -L ${AP_LIB} |
405 |
.endif |
342 |
.endif |
406 |
|
343 |
|
407 |
.endif # End of AP_PORT_IS_SERVER / AP_PORT_IS_MOULE |
344 |
.endif # End of _APACHE_PORT_IS_SERVER / _APACHE_PORT_IS_MOULE |
408 |
.endif # End of !Apache_Pre_Include |
345 |
.endif # End of !_INCLUDE_USES_APACHE_PRE_MK |
409 |
|
346 |
|
410 |
# =============================================================== |
347 |
# =============================================================== |
411 |
.if defined(_POSTMKINCLUDED) && !defined(Apache_Post_Include) |
348 |
.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_APACHE_POST_MK) |
412 |
Apache_Post_Include= bsd.apache.mk |
349 |
_INCLUDE_USES_APACHE_POST_MK= apache.mk |
413 |
|
350 |
.if defined(NO_BUILD) && !defined(_APACHE_RUN_DEP) |
414 |
.if defined(USE_APACHE_RUN) && !empty(USE_APACHE_RUN) |
351 |
BROKEN= If NO_BUILD is used, then apache:run is sufficient. Please fix your Makefile |
415 |
. if ${USE_APACHE_RUN:C/\-//:S/^22//:S/^24//:C/\+$//} != "" |
|
|
416 |
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE_RUN ( ${USE_APACHE_RUN} ) |
417 |
. endif |
418 |
.elif defined(USE_APACHE_RUN) |
419 |
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE_RUN ( no valid version specified ) |
420 |
.endif |
352 |
.endif |
421 |
|
353 |
|
422 |
.if defined(USE_APACHE_BUILD) && !empty(USE_APACHE_BUILD) |
354 |
.if defined(_APACHE_PORT_IS_SERVER) |
423 |
. if ${USE_APACHE_BUILD:C/\-//:S/^22//:S/^24//:C/\+$//} != "" |
|
|
424 |
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE_BUILD ( ${USE_APACHE_BUILD} ) |
425 |
. endif |
426 |
.elif defined(USE_APACHE_BUILD) |
427 |
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE_BUILD ( no valid version specified ) |
428 |
.endif |
429 |
|
430 |
# Check if USE_APACHE(_BUILD|_RUN) are mixed together |
431 |
.if defined(USE_APACHE) && ( defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN) ) |
432 |
IGNORE= ${_ERROR_MSG} specify only one of: USE_APACHE USE_APACHE_BUILD USE_APACHE_RUN |
433 |
.elif defined(USE_APACHE_BUILD) && defined(USE_APACHE_RUN) |
434 |
IGNORE= ${_ERROR_MSG} use USE_APACHE instead of USE_APACHE_BUILD and USE_APACHE_RUN together |
435 |
.endif |
436 |
|
437 |
.if defined(NO_BUILD) && defined(USE_APACHE) |
438 |
BROKEN= If NO_BUILD is used, then USE_APACHE_RUN is sufficient. Please fix your Makefile |
439 |
.endif |
440 |
|
441 |
.if defined(AP_PORT_IS_SERVER) |
442 |
.if !target(print-closest-mirrors) |
355 |
.if !target(print-closest-mirrors) |
443 |
print-closest-mirrors: |
356 |
print-closest-mirrors: |
444 |
@${ECHO_MSG} -n "Fetching list of nearest mirror: " >&2 |
357 |
@${ECHO_MSG} -n "Fetching list of nearest mirror: " >&2 |
Lines 474-480
Link Here
|
474 |
.endif |
387 |
.endif |
475 |
.endif |
388 |
.endif |
476 |
|
389 |
|
477 |
.elif defined(AP_PORT_IS_MODULE) |
390 |
.elif defined(_APACHE_PORT_IS_MODULE) |
478 |
|
391 |
|
479 |
.if defined(AP_MODENABLE) |
392 |
.if defined(AP_MODENABLE) |
480 |
AP_MOD_EN= -a |
393 |
AP_MOD_EN= -a |
Lines 516-520
Link Here
|
516 |
.endif |
429 |
.endif |
517 |
|
430 |
|
518 |
.endif # defined(AP_FAST_BUILD) |
431 |
.endif # defined(AP_FAST_BUILD) |
519 |
.endif # defined(AP_PORT_IS_SERVER / AP_PORT_IS_MODULE) |
432 |
.endif # defined(_APACHE_PORT_IS_SERVER / _APACHE_PORT_IS_MODULE) |
520 |
.endif # defined(_POSTMKINCLUDED) && !defined(Apache_Post_Include) |
433 |
.endif # defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_APACHE_PRE_MK) |