View | Details | Raw Unified | Return to bug 223691 | Differences between
and this patch

Collapse All | Expand All

(-)Mk/bsd.apache.mk (-520 lines)
Lines 1-520 Link Here
1
# $FreeBSD$
2
#
3
# bsd.apache.mk - Apache related macros.
4
# Author: Clement Laforet <clement@FreeBSD.org>
5
# Author: Olli Hauer <ohauer@FreeBSD.org>
6
#
7
# Please view me with 4 column tabs!
8
9
# =========================================================================
10
# User controlled parameters for usage in /etc/make.conf:
11
#
12
#  DEFAULT_VERSIONS  - define the default apache version
13
#                      valid args: apache=2.2, apache=2.4
14
#
15
#  APACHE_PORT       - use www/apache22-(event|itk|peruser|worker)-mpm
16
#                      instead www/apache22.  Use this parameter only in
17
#                      combination with "DEFAULT_VERSIONS+= apache=2.2"
18
#
19
# Example entry in /etc/make.conf:
20
# - Set apache22 as default version
21
#    DEFAULT_VERSIONS+= apache=2.2
22
#
23
# - Additional use a special www/apache22-$MPM port
24
#    APACHE_PORT= www/apache22-event-mpm
25
#
26
# Note:
27
#  - This parameters should never be used in the Makefile of a port!
28
#  - To get a list of "possible" APACHE_PORT values execute the command:
29
#    $> awk '/apache22-/ {print "www/" $3}' ports/www/Makefile
30
#
31
# =========================================================================
32
#
33
# This script will be included if one of the following parameter
34
# is defined in the Makefile of the port
35
#
36
# USE_APACHE         - Set apache and apxs as build and run dependency
37
# USE_APACHE_BUILD   - Set apache and apxs as build dependency
38
# USE_APACHE_RUN     - Set apache and apxs as run dependency
39
#
40
# The following example is representative of all three possible
41
# parameters to use.
42
#
43
# Examples:
44
#  USE_APACHE= 22       # specify exact version
45
#  USE_APACHE= 22+      # specify [min] version, no [max] version
46
#  USE_APACHE= 22-24    # specify [min]-[max] range
47
#  USE_APACHE= -22      # specify [max] version, no [min] version
48
#
49
# Note:
50
#  - If "+" is specified and no apache is installed, then
51
#    ${DEFAULT_APACHE_VERSION} will be used.
52
#
53
#  - Valid version numbers are specified in the variable
54
#    APACHE_SUPPORTED_VERSION below
55
#
56
#  - The following values for USE_APACHE are reserverd and only valid
57
#    in apache-server ports!
58
#      USE_APACHE= common22
59
#
60
#
61
# The following variables can be used (ro) in ports Makefile
62
# =========================================================================
63
#  - APACHE_VERSION
64
#  - APACHEETCDIR
65
#  - APACHEINCLUDEDIR
66
#  - APACHEMODDIR
67
#  - DEFAULT_APACHE_VERSION
68
#
69
#
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
84
.if !defined(Apache_Pre_Include)
85
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
94
# Mk/bsd.default-versions.mk in sync.
95
APACHE_SUPPORTED_VERSION=	24 22 # preferred version first
96
97
# Print warnings
98
_ERROR_MSG=	: Error from bsd.apache.mk.
99
100
# Important Note:
101
#  Keep apache version in ascending order!
102
#  The "+" sign is only valid as last sign, not between
103
#  two versions or in combination with range!
104
.if defined(USE_APACHE) && !empty(USE_APACHE)
105
.	if ${USE_APACHE:Mcommon*} != ""
106
AP_PORT_IS_SERVER=	yes
107
.	elif ${USE_APACHE:C/\-//:S/^22//:S/^24//:C/\+$//} == ""
108
AP_PORT_IS_MODULE=	yes
109
.		if ${USE_APACHE:C/\-//:S/^22//:S/^24//} == "+"
110
AP_PLUS=	yes
111
.		endif
112
.	else
113
IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} )
114
.	endif
115
# Catch unknown apache versions and silly USE_APACHE constructs
116
.	if empty(AP_PORT_IS_SERVER) && empty(AP_PORT_IS_MODULE)
117
IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} )
118
.	endif
119
# Catch USE_APACHE [min]-[max]+
120
.	if defined(AP_PLUS) && ${USE_APACHE:C/[.+0-9]//g} == "-"
121
IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} )
122
.	endif
123
.elif defined(USE_APACHE)
124
IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( no version specified )
125
.endif # defined(USE_APACHE)
126
127
# ===============================================================
128
.if defined(AP_PORT_IS_SERVER)
129
# Module selection
130
.for category in ${DEFAULT_MODULES_CATEGORIES}
131
DEFAULT_MODULES+=	${${category}_MODULES}
132
.endfor
133
134
.for category in ${ALL_MODULES_CATEGORIES}
135
AVAILABLE_MODULES+=	${${category}_MODULES}
136
.endfor
137
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
158
.for module in ${AVAILABLE_MODULES}
159
.	if ${PORT_OPTIONS:M${module}}
160
_APACHE_MODULES+=	${module}
161
.	else
162
WITHOUT_MODULES+=	${module}
163
.	endif
164
.endfor
165
166
.if !defined(WITH_STATIC_APACHE)
167
# FYI
168
#DYNAMIC_MODULES=	so
169
CONFIGURE_ARGS+=	--enable-so
170
.else
171
CONFIGURE_ARGS+=	--disable-so
172
WITH_ALL_STATIC_MODULES=	yes
173
.endif
174
175
.if ${PORT_OPTIONS:MSUEXEC}
176
_APACHE_MODULES+=	${SUEXEC_MODULES}
177
SUEXEC_CONFARGS=	with-suexec
178
179
# SUEXEC_DOCROOT should exist
180
SUEXEC_DOCROOT?=	${PREFIX}/www/data
181
#SUEXEC_DOCROOT?=	${WWWDIR}
182
SUEXEC_USERDIR?=	public_html
183
# avoid duplicate search paths
184
.if ${LOCALBASE} == ${PREFIX}
185
SUEXEC_SAFEPATH?=	${LOCALBASE}/bin:/usr/bin:/bin
186
.else
187
SUEXEC_SAFEPATH?=	${PREFIX}/bin:${LOCALBASE}/bin:/usr/bin:/bin
188
.endif
189
SUEXEC_LOGFILE?=	/var/log/httpd-suexec.log
190
SUEXEC_UIDMIN?=		1000
191
SUEXEC_GIDMIN?=		1000
192
SUEXEC_CALLER?=		${WWWOWN}
193
CONFIGURE_ARGS+=	--${SUEXEC_CONFARGS}-caller=${SUEXEC_CALLER} \
194
			--${SUEXEC_CONFARGS}-uidmin=${SUEXEC_UIDMIN} \
195
			--${SUEXEC_CONFARGS}-gidmin=${SUEXEC_GIDMIN} \
196
			--${SUEXEC_CONFARGS}-userdir="${SUEXEC_USERDIR}" \
197
			--${SUEXEC_CONFARGS}-docroot="${SUEXEC_DOCROOT}" \
198
			--${SUEXEC_CONFARGS}-safepath="${SUEXEC_SAFEPATH}" \
199
			--${SUEXEC_CONFARGS}-logfile="${SUEXEC_LOGFILE}" \
200
			--${SUEXEC_CONFARGS}-bin="${PREFIX}/sbin/suexec"
201
202
.	if defined(WITH_SUEXEC_UMASK)
203
CONFIGURE_ARGS+=	--${SUEXEC_CONFARGS}-umask=${SUEXEC_UMASK}
204
.	endif
205
.endif
206
207
.if !defined(WITHOUT_MODULES)
208
APACHE_MODULES=		${_APACHE_MODULES}
209
.else
210
.for module in ${_APACHE_MODULES:O:u}
211
.	if !${WITHOUT_MODULES:M${module}}
212
APACHE_MODULES+=	${module}
213
.	endif
214
.endfor
215
.endif
216
217
.if defined(WITH_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}
228
CONFIGURE_ARGS+=	--enable-modules="${APACHE_MODULES:O:tl}"
229
.else
230
CONFIGURE_ARGS+=	--enable-mods-shared="${APACHE_MODULES:O:tl}"
231
.endif
232
233
# ====================================
234
# start pkg-plist adjustments
235
.if defined(WITH_STATIC_MODULES)
236
.for module in ${APACHE_MODULES}
237
.	if !${WITH_STATIC_MODULES:M${module}}
238
_SHARED_MODULES+=	${module}
239
.	endif
240
.endfor
241
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
256
.if ${PORT_OPTIONS:MSUEXEC}
257
PLIST_SUB+=	SUEXEC=""
258
.else
259
PLIST_SUB+=	SUEXEC="@comment "
260
.endif
261
262
.if ${PORT_OPTIONS:MLOG_FORENSIC}
263
PLIST_SUB+=	FORENSIC=""
264
.else
265
PLIST_SUB+=	FORENSIC="@comment "
266
.endif
267
268
# end pkg-plist adjustments
269
270
#### End of AP_PORT_IS_SERVER ####
271
272
# ===============================================================
273
.elif defined(AP_PORT_IS_MODULE) || defined(USE_APACHE_RUN) || defined(USE_APACHE_BUILD)
274
APXS?=		${LOCALBASE}/sbin/apxs
275
HTTPD?=		${LOCALBASE}/sbin/httpd
276
277
MODULENAME?=	${PORTNAME}
278
SHORTMODNAME?=	${MODULENAME:S/mod_//}
279
SRC_FILE?=	${MODULENAME}.c
280
281
.if exists(${HTTPD})
282
_APACHE_VERSION!=	${HTTPD} -v | ${SED} -ne 's/^Server version: Apache\/\([0-9]\)\.\([0-9]*\).*/\1\2/p'
283
.elif defined(APACHE_PORT)
284
_APACHE_VERSION!=	${ECHO_CMD} ${APACHE_PORT} | ${SED} -ne 's,.*/apache\([0-9]*\).*,\1,p'
285
.endif
286
287
.if defined(USE_APACHE)
288
_USE_APACHE:=	${USE_APACHE}
289
.elif defined(USE_APACHE_BUILD)
290
_USE_APACHE:=	${USE_APACHE_BUILD}
291
.elif defined(USE_APACHE_RUN)
292
_USE_APACHE:=	${USE_APACHE_RUN}
293
.endif
294
295
_APACHE_VERSION_CHECK:=		${_USE_APACHE:C/^([1-9][0-9])$/\1-\1/}
296
_APACHE_VERSION_MINIMUM_TMP:=	${_APACHE_VERSION_CHECK:C/([1-9][0-9])[-+].*/\1/}
297
_APACHE_VERSION_MINIMUM:=	${_APACHE_VERSION_MINIMUM_TMP:M[1-9][0-9]}
298
_APACHE_VERSION_MAXIMUM_TMP:=	${_APACHE_VERSION_CHECK:C/.*-([1-9][0-9])/\1/}
299
_APACHE_VERSION_MAXIMUM:=	${_APACHE_VERSION_MAXIMUM_TMP:M[1-9][0-9]}
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
312
.endfor
313
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
320
.endfor
321
322
# num
323
.elif ${_USE_APACHE:M[0-9][0-9]}
324
_APACHE_WANTED_VERSIONS=	${_USE_APACHE:M[0-9][0-9]}
325
.endif
326
# ==============================================================
327
328
.if !defined(_APACHE_WANTED_VERSIONS)
329
_APACHE_WANTED_VERSIONS=	${DEFAULT_APACHE_VERSION}
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
337
.endfor
338
339
.if !defined(_APACHE_WANTED_VERSION)
340
# next line is broken on 8.x and 9.x but working on 10
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
348
349
.if defined(_APACHE_VERSION) && ${_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}
351
.endif
352
353
APACHE_VERSION:=	${_APACHE_WANTED_VERSION}
354
355
.if exists(${APXS})
356
APXS_PREFIX!=	${APXS} -q prefix 2> /dev/null || echo NULL
357
.	if ${APXS_PREFIX} == NULL
358
IGNORE=	: Your apache does not support DSO modules
359
.	endif
360
.	if defined(AP_GENPLIST) && ${APXS_PREFIX} != ${PREFIX}
361
IGNORE?=	PREFIX must be equal to APXS_PREFIX.
362
.	endif
363
.endif
364
365
APACHEMODDIR=	libexec/apache${APACHE_VERSION}
366
APACHEINCLUDEDIR=include/apache${APACHE_VERSION}
367
APACHEETCDIR=	etc/apache${APACHE_VERSION}
368
APACHE_PORT?=	www/apache${APACHE_VERSION}
369
370
PLIST_SUB+=	APACHEMODDIR="${APACHEMODDIR}" \
371
		APACHEINCLUDEDIR="${APACHEINCLUDEDIR}" \
372
		APACHEETCDIR="${APACHEETCDIR}" \
373
		APACHE_VERSION="${APACHE_VERSION}"
374
375
SUB_LIST+=	APACHEMODDIR="${APACHEMODDIR}" \
376
		APACHEETCDIR="${APACHEETCDIR}" \
377
		APACHE_VERSION="${APACHE_VERSION}"
378
379
APACHE_PKGNAMEPREFIX=	ap${APACHE_VERSION}-
380
381
.if defined(AP_FAST_BUILD)
382
PKGNAMEPREFIX?=	${APACHE_PKGNAMEPREFIX}
383
.endif
384
385
.if defined(USE_APACHE) || defined(USE_APACHE_BUILD)
386
BUILD_DEPENDS+=	${APXS}:${APACHE_PORT}
387
.endif
388
389
.if defined(USE_APACHE) || defined(USE_APACHE_RUN)
390
RUN_DEPENDS+=	${APXS}:${APACHE_PORT}
391
.endif
392
393
PLIST_SUB+=	AP_NAME="${SHORTMODNAME}"
394
PLIST_SUB+=	AP_MODULE="${MODULENAME}.so"
395
396
.if defined(AP_GENPLIST)
397
PLIST?=		${WRKDIR}/ap-plist
398
.endif
399
400
.if defined(AP_INC)
401
AP_EXTRAS+=	-I ${AP_INC}
402
.endif
403
.if defined(AP_LIB)
404
AP_EXTRAS+=	-L ${AP_LIB}
405
.endif
406
407
.endif # End of AP_PORT_IS_SERVER   / AP_PORT_IS_MOULE
408
.endif # End of !Apache_Pre_Include
409
410
# ===============================================================
411
.if defined(_POSTMKINCLUDED) && !defined(Apache_Post_Include)
412
Apache_Post_Include=	bsd.apache.mk
413
414
.if defined(USE_APACHE_RUN) && !empty(USE_APACHE_RUN)
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
421
422
.if defined(USE_APACHE_BUILD) && !empty(USE_APACHE_BUILD)
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)
443
print-closest-mirrors:
444
	@${ECHO_MSG} -n "Fetching list of nearest mirror: " >&2
445
	@MIRRORS=`${FETCH_CMD} -T 30 -qo - http://www.apache.org/dyn/closer.cgi/httpd/ 2> /dev/null\
446
	| ${GREP} /httpd/ | ${SED} 's/.*href="\(.*\)"><str.*/\1/g' | \
447
	${HEAD} -7 | ${TAIL} -6` ; \
448
	${ECHO_MSG} done >&2; if [ "x$$MIRRORS" != "x" ]; then \
449
	${ECHO_MSG} -n "MASTER_SITE_APACHE_HTTPD?= ";\
450
	${ECHO_MSG} $$MIRRORS; else \
451
	${ECHO_MSG} "No mirrors found!">&2 ; fi
452
.endif
453
454
.if !target(show-modules)
455
show-modules:
456
.if !empty(APACHE_MODULES)
457
.for module in ${AVAILABLE_MODULES}
458
	@${PRINTF} "%-20s : " ${module}
459
.	if ${APACHE_MODULES:M${module}}
460
		@${ECHO} -n "enabled "
461
.		if !empty(WITH_STATIC_MODULES) && ${WITH_STATIC_MODULES:M${module}}
462
			@${ECHO_CMD} " (static)"
463
.		else
464
			@${ECHO_CMD} "(shared)"
465
.		endif
466
.	else
467
		@${ECHO_CMD} disabled
468
.	endif
469
.endfor
470
.else
471
.for module in ${AVAILABLE_MODULES}
472
	@${PRINTF} "%-20s : disabled\n" ${module}
473
.endfor
474
.endif
475
.endif
476
477
.elif defined(AP_PORT_IS_MODULE)
478
479
.if defined(AP_MODENABLE)
480
AP_MOD_EN=	-a
481
.else
482
AP_MOD_EN=	-A
483
.endif
484
PLIST_SUB+=	AP_MOD_EN="${AP_MOD_EN}"
485
486
.if defined(AP_FAST_BUILD)
487
.if !target(ap-gen-plist)
488
_USES_build+=	490:ap-gen-plist
489
ap-gen-plist:
490
.if defined(AP_GENPLIST)
491
.	if !exists(${PLIST})
492
	@${ECHO} "===>  Generating apache plist"
493
	@${ECHO} "%%APACHEMODDIR%%/%%AP_MODULE%%" >> ${PLIST}
494
	@${ECHO} "@postexec %D/sbin/apxs -e ${AP_MOD_EN} -n %%AP_NAME%% %D/%F" >> ${PLIST}
495
	@${ECHO} "@postunexec ${SED} -i '' -E '/LoadModule[[:blank:]]+%%AP_NAME%%_module/d' %D/%%APACHEETCDIR%%/httpd.conf" >> ${PLIST}
496
	@${ECHO} "@postunexec echo \"Don't forget to remove all ${MODULENAME}-related directives in your httpd.conf\"">> ${PLIST}
497
.	endif
498
.endif
499
.endif
500
501
.if !target(do-build)
502
do-build:
503
	(cd ${WRKSRC} && ${APXS} -c ${AP_EXTRAS} -o ${MODULENAME}.la ${SRC_FILE})
504
.endif
505
506
.if !target(do-install)
507
do-install:
508
	@${MKDIR} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}
509
	${APXS} -S LIBEXECDIR=${STAGEDIR}${PREFIX}/${APACHEMODDIR} -i -n ${SHORTMODNAME} ${WRKSRC}/${MODULENAME}.la
510
.	if !defined(DEBUG)
511
		@${ECHO_MSG} "===> strip ${APACHEMODDIR}/${MODULENAME}.so"
512
		@[ -e ${STAGEDIR}${PREFIX}/${APACHEMODDIR}/${MODULENAME}.so ] && ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}/${MODULENAME}.so
513
.	else
514
		@${ECHO_MSG} "===> DEBUG is set, will not strip ${APACHEMODDIR}/${MODULENAME}.so"
515
.	endif
516
.endif
517
518
.endif          # defined(AP_FAST_BUILD)
519
.endif          # defined(AP_PORT_IS_SERVER / AP_PORT_IS_MODULE)
520
.endif          # defined(_POSTMKINCLUDED) && !defined(Apache_Post_Include)
(-)Mk/Uses/apache.mk (-206 / +142 lines)
Lines 1-131 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
#
2
#
3
# bsd.apache.mk - Apache related macros.
3
# apache.mk - Apache related macros.
4
# Author: Clement Laforet <clement@FreeBSD.org>
4
# Author: Clement Laforet <clement@FreeBSD.org>
5
# Author: Olli Hauer <ohauer@FreeBSD.org>
5
# Author: Olli Hauer <ohauer@FreeBSD.org>
6
# Author: Bernard Spil <brnrd@FreeSBD.org>
6
#
7
#
7
# Please view me with 4 column tabs!
8
# Please view me with 4 column tabs!
8
9
9
# =========================================================================
10
# Feature:		apache
10
# User controlled parameters for usage in /etc/make.conf:
11
# Usage:		USES=apache or USES=apache:args
12
# Valid args:	<version>, build, run, server
11
#
13
#
12
#  DEFAULT_VERSIONS  - define the default apache version
14
# version	If your port requires a specific Apache httpd version, you can
13
#                      valid args: apache=2.2, apache=2.4
15
#			set this to [min]-[max] or min+ or -max or an explicit version
14
#
16
#
15
#  APACHE_PORT       - use www/apache22-(event|itk|peruser|worker)-mpm
17
#				USES=apache:2.2		# Only use Apache 2.2
16
#                      instead www/apache22.  Use this parameter only in
18
#				USES=apache:2.4+	# Use Apache 2.4 or newer
17
#                      combination with "DEFAULT_VERSIONS+= apache=2.2"
19
#				USES=apache:2.2-2.4	# Use Apache 2.2 or 2.4
20
#				USES=apache		# Use the default apache version
18
#
21
#
19
# Example entry in /etc/make.conf:
22
#			Valid version numbers are specified in the variable
20
# - Set apache22 as default version
23
#			APACHE_SUPPORTED_VERSION below
21
#    DEFAULT_VERSIONS+= apache=2.2
22
#
24
#
23
# - Additional use a special www/apache22-$MPM port
25
# build		Indicates that Apache is needed at build time and adds it to
24
#    APACHE_PORT= www/apache22-event-mpm
26
#			BUILD_DEPENDS.
27
# run		Indicates that Apache is needed at run time and adds it to
28
#			RUN_DEPENDS.
29
# server	Indicates that the port is a server port.
25
#
30
#
26
# Note:
31
# 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!
32
# 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
#
33
#
31
# =========================================================================
34
# Variables, which can be set by the port:
32
#
35
#
33
# This script will be included if one of the following parameter
36
#  AP_FAST_BUILD		automatic module build
34
# is defined in the Makefile of the port
35
#
37
#
36
# USE_APACHE         - Set apache and apxs as build and run dependency
38
#  AP_GENPLIST			automatic PLIST generation plus add
37
# USE_APACHE_BUILD   - Set apache and apxs as build dependency
39
#						the module disabled into httpd.conf
38
# USE_APACHE_RUN     - Set apache and apxs as run dependency
40
#						(only if no pkg-plist exist)
39
#
41
#
40
# The following example is representative of all three possible
42
#  MODULENAME         	Name of the Apache module
41
# parameters to use.
43
#						default: ${PORTNAME}
44
#  SHORTMODNAME       	Short name of the Apache module
45
#						default: ${MODULENAME:S/mod_//}
46
#  SRC_FILE           	Source file of the APACHE MODULE
47
#						default: ${MODULENAME}.c
42
#
48
#
43
# Examples:
49
# Variables, for internal use by the Apache ports framework only
44
#  USE_APACHE= 22       # specify exact version
50
#  The following values for USE_APACHE are reserved and only valid
45
#  USE_APACHE= 22+      # specify [min] version, no [max] version
51
#  in apache-server ports!
46
#  USE_APACHE= 22-24    # specify [min]-[max] range
52
#      USES= apache:common2.2
47
#  USE_APACHE= -22      # specify [max] version, no [min] version
48
#
53
#
49
# Note:
50
#  - If "+" is specified and no apache is installed, then
51
#    ${DEFAULT_APACHE_VERSION} will be used.
52
#
54
#
53
#  - Valid version numbers are specified in the variable
55
# The following variables can be read by ports and must not be modified
54
#    APACHE_SUPPORTED_VERSION below
56
# 
57
#  APACHE_VERSION		The major-minor release version of the chosen
58
#						Apache server, e.g. 2.2 or 2.4
55
#
59
#
56
#  - The following values for USE_APACHE are reserverd and only valid
60
#  APACHEETCDIR			Location of the Apache configuration directory
57
#    in apache-server ports!
61
#						Default: ${LOCALBASE}/etc/apache24
58
#      USE_APACHE= common22
59
#
62
#
63
#  APACHEINCLUDEDIR		Location of the Apache include files
64
#						Default: ${LOCALBASE}/include/apache24
60
#
65
#
61
# The following variables can be used (ro) in ports Makefile
66
#  APACHEMODDIR			Location of the Apache modules
62
# =========================================================================
67
#						Default: ${LOCALBASE}/libxexec/apache24
63
#  - APACHE_VERSION
64
#  - APACHEETCDIR
65
#  - APACHEINCLUDEDIR
66
#  - APACHEMODDIR
67
#  - DEFAULT_APACHE_VERSION
68
#
68
#
69
#  DEFAULT_APACHE_VERSION Default Apache version
69
#
70
#
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
71
84
.if !defined(Apache_Pre_Include)
72
.if !defined(_INCLUDE_USES_APACHE_PRE_MK)
73
_INCLUDE_USES_APACHE_PRE_MK=	yes
74
_USES_POST+=	apache
85
75
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/.//}
76
DEFAULT_APACHE_VERSION?=	${APACHE_DEFAULT:S/.//}
93
# When adding a version, please keep the comment in
77
# When adding a version, please keep the comment in
94
# Mk/bsd.default-versions.mk in sync.
78
# Mk/bsd.default-versions.mk in sync.
95
APACHE_SUPPORTED_VERSION=	24 22 # preferred version first
79
_APACHE_VERSIONS=	2.4 2.2 2.5# preferred version first
96
80
97
# Print warnings
81
# Print warnings
98
_ERROR_MSG=	: Error from bsd.apache.mk.
82
_ERROR_MSG=	: Error from apache.mk.
99
83
100
# Important Note:
84
# Important Note:
101
#  Keep apache version in ascending order!
85
#  Keep apache version in ascending order!
102
#  The "+" sign is only valid as last sign, not between
86
#  The "+" sign is only valid as last sign, not between
103
#  two versions or in combination with range!
87
#  two versions or in combination with range!
104
.if defined(USE_APACHE) && !empty(USE_APACHE)
88
.if defined(apache_ARGS) && !empty(apache_ARGS)
105
.	if ${USE_APACHE:Mcommon*} != ""
89
# Preserve original arguments list
106
AP_PORT_IS_SERVER=	yes
90
_APACHE_ARGS=		${apache_ARGS}
107
.	elif ${USE_APACHE:C/\-//:S/^22//:S/^24//:C/\+$//} == ""
91
.	if ${_APACHE_ARGS:Mserver} || ${_APACHE_ARGS:Mcommon*} != ""
108
AP_PORT_IS_MODULE=	yes
92
_APACHE_ARGS:=			${_APACHE_ARGS:S/common/server /}
109
.		if ${USE_APACHE:C/\-//:S/^22//:S/^24//} == "+"
93
_APACHE_PORT_IS_SERVER=	yes
110
AP_PLUS=	yes
94
_APACHE_ARGS:=			${_APACHE_ARGS:Nserver}
95
.	endif
96
.	if ${_APACHE_ARGS:Mbuild}
97
_APACHE_BUILD_DEP=      yes
98
_APACHE_ARGS:=          ${_APACHE_ARGS:Nbuild}
99
.	endif
100
.	if ${_APACHE_ARGS:Mrun}
101
_APACHE_RUN_DEP=        yes
102
_APACHE_ARGS:=          ${_APACHE_ARGS:Nrun}
103
.	endif
104
# _APACHE_ARGS is now empty or contains a version(-range)
105
.	if ${_APACHE_ARGS:C/\-//:S/^2.2//:S/^2.4//:S/^2.5//:C/\+$//} == ""
106
_APACHE_PORT_IS_MODULE=      yes
107
.		if ${_APACHE_ARGS:C/\-//:S/^2.2//:S/^2.4//:S/^2.5//} == "+"
108
_APACHE_PLUS=        yes
111
.		endif
109
.		endif
112
.	else
110
.	else
113
IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} )
111
IGNORE= ${_ERROR_MSG} 1 Illegal use of USES= apache ( ${apache_ARGS} )
114
.	endif
112
.	endif
115
# Catch unknown apache versions and silly USE_APACHE constructs
113
# Catch unknown apache versions and silly USE_APACHE constructs
116
.	if empty(AP_PORT_IS_SERVER) && empty(AP_PORT_IS_MODULE)
114
.       if empty(_APACHE_PORT_IS_SERVER) && empty(_APACHE_PORT_IS_MODULE)
117
IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} )
115
IGNORE= ${_ERROR_MSG} 2 Illegal use of USES= apache ( ${apache_ARGS} )
118
.	endif
116
.       endif
119
# Catch USE_APACHE [min]-[max]+
117
# Catch USE_APACHE [min]-[max]+
120
.	if defined(AP_PLUS) && ${USE_APACHE:C/[.+0-9]//g} == "-"
118
.       if defined(_APACHE_PLUS) && ${apache_ARGS:C/[.a-z0-9]//g} == "-+"
121
IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} )
119
IGNORE= ${_ERROR_MSG} Illegal use of USES= apache ( ${apache_ARGS} )
122
.	endif
120
.       endif
123
.elif defined(USE_APACHE)
121
.elif defined(apache_ARGS)
124
IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( no version specified )
122
IGNORE= ${_ERROR_MSG} Illegal use of USES= apache (no version specified)
125
.endif # defined(USE_APACHE)
123
.endif # defined(apache_ARGS)
126
124
125
.if !defined(_APACHE_BUILD_DEP) && !defined(_APACHE_RUN_DEP) && \
126
	!defined(_APACHE_PORT_IS_SERVER)
127
_APACHE_BUILD_DEP=	yes
128
_APACHE_RUN_DEP=	yes
129
.endif
130
131
.if defined(DEFAULT_APACHE_VER)
132
WARNING+=	"DEFAULT_APACHE_VER is defined, consider using DEFAULT_VERSIONS+=apache=${DEFAULT_APACHE_VER} instead"
133
.endif
134
135
.if defined(WITH_MODULES) || defined(WITHOUT_MODULES)
136
IGNORE=	${_ERROR_MSG} WITH(OUT)_MODULES has been removed, use www_${PORTNAME}_(UN)SET
137
.endif
138
127
# ===============================================================
139
# ===============================================================
128
.if defined(AP_PORT_IS_SERVER)
140
.if defined(_APACHE_PORT_IS_SERVER)
129
# Module selection
141
# Module selection
130
.for category in ${DEFAULT_MODULES_CATEGORIES}
142
.for category in ${DEFAULT_MODULES_CATEGORIES}
131
DEFAULT_MODULES+=	${${category}_MODULES}
143
DEFAULT_MODULES+=	${${category}_MODULES}
Lines 135-171 Link Here
135
AVAILABLE_MODULES+=	${${category}_MODULES}
147
AVAILABLE_MODULES+=	${${category}_MODULES}
136
.endfor
148
.endfor
137
149
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
150
# OPTIONS handling
158
.for module in ${AVAILABLE_MODULES}
151
.for module in ${AVAILABLE_MODULES}
159
.	if ${PORT_OPTIONS:M${module}}
152
.	if ${PORT_OPTIONS:M${module}}
160
_APACHE_MODULES+=	${module}
153
_APACHE_ENABLED_MODS+=	${module}
161
.	else
154
.	else
162
WITHOUT_MODULES+=	${module}
155
_APACHE_DISABLED_MODS+=	${module}
163
.	endif
156
.	endif
164
.endfor
157
.endfor
165
158
166
.if !defined(WITH_STATIC_APACHE)
159
.if !defined(WITH_STATIC_APACHE)
167
# FYI
168
#DYNAMIC_MODULES=	so
169
CONFIGURE_ARGS+=	--enable-so
160
CONFIGURE_ARGS+=	--enable-so
170
.else
161
.else
171
CONFIGURE_ARGS+=	--disable-so
162
CONFIGURE_ARGS+=	--disable-so
Lines 173-179 Link Here
173
.endif
164
.endif
174
165
175
.if ${PORT_OPTIONS:MSUEXEC}
166
.if ${PORT_OPTIONS:MSUEXEC}
176
_APACHE_MODULES+=	${SUEXEC_MODULES}
167
_APACHE_ENABLED_MODS+=	${SUEXEC_MODULES}
177
SUEXEC_CONFARGS=	with-suexec
168
SUEXEC_CONFARGS=	with-suexec
178
169
179
# SUEXEC_DOCROOT should exist
170
# SUEXEC_DOCROOT should exist
Lines 204-257 Link Here
204
.	endif
195
.	endif
205
.endif
196
.endif
206
197
207
.if !defined(WITHOUT_MODULES)
198
.if !defined(_APACHE_DISABLED_MODS)
208
APACHE_MODULES=		${_APACHE_MODULES}
199
APACHE_MODULES=		${_APACHE_ENABLED_MODS}
209
.else
200
.else
210
.for module in ${_APACHE_MODULES:O:u}
201
.for module in ${_APACHE_ENABLED_MODS:O:u}
211
.	if !${WITHOUT_MODULES:M${module}}
202
.	if !${_APACHE_DISABLED_MODS:M${module}}
212
APACHE_MODULES+=	${module}
203
APACHE_MODULES+=	${module}
213
.	endif
204
.	endif
214
.endfor
205
.endfor
215
.endif
206
.endif
216
207
217
.if defined(WITH_STATIC_MODULES)
208
.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}
209
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
210
.endif
232
211
233
# ====================================
212
.for module in ${AVAILABLE_MODULES}
234
# start pkg-plist adjustments
213
.	if !empty(WITH_STATIC_MODULES:M${module})
235
.if defined(WITH_STATIC_MODULES)
214
CONFIGURE_ARGS+=	--enable-${module:tl}=static
236
.for module in ${APACHE_MODULES}
215
PLIST_SUB+=	MOD_${module}="@comment "
237
.	if !${WITH_STATIC_MODULES:M${module}}
216
.	elif !empty(APACHE_MODULES:M${module})
238
_SHARED_MODULES+=	${module}
217
CONFIGURE_ARGS+=	--enable-${module:tl}=shared
218
PLIST_SUB+=	MOD_${module}=""
219
.	else
220
CONFIGURE_ARGS+=	--disable-${module:tl}
221
PLIST_SUB+=	MOD_${module}="@comment "
239
.	endif
222
.	endif
240
.endfor
223
.endfor
241
224
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
225
# pkg-plist workaround STATIC support
256
.if ${PORT_OPTIONS:MSUEXEC}
226
.if ${PORT_OPTIONS:MSUEXEC}
257
PLIST_SUB+=	SUEXEC=""
227
PLIST_SUB+=	SUEXEC=""
Lines 265-276 Link Here
265
PLIST_SUB+=	FORENSIC="@comment "
235
PLIST_SUB+=	FORENSIC="@comment "
266
.endif
236
.endif
267
237
268
# end pkg-plist adjustments
238
#### End of _APACHE_PORT_IS_SERVER ####
269
239
270
#### End of AP_PORT_IS_SERVER ####
271
272
# ===============================================================
240
# ===============================================================
273
.elif defined(AP_PORT_IS_MODULE) || defined(USE_APACHE_RUN) || defined(USE_APACHE_BUILD)
241
.elif defined(_APACHE_PORT_IS_MODULE) || defined(_APACHE_RUN_DEP) || defined(_APACHE_BUILD_DEP)
274
APXS?=		${LOCALBASE}/sbin/apxs
242
APXS?=		${LOCALBASE}/sbin/apxs
275
HTTPD?=		${LOCALBASE}/sbin/httpd
243
HTTPD?=		${LOCALBASE}/sbin/httpd
276
244
Lines 280-326 Link Here
280
248
281
.if exists(${HTTPD})
249
.if exists(${HTTPD})
282
_APACHE_VERSION!=	${HTTPD} -v | ${SED} -ne 's/^Server version: Apache\/\([0-9]\)\.\([0-9]*\).*/\1\2/p'
250
_APACHE_VERSION!=	${HTTPD} -v | ${SED} -ne 's/^Server version: Apache\/\([0-9]\)\.\([0-9]*\).*/\1\2/p'
283
.elif defined(APACHE_PORT)
284
_APACHE_VERSION!=	${ECHO_CMD} ${APACHE_PORT} | ${SED} -ne 's,.*/apache\([0-9]*\).*,\1,p'
285
.endif
251
.endif
286
252
287
.if defined(USE_APACHE)
253
.if defined(_APACHE_ARGS)
288
_USE_APACHE:=	${USE_APACHE}
254
_USE_APACHE:=	${_APACHE_ARGS:S/.//g}
289
.elif defined(USE_APACHE_BUILD)
290
_USE_APACHE:=	${USE_APACHE_BUILD}
291
.elif defined(USE_APACHE_RUN)
292
_USE_APACHE:=	${USE_APACHE_RUN}
293
.endif
255
.endif
294
256
295
_APACHE_VERSION_CHECK:=		${_USE_APACHE:C/^([1-9][0-9])$/\1-\1/}
257
_APACHE_VERSION_CHECK:=	${_USE_APACHE:C/^([1-9][0-9])$/\1-\1/}
296
_APACHE_VERSION_MINIMUM_TMP:=	${_APACHE_VERSION_CHECK:C/([1-9][0-9])[-+].*/\1/}
258
_APACHE_VERSION_MIN:=	${_APACHE_VERSION_CHECK:C/([1-9][0-9])[-+].*/\1/}
297
_APACHE_VERSION_MINIMUM:=	${_APACHE_VERSION_MINIMUM_TMP:M[1-9][0-9]}
259
_APACHE_VERSION_MAX:=	${_APACHE_VERSION_CHECK:C/.*-([1-9][0-9])/\1/}
298
_APACHE_VERSION_MAXIMUM_TMP:=	${_APACHE_VERSION_CHECK:C/.*-([1-9][0-9])/\1/}
299
_APACHE_VERSION_MAXIMUM:=	${_APACHE_VERSION_MAXIMUM_TMP:M[1-9][0-9]}
300
260
301
# ==============================================================
261
# ==============================================================
302
# num+
262
# num+
303
.if ${_USE_APACHE:M*+}
263
.if !empty(_USE_APACHE:M*+)
304
_APACHE_WANTED_VERSIONS=	${DEFAULT_APACHE_VERSION}
264
_APACHE_WANTED_VERSIONS=	${DEFAULT_APACHE_VERSION}
305
265
306
# -num
266
# -num
307
.elif ${_USE_APACHE:M\-[0-9][0-9]}
267
.elif !empty(_USE_APACHE:M\-[0-9][0-9])
308
.for _v in ${APACHE_SUPPORTED_VERSION:O}
268
.for _v in ${_APACHE_VERSIONS:O}
309
.	if ${_APACHE_VERSION_MAXIMUM} >= ${_v}
269
.	if ${_APACHE_VERSION_MAX} >= ${_v}
310
_APACHE_WANTED_VERSIONS+=	${_v}
270
_APACHE_WANTED_VERSIONS+=	${_v}
311
.	endif
271
.	endif
312
.endfor
272
.endfor
313
273
314
# num-num
274
# num-num
315
.elif ${_USE_APACHE:M[0-9][0-9]-[0-9][0-9]}
275
.elif !empty(_USE_APACHE:M[0-9][0-9]-[0-9][0-9])
316
.for _v in ${APACHE_SUPPORTED_VERSION}
276
.for _v in ${_APACHE_VERSIONS}
317
.	if ${_APACHE_VERSION_MINIMUM} <= ${_v} && ${_APACHE_VERSION_MAXIMUM} >= ${_v}
277
.	if ${_APACHE_VERSION_MIN} <= ${_v} && ${_APACHE_VERSION_MAX} >= ${_v}
318
_APACHE_WANTED_VERSIONS+=	${_v}
278
_APACHE_WANTED_VERSIONS+=	${_v}
319
.	endif
279
.	endif
320
.endfor
280
.endfor
321
281
322
# num
282
# num
323
.elif ${_USE_APACHE:M[0-9][0-9]}
283
.elif !empty(_USE_APACHE:M[0-9][0-9])
324
_APACHE_WANTED_VERSIONS=	${_USE_APACHE:M[0-9][0-9]}
284
_APACHE_WANTED_VERSIONS=	${_USE_APACHE:M[0-9][0-9]}
325
.endif
285
.endif
326
# ==============================================================
286
# ==============================================================
Lines 382-392 Link Here
382
PKGNAMEPREFIX?=	${APACHE_PKGNAMEPREFIX}
342
PKGNAMEPREFIX?=	${APACHE_PKGNAMEPREFIX}
383
.endif
343
.endif
384
344
385
.if defined(USE_APACHE) || defined(USE_APACHE_BUILD)
345
.if defined(_APACHE_BUILD_DEP)
386
BUILD_DEPENDS+=	${APXS}:${APACHE_PORT}
346
BUILD_DEPENDS+=	${APXS}:${APACHE_PORT}
387
.endif
347
.endif
388
348
389
.if defined(USE_APACHE) || defined(USE_APACHE_RUN)
349
.if defined(_APACHE_RUN_DEP)
390
RUN_DEPENDS+=	${APXS}:${APACHE_PORT}
350
RUN_DEPENDS+=	${APXS}:${APACHE_PORT}
391
.endif
351
.endif
392
352
Lines 404-444 Link Here
404
AP_EXTRAS+=	-L ${AP_LIB}
364
AP_EXTRAS+=	-L ${AP_LIB}
405
.endif
365
.endif
406
366
407
.endif # End of AP_PORT_IS_SERVER   / AP_PORT_IS_MOULE
367
.endif # End of _APACHE_PORT_IS_SERVER / _APACHE_PORT_IS_MOULE
408
.endif # End of !Apache_Pre_Include
368
.endif # End of !_INCLUDE_USES_APACHE_PRE_MK
409
369
410
# ===============================================================
370
# ===============================================================
411
.if defined(_POSTMKINCLUDED) && !defined(Apache_Post_Include)
371
.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_APACHE_POST_MK)
412
Apache_Post_Include=	bsd.apache.mk
372
_INCLUDE_USES_APACHE_POST_MK=	apache.mk
413
373
.if defined(NO_BUILD) && !defined(_APACHE_RUN_DEP)
414
.if defined(USE_APACHE_RUN) && !empty(USE_APACHE_RUN)
374
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
375
.endif
421
376
422
.if defined(USE_APACHE_BUILD) && !empty(USE_APACHE_BUILD)
377
.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)
378
.if !target(print-closest-mirrors)
443
print-closest-mirrors:
379
print-closest-mirrors:
444
	@${ECHO_MSG} -n "Fetching list of nearest mirror: " >&2
380
	@${ECHO_MSG} -n "Fetching list of nearest mirror: " >&2
Lines 474-480 Link Here
474
.endif
410
.endif
475
.endif
411
.endif
476
412
477
.elif defined(AP_PORT_IS_MODULE)
413
.elif defined(_APACHE_PORT_IS_MODULE)
478
414
479
.if defined(AP_MODENABLE)
415
.if defined(AP_MODENABLE)
480
AP_MOD_EN=	-a
416
AP_MOD_EN=	-a
Lines 516-520 Link Here
516
.endif
452
.endif
517
453
518
.endif          # defined(AP_FAST_BUILD)
454
.endif          # defined(AP_FAST_BUILD)
519
.endif          # defined(AP_PORT_IS_SERVER / AP_PORT_IS_MODULE)
455
.endif          # defined(_APACHE_PORT_IS_SERVER / _APACHE_PORT_IS_MODULE)
520
.endif          # defined(_POSTMKINCLUDED) && !defined(Apache_Post_Include)
456
.endif          # defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_APACHE_PRE_MK)
(-)Mk/Uses/php.mk (-1 / +1 lines)
Lines 203-209 Link Here
203
RUN_DEPENDS+=	${PHPBASE}/include/php/main/php.h:${PHP_PORT}
203
RUN_DEPENDS+=	${PHPBASE}/include/php/main/php.h:${PHP_PORT}
204
.  if  ${php_ARGS:Mmod} || (${php_ARGS:Mweb} && defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "")
204
.  if  ${php_ARGS:Mmod} || (${php_ARGS:Mweb} && defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "")
205
USE_APACHE_RUN=	22+
205
USE_APACHE_RUN=	22+
206
.include "${PORTSDIR}/Mk/bsd.apache.mk"
206
.include "${PORTSDIR}/Mk/Uses/apache.mk"
207
# libphpX.so only has the major version number in it, so remove the last digit of PHP_VER to get it.
207
# libphpX.so only has the major version number in it, so remove the last digit of PHP_VER to get it.
208
RUN_DEPENDS+=	${PHPBASE}/${APACHEMODDIR}/libphp${PHP_VER:C/.$//}.so:${MOD_PHP_PORT}
208
RUN_DEPENDS+=	${PHPBASE}/${APACHEMODDIR}/libphp${PHP_VER:C/.$//}.so:${MOD_PHP_PORT}
209
.  endif
209
.  endif
(-)Mk/bsd.sanity.mk (-1 / +6 lines)
Lines 180-186 Link Here
180
SANITY_DEPRECATED=	PYTHON_PKGNAMESUFFIX USE_AUTOTOOLS \
180
SANITY_DEPRECATED=	PYTHON_PKGNAMESUFFIX USE_AUTOTOOLS \
181
			USE_MYSQL WANT_MYSQL_VER \
181
			USE_MYSQL WANT_MYSQL_VER \
182
			USE_PHPIZE WANT_PHP_CLI WANT_PHP_CGI WANT_PHP_MOD \
182
			USE_PHPIZE WANT_PHP_CLI WANT_PHP_CGI WANT_PHP_MOD \
183
			WANT_PHP_WEB WANT_PHP_EMB
183
			WANT_PHP_WEB WANT_PHP_EMB \
184
			USE_APACHE USE_APACHE_BUILD USE_APACHE_RUN
184
SANITY_NOTNEEDED=	CMAKE_NINJA WX_UNICODE
185
SANITY_NOTNEEDED=	CMAKE_NINJA WX_UNICODE
185
186
186
USE_AUTOTOOLS_ALT=	USES=autoreconf and GNU_CONFIGURE=yes
187
USE_AUTOTOOLS_ALT=	USES=autoreconf and GNU_CONFIGURE=yes
Lines 237-242 Link Here
237
WANT_PHP_EMB_ALT=	USES=php:embed
238
WANT_PHP_EMB_ALT=	USES=php:embed
238
USE_RCORDER_ALT=	USE_RC_SUBR=${USE_RCORDER}
239
USE_RCORDER_ALT=	USE_RC_SUBR=${USE_RCORDER}
239
WANT_GNOME_ALT=		USES=gnome
240
WANT_GNOME_ALT=		USES=gnome
241
USE_APACHE_ALT=		USES=apache:${USE_APACHE:S/2/2./}
242
USE_APACHE_BUILD_ALT=	USES=apache:build,${USE_APACHE_BUILD:S/2/2./}
243
USE_APACHE_RUN_ALT=	USES=apache:run,${USE_APACHE_RUN:S/2/2./}
244
APACHE_PORT_ALT=	DEFAULT_VERSIONS+=apache=${APACHE_PORT:S/www\/apache//:S/2/2./}
240
245
241
.for a in ${SANITY_DEPRECATED}
246
.for a in ${SANITY_DEPRECATED}
242
.if defined(${a})
247
.if defined(${a})
(-)lang/php56/Makefile (-1 / +1 lines)
Lines 91-97 Link Here
91
PHP_VER=	56
91
PHP_VER=	56
92
IGNORE_WITH_PHP=53 54 5
92
IGNORE_WITH_PHP=53 54 5
93
USE_APACHE=	22+
93
USE_APACHE=	22+
94
.include "${PORTSDIR}/Mk/bsd.apache.mk"
94
.include "${PORTSDIR}/Mk/Uses/apache.mk"
95
.if ${PORT_OPTIONS:MAP2FILTER}
95
.if ${PORT_OPTIONS:MAP2FILTER}
96
CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
96
CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
97
.else
97
.else
(-)lang/php70/Makefile (-1 / +1 lines)
Lines 89-95 Link Here
89
PHP_VER=	70
89
PHP_VER=	70
90
IGNORE_WITH_PHP=	56
90
IGNORE_WITH_PHP=	56
91
USE_APACHE=	22+
91
USE_APACHE=	22+
92
.include "${PORTSDIR}/Mk/bsd.apache.mk"
92
.include "${PORTSDIR}/Mk/Uses/apache.mk"
93
.if ${PORT_OPTIONS:MAP2FILTER}
93
.if ${PORT_OPTIONS:MAP2FILTER}
94
CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
94
CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
95
.else
95
.else
(-)lang/php71/Makefile (-1 / +1 lines)
Lines 92-98 Link Here
92
PHP_VER=	71
92
PHP_VER=	71
93
IGNORE_WITH_PHP=	55 56 70
93
IGNORE_WITH_PHP=	55 56 70
94
USE_APACHE=	22+
94
USE_APACHE=	22+
95
.include "${PORTSDIR}/Mk/bsd.apache.mk"
95
.include "${PORTSDIR}/Mk/Uses/apache.mk"
96
.if ${PORT_OPTIONS:MAP2FILTER}
96
.if ${PORT_OPTIONS:MAP2FILTER}
97
CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
97
CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
98
.else
98
.else
(-)CHANGES (+5 lines)
Lines 10-15 Link Here
10
10
11
All ports committers are allowed to commit to this file.
11
All ports committers are allowed to commit to this file.
12
12
13
20171119:
14
AUTHOR: brnrd@FreeBSD.org
15
16
  USE_APACHE has been replaced by USES=apache.
17
13
20171020:
18
20171020:
14
AUTHOR: ak@FreeBSD.org
19
AUTHOR: ak@FreeBSD.org
15
20

Return to bug 223691