svn commit: r464175 - in head: . Mk Mk/Uses lang/php56 lang/php70 lang/php71 lang/php72 www/apache22 www/apache24 www/mod_auth_pubtkt www/mod_evasive www/mod_perl2 www/mod_scgi

Bernard Spil brnrd at FreeBSD.org
Sun Mar 11 14:23:30 UTC 2018


Author: brnrd
Date: Sun Mar 11 14:23:28 2018
New Revision: 464175
URL: https://svnweb.freebsd.org/changeset/ports/464175

Log:
  Mk/Uses/apache.mk: Migrate Mk/bsd.apache.mk to Uses
  
   - Chase required changes in framework (bsd.sanity.mk, bsd.port.mk)
   - Chase required changes in ports (version checks)
   - Chase required changes in PHP ports (include bsd.apache.mk)
   - exp-run by antoine, brnrd, joneum
  
  PR:             223691 (exp-run)
  Reviewed by:    joneum (hat apache), mat (portmgr), antoine (portmgr)
  Approved by:    joneum (hat apache)
  Approved by:	portmgr
  With hat:       apache

Added:
  head/Mk/Uses/apache.mk
     - copied, changed from r464174, head/Mk/bsd.apache.mk
Deleted:
  head/Mk/bsd.apache.mk
Modified:
  head/CHANGES
  head/Mk/Uses/php.mk
  head/Mk/bsd.port.mk
  head/Mk/bsd.sanity.mk
  head/lang/php56/Makefile
  head/lang/php70/Makefile
  head/lang/php71/Makefile
  head/lang/php72/Makefile
  head/www/apache22/Makefile
  head/www/apache22/Makefile.modules
  head/www/apache24/Makefile
  head/www/apache24/Makefile.modules
  head/www/mod_auth_pubtkt/Makefile
  head/www/mod_evasive/Makefile
  head/www/mod_perl2/Makefile
  head/www/mod_scgi/Makefile

Modified: head/CHANGES
==============================================================================
--- head/CHANGES	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/CHANGES	Sun Mar 11 14:23:28 2018	(r464175)
@@ -10,6 +10,11 @@ in the release notes and/or placed into UPDATING.
 
 All ports committers are allowed to commit to this file.
 
+20180311:
+AUTHOR: brnrd at FreeBSD.org
+
+  USE_APACHE has been replaced by USES=apache.
+
 20180308:
 AUTHOR: mat at FreeBSD.org
 

Copied and modified: head/Mk/Uses/apache.mk (from r464174, head/Mk/bsd.apache.mk)
==============================================================================
--- head/Mk/bsd.apache.mk	Sun Mar 11 14:10:01 2018	(r464174, copy source)
+++ head/Mk/Uses/apache.mk	Sun Mar 11 14:23:28 2018	(r464175)
@@ -1,131 +1,138 @@
+#-*- tab-width: 4; -*-
+# ex:ts=4
+#
 # $FreeBSD$
 #
-# bsd.apache.mk - Apache related macros.
+# apache.mk - Apache related macros.
 # Author: Clement Laforet <clement at FreeBSD.org>
 # Author: Olli Hauer <ohauer at FreeBSD.org>
+# Author: Bernard Spil <brnrd at FreeSBD.org>
 #
 # Please view me with 4 column tabs!
 
-# =========================================================================
-# User controlled parameters for usage in /etc/make.conf:
+# Feature:		apache
+# Usage:		USES=apache or USES=apache:args
+# Valid args:	<version>, build, run, server
 #
-#  DEFAULT_VERSIONS  - define the default apache version
-#                      valid args: apache=2.2, apache=2.4
+# version	If your port requires a specific Apache httpd version, you can
+#			set this to [min]-[max] or min+ or -max or an explicit version
 #
-#  APACHE_PORT       - use www/apache22-(event|itk|peruser|worker)-mpm
-#                      instead www/apache22.  Use this parameter only in
-#                      combination with "DEFAULT_VERSIONS+= apache=2.2"
+#				USES=apache:2.2		# Only use Apache 2.2
+#				USES=apache:2.4+	# Use Apache 2.4 or newer
+#				USES=apache:2.2-2.4	# Use Apache 2.2 or 2.4
+#				USES=apache:-2.4	# Use Apache 2.4 or earlier
+#				USES=apache			# Use the default apache version
 #
-# Example entry in /etc/make.conf:
-# - Set apache22 as default version
-#    DEFAULT_VERSIONS+= apache=2.2
+#			Valid version numbers are specified in the variable
+#			APACHE_SUPPORTED_VERSIONS below
 #
-# - Additional use a special www/apache22-$MPM port
-#    APACHE_PORT= www/apache22-event-mpm
+# build		Indicates that Apache is needed at build time and adds it to
+#			BUILD_DEPENDS.
+# run		Indicates that Apache is needed at run time and adds it to
+#			RUN_DEPENDS.
+# server	Indicates that the port is a server port.
 #
-# Note:
-#  - This parameters should never be used in the Makefile of a port!
-#  - To get a list of "possible" APACHE_PORT values execute the command:
-#    $> awk '/apache22-/ {print "www/" $3}' ports/www/Makefile
+# If build and run are omitted, Apache will be added as BUILD_DEPENDS and
+# RUN_DEPENDS
 #
-# =========================================================================
+# Variables, which can be set by the port:
 #
-# This script will be included if one of the following parameter
-# is defined in the Makefile of the port
+#  AP_FAST_BUILD	automatic module build
 #
-# USE_APACHE         - Set apache and apxs as build and run dependency
-# USE_APACHE_BUILD   - Set apache and apxs as build dependency
-# USE_APACHE_RUN     - Set apache and apxs as run dependency
+#  AP_GENPLIST		automatic PLIST generation plus add
+#					the module disabled into httpd.conf
+#					(only if no pkg-plist exist)
 #
-# The following example is representative of all three possible
-# parameters to use.
+#  MODULENAME		Name of the Apache module
+#					default: ${PORTNAME}
+#  SHORTMODNAME		Short name of the Apache module
+#					default: ${MODULENAME:S/mod_//}
+#  SRC_FILE			Source file of the APACHE MODULE
+#					default: ${MODULENAME}.c
 #
-# Examples:
-#  USE_APACHE= 22       # specify exact version
-#  USE_APACHE= 22+      # specify [min] version, no [max] version
-#  USE_APACHE= 22-24    # specify [min]-[max] range
-#  USE_APACHE= -22      # specify [max] version, no [min] version
+# Variables, for internal use by the Apache ports framework only
+#  The following values for USE_APACHE are reserved and only valid
+#  in apache-server ports!
+#      USES= apache:server,2.2
 #
-# Note:
-#  - If "+" is specified and no apache is installed, then
-#    ${DEFAULT_APACHE_VERSION} will be used.
 #
-#  - Valid version numbers are specified in the variable
-#    APACHE_SUPPORTED_VERSION below
+# The following variables can be read by ports and must not be modified
+# 
+#  APACHE_VERSION		The major-minor release version of the chosen
+#						Apache server, e.g. 2.2 or 2.4
 #
-#  - The following values for USE_APACHE are reserverd and only valid
-#    in apache-server ports!
-#      USE_APACHE= common22
+#  APACHEETCDIR			Location of the Apache configuration directory
+#						Default: ${LOCALBASE}/etc/apache24
 #
+#  APACHEINCLUDEDIR		Location of the Apache include files
+#						Default: ${LOCALBASE}/include/apache24
 #
-# The following variables can be used (ro) in ports Makefile
-# =========================================================================
-#  - APACHE_VERSION
-#  - APACHEETCDIR
-#  - APACHEINCLUDEDIR
-#  - APACHEMODDIR
-#  - DEFAULT_APACHE_VERSION
+#  APACHEMODDIR			Location of the Apache modules
+#						Default: ${LOCALBASE}/libxexec/apache24
 #
+#  APACHE_DEFAULT		Default Apache version
 #
-# Parameters for building third party apache modules:
-# =========================================================================
-#  - AP_FAST_BUILD      # automatic module build
-#
-#  - AP_GENPLIST        # automatic PLIST generation plus add
-#                       # the module disabled into httpd.conf
-#                       # (only if no pkg-plist exist)
-#
-#  - MODULENAME         # default: ${PORTNAME}
-#  - SHORTMODNAME       # default: ${MODULENAME:S/mod_//}
-#  - SRC_FILE           # default: ${MODULENAME}.c
-#
-#
 
-.if !defined(Apache_Pre_Include)
+.if !defined(_INCLUDE_USES_APACHE_PRE_MK)
+_INCLUDE_USES_APACHE_PRE_MK=	yes
+_USES_POST+=	apache
 
-Apache_Pre_Include=		bsd.apache.mk
-
-.if defined(DEFAULT_APACHE_VER)
-WARNING+=	"DEFAULT_APACHE_VER is defined, consider using DEFAULT_VERSIONS+=apache=${DEFAULT_APACHE_VER} instead"
-.endif
-
-DEFAULT_APACHE_VERSION?=	${APACHE_DEFAULT:S/.//}
 # When adding a version, please keep the comment in
 # Mk/bsd.default-versions.mk in sync.
-APACHE_SUPPORTED_VERSION=	24 22 # preferred version first
+_APACHE_SUPPORTED_VERSIONS=	2.4 2.2 2.5	# preferred version first
 
 # Print warnings
-_ERROR_MSG=	: Error from bsd.apache.mk.
+_ERROR_MSG=	: Error from apache.mk.
 
 # Important Note:
-#  Keep apache version in ascending order!
 #  The "+" sign is only valid as last sign, not between
 #  two versions or in combination with range!
-.if defined(USE_APACHE) && !empty(USE_APACHE)
-.	if ${USE_APACHE:Mcommon*} != ""
-AP_PORT_IS_SERVER=	yes
-.	elif ${USE_APACHE:C/\-//:S/^22//:S/^24//:C/\+$//} == ""
-AP_PORT_IS_MODULE=	yes
-.		if ${USE_APACHE:C/\-//:S/^22//:S/^24//} == "+"
-AP_PLUS=	yes
-.		endif
-.	else
-IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} )
+.if defined(apache_ARGS) && !empty(apache_ARGS)
+# Preserve original arguments list
+_APACHE_ARGS=		${apache_ARGS}
+.	if ${_APACHE_ARGS:Mserver} || ${_APACHE_ARGS:Mcommon}
+_APACHE_PORT_IS_SERVER=	yes
+_APACHE_ARGS:=		${_APACHE_ARGS:Nserver}
 .	endif
-# Catch unknown apache versions and silly USE_APACHE constructs
-.	if empty(AP_PORT_IS_SERVER) && empty(AP_PORT_IS_MODULE)
-IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} )
+.	if ${_APACHE_ARGS:Mbuild}
+_APACHE_BUILD_DEP=	yes
+_APACHE_ARGS:=		${_APACHE_ARGS:Nbuild}
 .	endif
-# Catch USE_APACHE [min]-[max]+
-.	if defined(AP_PLUS) && ${USE_APACHE:C/[.+0-9]//g} == "-"
-IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} )
+.	if ${_APACHE_ARGS:Mrun}
+_APACHE_RUN_DEP=	yes
+_APACHE_ARGS:=		${_APACHE_ARGS:Nrun}
 .	endif
-.elif defined(USE_APACHE)
-IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE ( no version specified )
-.endif # defined(USE_APACHE)
+.	if empty(_APACHE_ARGS)
+_APACHE_ARGS=		${APACHE_DEFAULT}
+.	endif
+# _APACHE_ARGS must now contain a version(-range)
+.	if !empty(_APACHE_ARGS:C/^2\.[0-9]//:S/^-//:C/^2\.[0-9]//:C/\+$//) 
+IGNORE= ${_ERROR_MSG} Illegal use of USES= ${USES:Mapache*}
+# Catch USES= apache:[min]-[max]+
+.	elif ${apache_ARGS:C/[.a-z0-9]//g} == "-+"
+IGNORE= ${_ERROR_MSG} Illegal use of USES= ${USES:Mapache*}
+.	endif
+.endif # defined(apache_ARGS)
 
+# The port does not specify a build, run or server dependency, assume both
+# build and run are required.
+.if !defined(_APACHE_BUILD_DEP) && !defined(_APACHE_RUN_DEP) && \
+	!defined(_APACHE_PORT_IS_SERVER)
+_APACHE_BUILD_DEP=	yes
+_APACHE_RUN_DEP=	yes
+.endif
+
+.if defined(DEFAULT_APACHE_VER)
+IGNORE+=	"DEFAULT_APACHE_VER is defined, consider using DEFAULT_VERSIONS+=apache=${DEFAULT_APACHE_VER} instead"
+.endif
+
+.if defined(WITH_MODULES) || defined(WITHOUT_MODULES)
+IGNORE=	${_ERROR_MSG} WITH(OUT)_MODULES has been removed, use www_${PORTNAME}_(UN)SET
+.endif
+
 # ===============================================================
-.if defined(AP_PORT_IS_SERVER)
+.if defined(_APACHE_PORT_IS_SERVER)
+
 # Module selection
 .for category in ${DEFAULT_MODULES_CATEGORIES}
 DEFAULT_MODULES+=	${${category}_MODULES}
@@ -135,37 +142,16 @@ DEFAULT_MODULES+=	${${category}_MODULES}
 AVAILABLE_MODULES+=	${${category}_MODULES}
 .endfor
 
-# detect invalid lowercase params in make.conf
-# keep this check until end of 2012
-.if defined(WITH_STATIC_MODULES) && ${WITH_STATIC_MODULES:M[a-z]*}
-IGNORE=		lowercase WITH_STATIC_MODULES="${WITH_STATIC_MODULES}"\
-		detected (make.conf), they shoud be UPPERCASE
-.endif
-
-# Setting "@comment " as default.
-.for module in ${AVAILABLE_MODULES:O}
-${module}PLIST_SUB=	"@comment "
-_DISABLE_MODULES+=	--disable-${module:tl}
-.endfor
-
-# Configure
-# dirty hacks to make sure all modules are disabled before we select them
-.if ${USE_APACHE:Mcommon2*}
-CONFIGURE_ARGS+= 	${_DISABLE_MODULES:O:u}
-.endif
-
 # OPTIONS handling
 .for module in ${AVAILABLE_MODULES}
 .	if ${PORT_OPTIONS:M${module}}
-_APACHE_MODULES+=	${module}
+_APACHE_ENABLED_MODS+=	${module}
 .	else
-WITHOUT_MODULES+=	${module}
+_APACHE_DISABLED_MODS+=	${module}
 .	endif
 .endfor
 
 .if !defined(WITH_STATIC_APACHE)
-# FYI
-#DYNAMIC_MODULES=	so
 CONFIGURE_ARGS+=	--enable-so
 .else
 CONFIGURE_ARGS+=	--disable-so
@@ -173,7 +159,7 @@ WITH_ALL_STATIC_MODULES=	yes
 .endif
 
 .if ${PORT_OPTIONS:MSUEXEC}
-_APACHE_MODULES+=	${SUEXEC_MODULES}
+_APACHE_ENABLED_MODS+=	${SUEXEC_MODULES}
 SUEXEC_CONFARGS=	with-suexec
 
 # SUEXEC_DOCROOT should exist
@@ -204,54 +190,33 @@ CONFIGURE_ARGS+=	--${SUEXEC_CONFARGS}-umask=${SUEXEC_U
 .	endif
 .endif
 
-.if !defined(WITHOUT_MODULES)
-APACHE_MODULES=		${_APACHE_MODULES}
+.if !defined(_APACHE_DISABLED_MODS)
+APACHE_MODULES=		${_APACHE_ENABLED_MODS}
 .else
-.for module in ${_APACHE_MODULES:O:u}
-.	if !${WITHOUT_MODULES:M${module}}
+.for module in ${_APACHE_ENABLED_MODS:O:u}
+.	if !${_APACHE_DISABLED_MODS:M${module}}
 APACHE_MODULES+=	${module}
 .	endif
 .endfor
 .endif
 
-.if defined(WITH_STATIC_MODULES)
-.for module in ${APACHE_MODULES}
-.	if ${WITH_STATIC_MODULES:M${module}}
-_CONFIGURE_ARGS+=	--enable-${module:tl}=static
-.	else
-_CONFIGURE_ARGS+=	--enable-${module:tl}=shared
-.	endif
-.endfor
-CONFIGURE_ARGS+=	${_CONFIGURE_ARGS:O}
-.elif defined(WITH_STATIC_APACHE) || defined(WITH_ALL_STATIC_MODULES)
+.if defined(WITH_STATIC_APACHE) || defined(WITH_ALL_STATIC_MODULES)
 WITH_STATIC_MODULES=	${APACHE_MODULES}
-CONFIGURE_ARGS+=	--enable-modules="${APACHE_MODULES:O:tl}"
-.else
-CONFIGURE_ARGS+=	--enable-mods-shared="${APACHE_MODULES:O:tl}"
 .endif
 
-# ====================================
-# start pkg-plist adjustments
-.if defined(WITH_STATIC_MODULES)
-.for module in ${APACHE_MODULES}
-.	if !${WITH_STATIC_MODULES:M${module}}
-_SHARED_MODULES+=	${module}
+.for module in ${AVAILABLE_MODULES}
+.	if !empty(WITH_STATIC_MODULES:M${module})
+CONFIGURE_ARGS+=	--enable-${module:tl}=static
+PLIST_SUB+=	MOD_${module}="@comment "
+.	elif !empty(APACHE_MODULES:M${module})
+CONFIGURE_ARGS+=	--enable-${module:tl}=shared
+PLIST_SUB+=	MOD_${module}=""
+.	else
+CONFIGURE_ARGS+=	--disable-${module:tl}
+PLIST_SUB+=	MOD_${module}="@comment "
 .	endif
 .endfor
 
-SHARED_MODULES=		${_SHARED_MODULES}
-.elif !defined(WITH_ALL_STATIC_MODULES)
-SHARED_MODULES=		${APACHE_MODULES}
-.endif
-
-.for module in ${SHARED_MODULES}
-${module}PLIST_SUB=	""
-.endfor
-
-.for module in ${AVAILABLE_MODULES:O:u}
-PLIST_SUB+=	MOD_${module}=${${module}PLIST_SUB}
-.endfor
-
 # pkg-plist workaround STATIC support
 .if ${PORT_OPTIONS:MSUEXEC}
 PLIST_SUB+=	SUEXEC=""
@@ -265,13 +230,10 @@ PLIST_SUB+=	FORENSIC=""
 PLIST_SUB+=	FORENSIC="@comment "
 .endif
 
-# end pkg-plist adjustments
+#### End of _APACHE_PORT_IS_SERVER ####
 
-#### End of AP_PORT_IS_SERVER ####
-
 # ===============================================================
-.elif defined(AP_PORT_IS_MODULE) || defined(USE_APACHE_RUN) || defined(USE_APACHE_BUILD)
-APXS?=		${LOCALBASE}/sbin/apxs
+.else
 HTTPD?=		${LOCALBASE}/sbin/httpd
 
 MODULENAME?=	${PORTNAME}
@@ -279,79 +241,50 @@ SHORTMODNAME?=	${MODULENAME:S/mod_//}
 SRC_FILE?=	${MODULENAME}.c
 
 .if exists(${HTTPD})
-_APACHE_VERSION!=	${HTTPD} -v | ${SED} -ne 's/^Server version: Apache\/\([0-9]\)\.\([0-9]*\).*/\1\2/p'
-.elif defined(APACHE_PORT)
-_APACHE_VERSION!=	${ECHO_CMD} ${APACHE_PORT} | ${SED} -ne 's,.*/apache\([0-9]*\).*,\1,p'
+_APACHE_VERSION!=	${HTTPD} -v | ${SED} -ne 's/^Server version: Apache\/\([1-9]\.[0-9]*\).*/\1/p'
 .endif
 
-.if defined(USE_APACHE)
-_USE_APACHE:=	${USE_APACHE}
-.elif defined(USE_APACHE_BUILD)
-_USE_APACHE:=	${USE_APACHE_BUILD}
-.elif defined(USE_APACHE_RUN)
-_USE_APACHE:=	${USE_APACHE_RUN}
-.endif
+# Validate Apache version whether it meets the version restriction.
+_APACHE_VERSION_CHECK:=		${_APACHE_ARGS:C/^([1-9]\.[0-9])$/\1-\1/}
+_APACHE_VERSION_MIN_TMP:=	${_APACHE_VERSION_CHECK:C/([1-9]\.[0-9])[-+].*/\1/}
+_APACHE_VERSION_MIN:=		${_APACHE_VERSION_MIN_TMP:M[1-9].[0-9]}
+_APACHE_VERSION_MAX_TMP:=	${_APACHE_VERSION_CHECK:C/.*-([1-9]\.[0-9])/\1/}
+_APACHE_VERSION_MAX:=		${_APACHE_VERSION_MAX_TMP:M[1-9].[0-9]}
 
-_APACHE_VERSION_CHECK:=		${_USE_APACHE:C/^([1-9][0-9])$/\1-\1/}
-_APACHE_VERSION_MINIMUM_TMP:=	${_APACHE_VERSION_CHECK:C/([1-9][0-9])[-+].*/\1/}
-_APACHE_VERSION_MINIMUM:=	${_APACHE_VERSION_MINIMUM_TMP:M[1-9][0-9]}
-_APACHE_VERSION_MAXIMUM_TMP:=	${_APACHE_VERSION_CHECK:C/.*-([1-9][0-9])/\1/}
-_APACHE_VERSION_MAXIMUM:=	${_APACHE_VERSION_MAXIMUM_TMP:M[1-9][0-9]}
-
-# ==============================================================
-# num+
-.if ${_USE_APACHE:M*+}
-_APACHE_WANTED_VERSIONS=	${DEFAULT_APACHE_VERSION}
-
-# -num
-.elif ${_USE_APACHE:M\-[0-9][0-9]}
-.for _v in ${APACHE_SUPPORTED_VERSION:O}
-.	if ${_APACHE_VERSION_MAXIMUM} >= ${_v}
-_APACHE_WANTED_VERSIONS+=	${_v}
+# Remove from _WANTED_VERSIONS that which is not wanted
+_APACHE_WANTED_VERSIONS=	${_APACHE_SUPPORTED_VERSIONS}
+.for _ver in ${_APACHE_SUPPORTED_VERSIONS:O}
+.	if !empty(_APACHE_VERSION_MIN) && ${_ver} < ${_APACHE_VERSION_MIN}
+_APACHE_WANTED_VERSIONS:=	${_APACHE_WANTED_VERSIONS:N${_ver}}
 .	endif
-.endfor
-
-# num-num
-.elif ${_USE_APACHE:M[0-9][0-9]-[0-9][0-9]}
-.for _v in ${APACHE_SUPPORTED_VERSION}
-.	if ${_APACHE_VERSION_MINIMUM} <= ${_v} && ${_APACHE_VERSION_MAXIMUM} >= ${_v}
-_APACHE_WANTED_VERSIONS+=	${_v}
+.	if !empty(_APACHE_VERSION_MAX) && ${_ver} > ${_APACHE_VERSION_MAX}
+_APACHE_WANTED_VERSIONS:=	${_APACHE_WANTED_VERSIONS:N${_ver}}		
 .	endif
 .endfor
 
-# num
-.elif ${_USE_APACHE:M[0-9][0-9]}
-_APACHE_WANTED_VERSIONS=	${_USE_APACHE:M[0-9][0-9]}
+# Check if installed Apache version matches a wanted version
+.if defined(_APACHE_VERSION) && $(_APACHE_WANTED_VERSIONS:M${_APACHE_VERSION})
+_APACHE_WANTED_VERSION=	${_APACHE_VERSION}
 .endif
-# ==============================================================
-
-.if !defined(_APACHE_WANTED_VERSIONS)
-_APACHE_WANTED_VERSIONS=	${DEFAULT_APACHE_VERSION}
-.endif
-
-.for _v in ${_APACHE_WANTED_VERSIONS:O:u}
-_APACHE_HIGHEST_VERSION:=	${_v}
-.	if defined (_APACHE_VERSION) && ${_APACHE_VERSION} == ${_v}
-_APACHE_WANTED_VERSION:=	${_v}
+# Select Apache version if not already set
+.for _ver in ${APACHE_DEFAULT} ${_APACHE_SUPPORTED_VERSIONS}
+.	if !defined(_APACHE_WANTED_VERSION) && ${_APACHE_WANTED_VERSIONS:M${_ver}}
+_APACHE_WANTED_VERSION=	${_ver}
 .	endif
 .endfor
 
-.if !defined(_APACHE_WANTED_VERSION)
-# next line is broken on 8.x and 9.x but working on 10
-#_APACHE_WANTED_VERSION:=	${_APACHE_WANTED_VERSIONS:O:u:M${DEFAULT_APACHE_VERSION}}
-# working line on 8.x, 9.x, 10
-_APACHE_WANTED_VERSION:=	${_APACHE_WANTED_VERSIONS:O:u:MDEFAULT_APACHE_VERSION}
-.	if empty(_APACHE_WANTED_VERSION)
-_APACHE_WANTED_VERSION:=	${_APACHE_HIGHEST_VERSION}
-.	endif
+APACHE_VERSION:=	${_APACHE_WANTED_VERSION}
+
+.if defined(_APACHE_VERSION) && ${_APACHE_VERSION} != ${APACHE_VERSION}
+BROKEN=	${_ERROR_MSG} Apache ${_APACHE_VERSION} is installed and port requires ${_APACHE_WANTED_VERSION}
 .endif
 
-.if defined(_APACHE_VERSION) && ${_APACHE_VERSION} != ${_APACHE_WANTED_VERSION}
-BROKEN=	${_ERROR_MSG} apache${_APACHE_VERSION} is installed (or APACHE_PORT is defined) and port requires apache${_APACHE_VERSION_NONSUPPORTED}
+.if ${APACHE_VERSION} >= 2.5
+APXS?=	${LOCALBASE}/bin/apxs
+.else
+APXS?=	${LOCALBASE}/sbin/apxs
 .endif
 
-APACHE_VERSION:=	${_APACHE_WANTED_VERSION}
-
 .if exists(${APXS})
 APXS_PREFIX!=	${APXS} -q prefix 2> /dev/null || echo NULL
 .	if ${APXS_PREFIX} == NULL
@@ -362,10 +295,14 @@ IGNORE?=	PREFIX must be equal to APXS_PREFIX.
 .	endif
 .endif
 
-APACHEMODDIR=	libexec/apache${APACHE_VERSION}
-APACHEINCLUDEDIR=include/apache${APACHE_VERSION}
-APACHEETCDIR=	etc/apache${APACHE_VERSION}
-APACHE_PORT?=	www/apache${APACHE_VERSION}
+APACHEMODDIR=		libexec/apache${APACHE_VERSION:S/.//}
+APACHEINCLUDEDIR=	include/apache${APACHE_VERSION:S/.//}
+APACHEETCDIR=		etc/apache${APACHE_VERSION:S/.//}
+.if ${APACHE_VERSION} == 2.5
+APACHE_PORT?=		www/apache${APACHE_VERSION:S/.//}-devel
+.else
+APACHE_PORT?=		www/apache${APACHE_VERSION:S/.//}
+.endif
 
 PLIST_SUB+=	APACHEMODDIR="${APACHEMODDIR}" \
 		APACHEINCLUDEDIR="${APACHEINCLUDEDIR}" \
@@ -376,17 +313,17 @@ SUB_LIST+=	APACHEMODDIR="${APACHEMODDIR}" \
 		APACHEETCDIR="${APACHEETCDIR}" \
 		APACHE_VERSION="${APACHE_VERSION}"
 
-APACHE_PKGNAMEPREFIX=	ap${APACHE_VERSION}-
+APACHE_PKGNAMEPREFIX=	ap${APACHE_VERSION:S/.//}-
 
 .if defined(AP_FAST_BUILD)
 PKGNAMEPREFIX?=	${APACHE_PKGNAMEPREFIX}
 .endif
 
-.if defined(USE_APACHE) || defined(USE_APACHE_BUILD)
+.if defined(_APACHE_BUILD_DEP)
 BUILD_DEPENDS+=	${APXS}:${APACHE_PORT}
 .endif
 
-.if defined(USE_APACHE) || defined(USE_APACHE_RUN)
+.if defined(_APACHE_RUN_DEP)
 RUN_DEPENDS+=	${APXS}:${APACHE_PORT}
 .endif
 
@@ -404,41 +341,17 @@ AP_EXTRAS+=	-I ${AP_INC}
 AP_EXTRAS+=	-L ${AP_LIB}
 .endif
 
-.endif # End of AP_PORT_IS_SERVER   / AP_PORT_IS_MOULE
-.endif # End of !Apache_Pre_Include
+.endif # End of _APACHE_PORT_IS_SERVER / _APACHE_PORT_IS_MOULE
+.endif # End of !_INCLUDE_USES_APACHE_PRE_MK
 
 # ===============================================================
-.if defined(_POSTMKINCLUDED) && !defined(Apache_Post_Include)
-Apache_Post_Include=	bsd.apache.mk
-
-.if defined(USE_APACHE_RUN) && !empty(USE_APACHE_RUN)
-.	if ${USE_APACHE_RUN:C/\-//:S/^22//:S/^24//:C/\+$//} != ""
-IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE_RUN ( ${USE_APACHE_RUN} )
-.	endif
-.elif defined(USE_APACHE_RUN)
-IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE_RUN ( no valid version specified )
+.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_APACHE_POST_MK)
+_INCLUDE_USES_APACHE_POST_MK=	apache.mk
+.if defined(NO_BUILD) && !defined(_APACHE_RUN_DEP)
+BROKEN=	If NO_BUILD is used, then apache:run is sufficient. Please fix your Makefile
 .endif
 
-.if defined(USE_APACHE_BUILD) && !empty(USE_APACHE_BUILD)
-.	if ${USE_APACHE_BUILD:C/\-//:S/^22//:S/^24//:C/\+$//} != ""
-IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE_BUILD ( ${USE_APACHE_BUILD} )
-.	endif
-.elif defined(USE_APACHE_BUILD)
-IGNORE=	${_ERROR_MSG} Illegal use of USE_APACHE_BUILD ( no valid version specified )
-.endif
-
-# Check if USE_APACHE(_BUILD|_RUN) are mixed together
-.if defined(USE_APACHE) && ( defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN) )
-IGNORE=	${_ERROR_MSG} specify only one of: USE_APACHE USE_APACHE_BUILD USE_APACHE_RUN
-.elif defined(USE_APACHE_BUILD) && defined(USE_APACHE_RUN)
-IGNORE= ${_ERROR_MSG} use USE_APACHE instead of USE_APACHE_BUILD and USE_APACHE_RUN together
-.endif
-
-.if defined(NO_BUILD) && defined(USE_APACHE)
-BROKEN=	If NO_BUILD is used, then USE_APACHE_RUN is sufficient. Please fix your Makefile
-.endif
-
-.if defined(AP_PORT_IS_SERVER)
+.if defined(_APACHE_PORT_IS_SERVER)
 .if !target(print-closest-mirrors)
 print-closest-mirrors:
 	@${ECHO_MSG} -n "Fetching list of nearest mirror: " >&2
@@ -474,7 +387,7 @@ show-modules:
 .endif
 .endif
 
-.elif defined(AP_PORT_IS_MODULE)
+.else
 
 .if defined(AP_MODENABLE)
 AP_MOD_EN=	-a
@@ -516,5 +429,5 @@ do-install:
 .endif
 
 .endif          # defined(AP_FAST_BUILD)
-.endif          # defined(AP_PORT_IS_SERVER / AP_PORT_IS_MODULE)
-.endif          # defined(_POSTMKINCLUDED) && !defined(Apache_Post_Include)
+.endif          # defined(_APACHE_PORT_IS_SERVER / _APACHE_PORT_IS_MODULE)
+.endif          # defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_APACHE_PRE_MK)

Modified: head/Mk/Uses/php.mk
==============================================================================
--- head/Mk/Uses/php.mk	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/Mk/Uses/php.mk	Sun Mar 11 14:23:28 2018	(r464175)
@@ -278,7 +278,7 @@ BUILD_DEPENDS+=	${PHPBASE}/include/php/main/php.h:${PH
 RUN_DEPENDS+=	${PHPBASE}/include/php/main/php.h:${PHP_PORT}
 .  if  ${php_ARGS:Mmod} || (${php_ARGS:Mweb} && defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "")
 USE_APACHE_RUN=	22+
-.include "${PORTSDIR}/Mk/bsd.apache.mk"
+.include "${PORTSDIR}/Mk/Uses/apache.mk"
 # libphpX.so only has the major version number in it, so remove the last digit of PHP_VER to get it.
 RUN_DEPENDS+=	${PHPBASE}/${APACHEMODDIR}/libphp${PHP_VER:C/.$//}.so:${MOD_PHP_PORT}
 .  endif

Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/Mk/bsd.port.mk	Sun Mar 11 14:23:28 2018	(r464175)
@@ -433,8 +433,6 @@ FreeBSD_MAINTAINER=	portmgr at FreeBSD.org
 #				  ${PREFIX}/etc/rc.d if ${PREFIX} is not /usr, otherwise they
 #				  will be installed in /etc/rc.d/ and added to the packing list.
 ##
-# USE_APACHE	- If set, this port relies on an apache webserver.
-#
 # Conflict checking.  Use if your port cannot be installed at the same time as
 # another package.
 #
@@ -1393,8 +1391,13 @@ USES+=	php
 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
 .endif
 
-.if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
-.include "${PORTSDIR}/Mk/bsd.apache.mk"
+.if defined(USE_APACHE_BUILD)
+USES+=	apache:build,${USE_APACHE_BUILD:C/2([0-9])/2.\1/g}
+.elif defined(USE_APACHE_RUN)
+USES+=	apache:run,${USE_APACHE_RUN:C/2([0-9])/2.\1/g}
+.elif defined(USE_APACHE)
+USE_APACHE:=	${USE_APACHE:S/common/server,/}
+USES+=	apache:${USE_APACHE:C/2([0-9])/2.\1/g}
 .endif
 
 .if defined(USE_QT4) || defined(USE_QT5)
@@ -1980,10 +1983,6 @@ _USES_POST+=	php
 
 .if defined(USE_WX) || defined(USE_WX_NOT)
 .include "${PORTSDIR}/Mk/bsd.wx.mk"
-.endif
-
-.if defined(USE_APACHE) || defined(USE_APACHE_BUILD) || defined(USE_APACHE_RUN)
-.include "${PORTSDIR}/Mk/bsd.apache.mk"
 .endif
 
 .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL)

Modified: head/Mk/bsd.sanity.mk
==============================================================================
--- head/Mk/bsd.sanity.mk	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/Mk/bsd.sanity.mk	Sun Mar 11 14:23:28 2018	(r464175)
@@ -161,11 +161,12 @@ SANITY_UNSUPPORTED=	USE_OPENAL USE_FAM USE_MAKESELF US
 		USE_ZENDEXT USE_PHP_BUILD USE_BDB PLIST_DIRSTRY USE_RCORDER \
 		USE_OPENSSL WANT_GNOME RUBYGEM_AUTOPLIST WANT_SDL INSTALLS_EGGINFO \
 		USE_DOS2UNIX NO_STAGE USE_RUBYGEMS USE_GHOSTSCRIPT \
-		USE_GHOSTSCRIPT_BUILD USE_GHOSTSCRIPT_RUN USE_AUTOTOOLS 
+		USE_GHOSTSCRIPT_BUILD USE_GHOSTSCRIPT_RUN USE_AUTOTOOLS APACHE_PORT
 SANITY_DEPRECATED=	PYTHON_PKGNAMESUFFIX MLINKS \
 			USE_MYSQL WANT_MYSQL_VER \
 			USE_PHPIZE WANT_PHP_CLI WANT_PHP_CGI WANT_PHP_MOD \
-			WANT_PHP_WEB WANT_PHP_EMB PYDISTUTILS_INSTALLNOSINGLE
+			WANT_PHP_WEB WANT_PHP_EMB PYDISTUTILS_INSTALLNOSINGLE \
+			USE_APACHE USE_APACHE_BUILD USE_APACHE_RUN
 SANITY_NOTNEEDED=	CMAKE_NINJA WX_UNICODE USE_KDEBASE_VER \
 			USE_KDELIBS_VER USE_QT_VER
 
@@ -239,6 +240,10 @@ USE_GHOSTSCRIPT_ALT=	USES=ghostscript
 USE_GHOSTSCRIPT_BUILD_ALT=	USES=ghostscript
 USE_GHOSTSCRIPT_RUN_ALT=	USES=ghostscript
 NO_STAGE_ALT=	https://wiki.freebsd.org/ports/StageDir to convert your port to staging
+USE_APACHE_ALT=		USES=apache:${USE_APACHE:C/2(0-9)/2.\1/g}
+USE_APACHE_BUILD_ALT=	USES=apache:build,${USE_APACHE_BUILD:C/2(0-9)/2.\1/g}
+USE_APACHE_RUN_ALT=	USES=apache:run,${USE_APACHE_RUN:C/2(0-9)/2.\1/g}
+APACHE_PORT_ALT=	DEFAULT_VERSIONS+=apache=${APACHE_PORT:S/www\/apache//:C/2(0-9)/2.\1/}
 
 .for a in ${SANITY_DEPRECATED}
 .if defined(${a})

Modified: head/lang/php56/Makefile
==============================================================================
--- head/lang/php56/Makefile	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/lang/php56/Makefile	Sun Mar 11 14:23:28 2018	(r464175)
@@ -86,7 +86,7 @@ CONFIGURE_ARGS+=--enable-fpm \
 
 .if defined(PKGNAMEPREFIX)
 USE_APACHE=	22+
-.include "${PORTSDIR}/Mk/bsd.apache.mk"
+.include "${PORTSDIR}/Mk/Uses/apache.mk"
 .if ${PORT_OPTIONS:MAP2FILTER}
 CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
 .else

Modified: head/lang/php70/Makefile
==============================================================================
--- head/lang/php70/Makefile	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/lang/php70/Makefile	Sun Mar 11 14:23:28 2018	(r464175)
@@ -92,7 +92,7 @@ CONFIGURE_ARGS+=--enable-fpm \
 
 .if defined(PKGNAMEPREFIX)
 USE_APACHE=	22+
-.include "${PORTSDIR}/Mk/bsd.apache.mk"
+.include "${PORTSDIR}/Mk/Uses/apache.mk"
 .if ${PORT_OPTIONS:MAP2FILTER}
 CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
 .else

Modified: head/lang/php71/Makefile
==============================================================================
--- head/lang/php71/Makefile	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/lang/php71/Makefile	Sun Mar 11 14:23:28 2018	(r464175)
@@ -93,7 +93,7 @@ CONFIGURE_ARGS+=--enable-fpm \
 
 .if defined(PKGNAMEPREFIX)
 USE_APACHE=	22+
-.include "${PORTSDIR}/Mk/bsd.apache.mk"
+.include "${PORTSDIR}/Mk/Uses/apache.mk"
 .if ${PORT_OPTIONS:MAP2FILTER}
 CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
 .else

Modified: head/lang/php72/Makefile
==============================================================================
--- head/lang/php72/Makefile	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/lang/php72/Makefile	Sun Mar 11 14:23:28 2018	(r464175)
@@ -86,7 +86,7 @@ CONFIGURE_ARGS+=--enable-fpm \
 
 .if defined(PKGNAMEPREFIX)
 USE_APACHE=	22+
-.include "${PORTSDIR}/Mk/bsd.apache.mk"
+.include "${PORTSDIR}/Mk/Uses/apache.mk"
 .if ${PORT_OPTIONS:MAP2FILTER}
 CONFIGURE_ARGS+=--with-apxs2filter=${APXS}
 .else

Modified: head/www/apache22/Makefile
==============================================================================
--- head/www/apache22/Makefile	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/www/apache22/Makefile	Sun Mar 11 14:23:28 2018	(r464175)
@@ -31,8 +31,7 @@ CONFLICTS_INSTALL=	caudium14-1.* \
 DEPRECATED=		Upstream propose EoL of apache 2.2.x during the next 12 months
 EXPIRATION_DATE=	2017-07-01
 
-USE_APACHE=	common22
-USES=		autoreconf bdb cpe iconv libtool perl5 tar:bzip2
+USES=		apache:server,2.2 autoreconf bdb cpe iconv libtool perl5 tar:bzip2
 
 USE_PERL5=	run
 USE_RC_SUBR=	apache22 htcacheclean

Modified: head/www/apache22/Makefile.modules
==============================================================================
--- head/www/apache22/Makefile.modules	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/www/apache22/Makefile.modules	Sun Mar 11 14:23:28 2018	(r464175)
@@ -83,16 +83,13 @@ WITH_EXCEPTION_HOOK=	yes
 CONFIGURE_ARGS+=	--enable-exception-hook
 .endif
 
-.if ${PORT_OPTIONS:MAUTH_BASIC} || ${PORT_OPTIONS:MAUTH_DIGEST}
-.  if !${APACHE_MODULES:MAUTHN*}
+.if ( ${PORT_OPTIONS:MAUTH_BASIC} || ${PORT_OPTIONS:MAUTH_DIGEST} ) && \
+	empty(PORT_OPTIONS:MAUTHN*)
 IGNORE=	AUTH_BASIC and AUTH_DIGEST need at least one AUTHN provider
-.  endif
 .endif
 
-.if ${PORT_OPTIONS:MAUTH_BASIC}
-.  if !${APACHE_MODULES:MAUTHZ*}
+.if ${PORT_OPTIONS:MAUTH_BASIC} && empty(PORT_OPTIONS:MAUTHZ*)
 IGNORE=	AUTH_BASIC need at least one AUTHZ provider
-.  endif
 .endif
 
 CONFIGURE_ARGS+=	--with-mpm=${WITH_MPM}

Modified: head/www/apache24/Makefile
==============================================================================
--- head/www/apache24/Makefile	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/www/apache24/Makefile	Sun Mar 11 14:23:28 2018	(r464175)
@@ -20,8 +20,7 @@ LIB_DEPENDS=	libexpat.so:textproc/expat2 \
 CONFLICTS_INSTALL=	caudium14-1.* \
 			apache-*-2.2.* apache22-*
 
-USE_APACHE=	common24
-USES=		autoreconf cpe iconv libtool perl5 tar:bzip2
+USES=		apache:server,2.4 autoreconf cpe iconv libtool perl5 tar:bzip2
 USE_PERL5=	run
 USE_RC_SUBR=	apache24 htcacheclean
 GNU_CONFIGURE=	yes

Modified: head/www/apache24/Makefile.modules
==============================================================================
--- head/www/apache24/Makefile.modules	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/www/apache24/Makefile.modules	Sun Mar 11 14:23:28 2018	(r464175)
@@ -68,16 +68,13 @@ WITH_EXCEPTION_HOOK=	yes
 CONFIGURE_ARGS+=	--enable-exception-hook
 .endif
 
-.if ${PORT_OPTIONS:MAUTH_BASIC} || ${PORT_OPTIONS:MAUTH_DIGEST}
-.  if !${APACHE_MODULES:MAUTHN*}
+.if ( ${PORT_OPTIONS:MAUTH_BASIC} || ${PORT_OPTIONS:MAUTH_DIGEST} ) && \
+	empty(PORT_OPTIONS:MAUTHN*)
 IGNORE=	AUTH_BASIC and AUTH_DIGEST need at least one AUTHN provider
-.  endif
 .endif
 
-.if ${PORT_OPTIONS:MAUTH_BASIC}
-.  if !${APACHE_MODULES:MAUTHZ*}
+.if ${PORT_OPTIONS:MAUTH_BASIC} && empty(PORT_OPTIONS:MAUTHZ*)
 IGNORE=	AUTH_BASIC need at least one AUTHZ provider
-.  endif
 .endif
 
 .if ${PORT_OPTIONS:MXML2ENC} || ${PORT_OPTIONS:MPROXY_HTML}

Modified: head/www/mod_auth_pubtkt/Makefile
==============================================================================
--- head/www/mod_auth_pubtkt/Makefile	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/www/mod_auth_pubtkt/Makefile	Sun Mar 11 14:23:28 2018	(r464175)
@@ -18,7 +18,7 @@ SRC_FILE=	src/mod_auth_pubtkt.c
 
 .include <bsd.port.pre.mk>
 
-.if ${APACHE_VERSION} > 22
+.if ${APACHE_VERSION} > 2.2
 AP_EXTRAS=	-DAPACHE24
 .else
 AP_EXTRAS=	-DAPACHE22

Modified: head/www/mod_evasive/Makefile
==============================================================================
--- head/www/mod_evasive/Makefile	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/www/mod_evasive/Makefile	Sun Mar 11 14:23:28 2018	(r464175)
@@ -30,7 +30,7 @@ post-patch:
 	@${REINPLACE_CMD} -e "s|/bin/mail|/usr/bin/mail|g" \
 		${WRKSRC}/mod_evasive.c ${WRKSRC}/mod_evasive20.c \
 		${WRKSRC}/mod_evasiveNSAPI.c
-.if ${APACHE_VERSION:M24}
+.if ${APACHE_VERSION:M2.4}
 	@${REINPLACE_CMD} -e 's/remote_ip/client_ip/g' ${WRKSRC}/mod_evasive20.c
 .endif
 

Modified: head/www/mod_perl2/Makefile
==============================================================================
--- head/www/mod_perl2/Makefile	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/www/mod_perl2/Makefile	Sun Mar 11 14:23:28 2018	(r464175)
@@ -33,8 +33,8 @@ PLIST_SUB+=	APMOD_FILE=${APMOD_FILE}
 
 .include <bsd.port.pre.mk>
 
-# Provider is build iff apache24 is in use
-.if ${APACHE_VERSION:M22}
+# Provider is built if apache24 is in use
+.if ${APACHE_VERSION:M2.2}
 PLIST_SUB+=	AP22="@comment "
 .else
 PLIST_SUB+=	AP22=""

Modified: head/www/mod_scgi/Makefile
==============================================================================
--- head/www/mod_scgi/Makefile	Sun Mar 11 14:10:01 2018	(r464174)
+++ head/www/mod_scgi/Makefile	Sun Mar 11 14:23:28 2018	(r464175)
@@ -22,7 +22,7 @@ AP_GENPLIST=	yes
 
 .include <bsd.port.pre.mk>
 
-.if ${APACHE_VERSION} == 24
+.if ${APACHE_VERSION} == 2.4
 EXTRA_PATCHES=	${FILESDIR}/apache24-compat-mod__scgi.c
 .endif
 


More information about the svn-ports-head mailing list