Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/apache.mk
- This file was moved from Mk/bsd.apache.mk.
#-*- tab-width: 4; -*- | |||||
# ex:ts=4 | |||||
# | |||||
# $FreeBSD: head/Mk/bsd.apache.mk 419511 2016-08-03 12:09:37Z mat $ | # $FreeBSD: head/Mk/bsd.apache.mk 419511 2016-08-03 12:09:37Z mat $ | ||||
# | # | ||||
# bsd.apache.mk - Apache related macros. | # apache.mk - Apache related macros. | ||||
# Author: Clement Laforet <clement@FreeBSD.org> | # Author: Clement Laforet <clement@FreeBSD.org> | ||||
# Author: Olli Hauer <ohauer@FreeBSD.org> | # Author: Olli Hauer <ohauer@FreeBSD.org> | ||||
# Author: Bernard Spil <brnrd@FreeSBD.org> | |||||
# | # | ||||
# Please view me with 4 column tabs! | # Please view me with 4 column tabs! | ||||
# ========================================================================= | # Feature: apache | ||||
# User controlled parameters for usage in /etc/make.conf: | # Usage: USES=apache or USES=apache:args | ||||
# Valid args: <version>, build, run, server | |||||
# | # | ||||
# DEFAULT_VERSIONS - define the default apache version | # version If your port requires a specific Apache httpd version, you can | ||||
# valid args: apache=2.2, apache=2.4 | # set this to [min]-[max] or min+ or -max or an explicit version | ||||
# | # | ||||
# APACHE_PORT - use www/apache22-(event|itk|peruser|worker)-mpm | # USES=apache:2.2 # Only use Apache 2.2 | ||||
# instead www/apache22. Use this parameter only in | # USES=apache:2.4+ # Use Apache 2.4 or newer | ||||
# combination with "DEFAULT_VERSIONS+= apache=2.2" | # 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: | # Valid version numbers are specified in the variable | ||||
# - Set apache22 as default version | # APACHE_SUPPORTED_VERSIONS below | ||||
# DEFAULT_VERSIONS+= apache=2.2 | |||||
# | # | ||||
# - Additional use a special www/apache22-$MPM port | # build Indicates that Apache is needed at build time and adds it to | ||||
# APACHE_PORT= www/apache22-event-mpm | # 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: | # If build and run are omitted, Apache will be added as BUILD_DEPENDS and | ||||
# - This parameters should never be used in the Makefile of a port! | # RUN_DEPENDS | ||||
# - To get a list of "possible" APACHE_PORT values execute the command: | |||||
# $> awk '/apache22-/ {print "www/" $3}' ports/www/Makefile | |||||
# | # | ||||
# ========================================================================= | # Variables, which can be set by the port: | ||||
# | # | ||||
# This script will be included if one of the following parameter | # AP_FAST_BUILD automatic module build | ||||
# is defined in the Makefile of the port | |||||
# | # | ||||
# USE_APACHE - Set apache and apxs as build and run dependency | # AP_GENPLIST automatic PLIST generation plus add | ||||
# USE_APACHE_BUILD - Set apache and apxs as build dependency | # the module disabled into httpd.conf | ||||
# USE_APACHE_RUN - Set apache and apxs as run dependency | # (only if no pkg-plist exist) | ||||
# | # | ||||
# The following example is representative of all three possible | # MODULENAME Name of the Apache module | ||||
# parameters to use. | # 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: | # Variables, for internal use by the Apache ports framework only | ||||
# USE_APACHE= 22 # specify exact version | # The following values for USE_APACHE are reserved and only valid | ||||
# 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 | |||||
# | |||||
# 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 values for USE_APACHE are reserverd and only valid | |||||
# in apache-server ports! | # in apache-server ports! | ||||
# USE_APACHE= common22 | # USES= apache:server,2.2 | ||||
# | # | ||||
# | # | ||||
# The following variables can be used (ro) in ports Makefile | # The following variables can be read by ports and must not be modified | ||||
# ========================================================================= | |||||
# - APACHE_VERSION | |||||
# - APACHEETCDIR | |||||
# - APACHEINCLUDEDIR | |||||
# - APACHEMODDIR | |||||
# - DEFAULT_APACHE_VERSION | |||||
# | # | ||||
# APACHE_VERSION The major-minor release version of the chosen | |||||
# Apache server, e.g. 2.2 or 2.4 | |||||
# | # | ||||
# Parameters for building third party apache modules: | # APACHEETCDIR Location of the Apache configuration directory | ||||
# ========================================================================= | # Default: ${LOCALBASE}/etc/apache24 | ||||
# - AP_FAST_BUILD # automatic module build | |||||
# | # | ||||
# - AP_GENPLIST # automatic PLIST generation plus add | # APACHEINCLUDEDIR Location of the Apache include files | ||||
# # the module disabled into httpd.conf | # Default: ${LOCALBASE}/include/apache24 | ||||
# # (only if no pkg-plist exist) | |||||
# | # | ||||
# - MODULENAME # default: ${PORTNAME} | # APACHEMODDIR Location of the Apache modules | ||||
# - SHORTMODNAME # default: ${MODULENAME:S/mod_//} | # Default: ${LOCALBASE}/libxexec/apache24 | ||||
# - SRC_FILE # default: ${MODULENAME}.c | |||||
# | # | ||||
# APACHE_DEFAULT Default Apache version | |||||
# | # | ||||
.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 | # When adding a version, please keep the comment in | ||||
# Mk/bsd.default-versions.mk in sync. | # 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 | ||||
brnrd: Left-over from testing with an additional httpd-trunk port, removed locally | |||||
Not Done Inline ActionsRe-added for addition of www/apache25-devel (see D13111) brnrd: Re-added for addition of www/apache25-devel (see D13111) | |||||
# Print warnings | # Print warnings | ||||
_ERROR_MSG= : Error from bsd.apache.mk. | _ERROR_MSG= : Error from apache.mk. | ||||
# Important Note: | # Important Note: | ||||
# Keep apache version in ascending order! | |||||
# The "+" sign is only valid as last sign, not between | # The "+" sign is only valid as last sign, not between | ||||
# two versions or in combination with range! | # two versions or in combination with range! | ||||
.if defined(USE_APACHE) && !empty(USE_APACHE) | .if defined(apache_ARGS) && !empty(apache_ARGS) | ||||
. if ${USE_APACHE:Mcommon*} != "" | # Preserve original arguments list | ||||
AP_PORT_IS_SERVER= yes | _APACHE_ARGS= ${apache_ARGS} | ||||
. elif ${USE_APACHE:C/\-//:S/^22//:S/^24//:C/\+$//} == "" | . if ${_APACHE_ARGS:Mserver} | ||||
AP_PORT_IS_MODULE= yes | _APACHE_PORT_IS_SERVER= yes | ||||
. if ${USE_APACHE:C/\-//:S/^22//:S/^24//} == "+" | _APACHE_ARGS:= ${_APACHE_ARGS:Nserver} | ||||
AP_PLUS= yes | |||||
. endif | . endif | ||||
. else | . if ${_APACHE_ARGS:Mbuild} | ||||
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} ) | _APACHE_BUILD_DEP= yes | ||||
_APACHE_ARGS:= ${_APACHE_ARGS:Nbuild} | |||||
. endif | . endif | ||||
# Catch unknown apache versions and silly USE_APACHE constructs | . if ${_APACHE_ARGS:Mrun} | ||||
. if empty(AP_PORT_IS_SERVER) && empty(AP_PORT_IS_MODULE) | _APACHE_RUN_DEP= yes | ||||
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} ) | _APACHE_ARGS:= ${_APACHE_ARGS:Nrun} | ||||
. endif | . endif | ||||
Done Inline ActionsWould probably be a good idea to make it fatal. At one point, old glue should be removed. mat: Would probably be a good idea to make it fatal. At one point, old glue should be removed. | |||||
# Catch USE_APACHE [min]-[max]+ | . if empty(_APACHE_ARGS) | ||||
. if defined(AP_PLUS) && ${USE_APACHE:C/[.+0-9]//g} == "-" | _APACHE_ARGS= ${APACHE_DEFAULT} | ||||
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE ( ${USE_APACHE} ) | |||||
. endif | . endif | ||||
.elif defined(USE_APACHE) | # _APACHE_ARGS must now contain a version(-range) | ||||
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE ( no version specified ) | . if !empty(_APACHE_ARGS:C/^2\.[0-9]//:S/^-//:C/^2\.[0-9]//:C/\+$//) | ||||
.endif # defined(USE_APACHE) | 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 | # Module selection | ||||
.for category in ${DEFAULT_MODULES_CATEGORIES} | .for category in ${DEFAULT_MODULES_CATEGORIES} | ||||
DEFAULT_MODULES+= ${${category}_MODULES} | DEFAULT_MODULES+= ${${category}_MODULES} | ||||
.endfor | .endfor | ||||
.for category in ${ALL_MODULES_CATEGORIES} | .for category in ${ALL_MODULES_CATEGORIES} | ||||
AVAILABLE_MODULES+= ${${category}_MODULES} | AVAILABLE_MODULES+= ${${category}_MODULES} | ||||
.endfor | .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 | # OPTIONS handling | ||||
.for module in ${AVAILABLE_MODULES} | .for module in ${AVAILABLE_MODULES} | ||||
. if ${PORT_OPTIONS:M${module}} | . if ${PORT_OPTIONS:M${module}} | ||||
_APACHE_MODULES+= ${module} | _APACHE_ENABLED_MODS+= ${module} | ||||
. else | . else | ||||
WITHOUT_MODULES+= ${module} | _APACHE_DISABLED_MODS+= ${module} | ||||
. endif | . endif | ||||
.endfor | .endfor | ||||
.if !defined(WITH_STATIC_APACHE) | .if !defined(WITH_STATIC_APACHE) | ||||
# FYI | |||||
#DYNAMIC_MODULES= so | |||||
CONFIGURE_ARGS+= --enable-so | CONFIGURE_ARGS+= --enable-so | ||||
.else | .else | ||||
CONFIGURE_ARGS+= --disable-so | CONFIGURE_ARGS+= --disable-so | ||||
WITH_ALL_STATIC_MODULES= yes | WITH_ALL_STATIC_MODULES= yes | ||||
.endif | .endif | ||||
.if ${PORT_OPTIONS:MSUEXEC} | .if ${PORT_OPTIONS:MSUEXEC} | ||||
_APACHE_MODULES+= ${SUEXEC_MODULES} | _APACHE_ENABLED_MODS+= ${SUEXEC_MODULES} | ||||
SUEXEC_CONFARGS= with-suexec | SUEXEC_CONFARGS= with-suexec | ||||
# SUEXEC_DOCROOT should exist | # SUEXEC_DOCROOT should exist | ||||
SUEXEC_DOCROOT?= ${PREFIX}/www/data | SUEXEC_DOCROOT?= ${PREFIX}/www/data | ||||
#SUEXEC_DOCROOT?= ${WWWDIR} | #SUEXEC_DOCROOT?= ${WWWDIR} | ||||
SUEXEC_USERDIR?= public_html | SUEXEC_USERDIR?= public_html | ||||
# avoid duplicate search paths | # avoid duplicate search paths | ||||
.if ${LOCALBASE} == ${PREFIX} | .if ${LOCALBASE} == ${PREFIX} | ||||
Show All 14 Lines | CONFIGURE_ARGS+= --${SUEXEC_CONFARGS}-caller=${SUEXEC_CALLER} \ | ||||
--${SUEXEC_CONFARGS}-logfile="${SUEXEC_LOGFILE}" \ | --${SUEXEC_CONFARGS}-logfile="${SUEXEC_LOGFILE}" \ | ||||
--${SUEXEC_CONFARGS}-bin="${PREFIX}/sbin/suexec" | --${SUEXEC_CONFARGS}-bin="${PREFIX}/sbin/suexec" | ||||
. if defined(WITH_SUEXEC_UMASK) | . if defined(WITH_SUEXEC_UMASK) | ||||
CONFIGURE_ARGS+= --${SUEXEC_CONFARGS}-umask=${SUEXEC_UMASK} | CONFIGURE_ARGS+= --${SUEXEC_CONFARGS}-umask=${SUEXEC_UMASK} | ||||
. endif | . endif | ||||
.endif | .endif | ||||
.if !defined(WITHOUT_MODULES) | .if !defined(_APACHE_DISABLED_MODS) | ||||
APACHE_MODULES= ${_APACHE_MODULES} | APACHE_MODULES= ${_APACHE_ENABLED_MODS} | ||||
.else | .else | ||||
.for module in ${_APACHE_MODULES:O:u} | .for module in ${_APACHE_ENABLED_MODS:O:u} | ||||
. if !${WITHOUT_MODULES:M${module}} | . if !${_APACHE_DISABLED_MODS:M${module}} | ||||
APACHE_MODULES+= ${module} | APACHE_MODULES+= ${module} | ||||
. endif | . endif | ||||
.endfor | .endfor | ||||
.endif | .endif | ||||
.if defined(WITH_STATIC_MODULES) | .if defined(WITH_STATIC_APACHE) || defined(WITH_ALL_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) | |||||
WITH_STATIC_MODULES= ${APACHE_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 | .endif | ||||
# ==================================== | .for module in ${AVAILABLE_MODULES} | ||||
# start pkg-plist adjustments | . if !empty(WITH_STATIC_MODULES:M${module}) | ||||
.if defined(WITH_STATIC_MODULES) | CONFIGURE_ARGS+= --enable-${module:tl}=static | ||||
.for module in ${APACHE_MODULES} | PLIST_SUB+= MOD_${module}="@comment " | ||||
. if !${WITH_STATIC_MODULES:M${module}} | . elif !empty(APACHE_MODULES:M${module}) | ||||
_SHARED_MODULES+= ${module} | CONFIGURE_ARGS+= --enable-${module:tl}=shared | ||||
PLIST_SUB+= MOD_${module}="" | |||||
. else | |||||
CONFIGURE_ARGS+= --disable-${module:tl} | |||||
PLIST_SUB+= MOD_${module}="@comment " | |||||
. endif | . endif | ||||
.endfor | .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 | # pkg-plist workaround STATIC support | ||||
.if ${PORT_OPTIONS:MSUEXEC} | .if ${PORT_OPTIONS:MSUEXEC} | ||||
PLIST_SUB+= SUEXEC="" | PLIST_SUB+= SUEXEC="" | ||||
.else | .else | ||||
PLIST_SUB+= SUEXEC="@comment " | PLIST_SUB+= SUEXEC="@comment " | ||||
.endif | .endif | ||||
.if ${PORT_OPTIONS:MLOG_FORENSIC} | .if ${PORT_OPTIONS:MLOG_FORENSIC} | ||||
PLIST_SUB+= FORENSIC="" | PLIST_SUB+= FORENSIC="" | ||||
.else | .else | ||||
PLIST_SUB+= FORENSIC="@comment " | PLIST_SUB+= FORENSIC="@comment " | ||||
.endif | .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) | .else | ||||
APXS?= ${LOCALBASE}/sbin/apxs | |||||
HTTPD?= ${LOCALBASE}/sbin/httpd | HTTPD?= ${LOCALBASE}/sbin/httpd | ||||
MODULENAME?= ${PORTNAME} | MODULENAME?= ${PORTNAME} | ||||
SHORTMODNAME?= ${MODULENAME:S/mod_//} | SHORTMODNAME?= ${MODULENAME:S/mod_//} | ||||
SRC_FILE?= ${MODULENAME}.c | SRC_FILE?= ${MODULENAME}.c | ||||
.if exists(${HTTPD}) | .if exists(${HTTPD}) | ||||
_APACHE_VERSION!= ${HTTPD} -v | ${SED} -ne 's/^Server version: Apache\/\([0-9]\)\.\([0-9]*\).*/\1\2/p' | _APACHE_VERSION!= ${HTTPD} -v | ${SED} -ne 's/^Server version: Apache\/\([1-9]\.[0-9]*\).*/\1/p' | ||||
.elif defined(APACHE_PORT) | |||||
_APACHE_VERSION!= ${ECHO_CMD} ${APACHE_PORT} | ${SED} -ne 's,.*/apache\([0-9]*\).*,\1,p' | |||||
.endif | .endif | ||||
.if defined(USE_APACHE) | # Validate Apache version whether it meets the version restriction. | ||||
_USE_APACHE:= ${USE_APACHE} | _APACHE_VERSION_CHECK:= ${_APACHE_ARGS:C/^([1-9]\.[0-9])$/\1-\1/} | ||||
.elif defined(USE_APACHE_BUILD) | _APACHE_VERSION_MIN_TMP:= ${_APACHE_VERSION_CHECK:C/([1-9]\.[0-9])[-+].*/\1/} | ||||
_USE_APACHE:= ${USE_APACHE_BUILD} | _APACHE_VERSION_MIN:= ${_APACHE_VERSION_MIN_TMP:M[1-9].[0-9]} | ||||
.elif defined(USE_APACHE_RUN) | _APACHE_VERSION_MAX_TMP:= ${_APACHE_VERSION_CHECK:C/.*-([1-9]\.[0-9])/\1/} | ||||
_USE_APACHE:= ${USE_APACHE_RUN} | _APACHE_VERSION_MAX:= ${_APACHE_VERSION_MAX_TMP:M[1-9].[0-9]} | ||||
.endif | |||||
_APACHE_VERSION_CHECK:= ${_USE_APACHE:C/^([1-9][0-9])$/\1-\1/} | # Remove from _WANTED_VERSIONS that which is not wanted | ||||
_APACHE_VERSION_MINIMUM_TMP:= ${_APACHE_VERSION_CHECK:C/([1-9][0-9])[-+].*/\1/} | _APACHE_WANTED_VERSIONS= ${_APACHE_SUPPORTED_VERSIONS} | ||||
_APACHE_VERSION_MINIMUM:= ${_APACHE_VERSION_MINIMUM_TMP:M[1-9][0-9]} | .for _ver in ${_APACHE_SUPPORTED_VERSIONS:O} | ||||
_APACHE_VERSION_MAXIMUM_TMP:= ${_APACHE_VERSION_CHECK:C/.*-([1-9][0-9])/\1/} | . if !empty(_APACHE_VERSION_MIN) && ${_ver} < ${_APACHE_VERSION_MIN} | ||||
_APACHE_VERSION_MAXIMUM:= ${_APACHE_VERSION_MAXIMUM_TMP:M[1-9][0-9]} | _APACHE_WANTED_VERSIONS:= ${_APACHE_WANTED_VERSIONS:N${_ver}} | ||||
# ============================================================== | |||||
# 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} | |||||
. endif | . endif | ||||
.endfor | . if !empty(_APACHE_VERSION_MAX) && ${_ver} > ${_APACHE_VERSION_MAX} | ||||
_APACHE_WANTED_VERSIONS:= ${_APACHE_WANTED_VERSIONS:N${_ver}} | |||||
# 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} | |||||
. endif | . endif | ||||
.endfor | .endfor | ||||
# num | # Check if installed Apache version matches a wanted version | ||||
.elif ${_USE_APACHE:M[0-9][0-9]} | .if defined(_APACHE_VERSION) && $(_APACHE_WANTED_VERSIONS:M${_APACHE_VERSION}) | ||||
_APACHE_WANTED_VERSIONS= ${_USE_APACHE:M[0-9][0-9]} | _APACHE_WANTED_VERSION= ${_APACHE_VERSION} | ||||
.endif | .endif | ||||
# ============================================================== | # Select Apache version if not already set | ||||
.for _ver in ${APACHE_DEFAULT} ${_APACHE_SUPPORTED_VERSIONS} | |||||
.if !defined(_APACHE_WANTED_VERSIONS) | . if !defined(_APACHE_WANTED_VERSION) && ${_APACHE_WANTED_VERSIONS:M${_ver}} | ||||
_APACHE_WANTED_VERSIONS= ${DEFAULT_APACHE_VERSION} | _APACHE_WANTED_VERSION= ${_ver} | ||||
.endif | . endif | ||||
.for _v in ${_APACHE_WANTED_VERSIONS:O:u} | |||||
_APACHE_HIGHEST_VERSION:= ${_v} | |||||
. if defined (_APACHE_VERSION) && ${_APACHE_VERSION} == ${_v} | |||||
_APACHE_WANTED_VERSION:= ${_v} | |||||
. endif | |||||
.endfor | .endfor | ||||
.if !defined(_APACHE_WANTED_VERSION) | .if defined(_APACHE_VERSION) && ${_APACHE_VERSION} != ${APACHE_VERSION} | ||||
# next line is broken on 8.x and 9.x but working on 10 | BROKEN= ${_ERROR_MSG} Apache ${_APACHE_VERSION} is installed and port requires ${_APACHE_WANTED_VERSION} | ||||
#_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 | .endif | ||||
.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} | |||||
.endif | |||||
APACHE_VERSION:= ${_APACHE_WANTED_VERSION} | APACHE_VERSION:= ${_APACHE_WANTED_VERSION} | ||||
brnrdAuthorUnsubmitted Done Inline ActionsMust appear before the previous APACHE_VERSION check brnrd: Must appear before the previous `APACHE_VERSION` check | |||||
.if ${APACHE_VERSION} >= 2.5 | |||||
APXS?= ${LOCALBASE}/bin/apxs | |||||
.else | |||||
APXS?= ${LOCALBASE}/sbin/apxs | |||||
.endif | |||||
.if exists(${APXS}) | .if exists(${APXS}) | ||||
APXS_PREFIX!= ${APXS} -q prefix 2> /dev/null || echo NULL | APXS_PREFIX!= ${APXS} -q prefix 2> /dev/null || echo NULL | ||||
. if ${APXS_PREFIX} == NULL | . if ${APXS_PREFIX} == NULL | ||||
IGNORE= : Your apache does not support DSO modules | IGNORE= : Your apache does not support DSO modules | ||||
. endif | . endif | ||||
. if defined(AP_GENPLIST) && ${APXS_PREFIX} != ${PREFIX} | . if defined(AP_GENPLIST) && ${APXS_PREFIX} != ${PREFIX} | ||||
IGNORE?= PREFIX must be equal to APXS_PREFIX. | IGNORE?= PREFIX must be equal to APXS_PREFIX. | ||||
. endif | . endif | ||||
.endif | .endif | ||||
APACHEMODDIR= libexec/apache${APACHE_VERSION} | APACHEMODDIR= libexec/apache${APACHE_VERSION:S/.//} | ||||
APACHEINCLUDEDIR=include/apache${APACHE_VERSION} | APACHEINCLUDEDIR= include/apache${APACHE_VERSION:S/.//} | ||||
APACHEETCDIR= etc/apache${APACHE_VERSION} | APACHEETCDIR= etc/apache${APACHE_VERSION:S/.//} | ||||
APACHE_PORT?= www/apache${APACHE_VERSION} | .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}" \ | PLIST_SUB+= APACHEMODDIR="${APACHEMODDIR}" \ | ||||
APACHEINCLUDEDIR="${APACHEINCLUDEDIR}" \ | APACHEINCLUDEDIR="${APACHEINCLUDEDIR}" \ | ||||
APACHEETCDIR="${APACHEETCDIR}" \ | APACHEETCDIR="${APACHEETCDIR}" \ | ||||
APACHE_VERSION="${APACHE_VERSION}" | APACHE_VERSION="${APACHE_VERSION}" | ||||
SUB_LIST+= APACHEMODDIR="${APACHEMODDIR}" \ | SUB_LIST+= APACHEMODDIR="${APACHEMODDIR}" \ | ||||
APACHEETCDIR="${APACHEETCDIR}" \ | APACHEETCDIR="${APACHEETCDIR}" \ | ||||
APACHE_VERSION="${APACHE_VERSION}" | APACHE_VERSION="${APACHE_VERSION}" | ||||
APACHE_PKGNAMEPREFIX= ap${APACHE_VERSION}- | APACHE_PKGNAMEPREFIX= ap${APACHE_VERSION:S/.//}- | ||||
.if defined(AP_FAST_BUILD) | .if defined(AP_FAST_BUILD) | ||||
PKGNAMEPREFIX?= ${APACHE_PKGNAMEPREFIX} | PKGNAMEPREFIX?= ${APACHE_PKGNAMEPREFIX} | ||||
.endif | .endif | ||||
.if defined(USE_APACHE) || defined(USE_APACHE_BUILD) | .if defined(_APACHE_BUILD_DEP) | ||||
BUILD_DEPENDS+= ${APXS}:${APACHE_PORT} | BUILD_DEPENDS+= ${APXS}:${APACHE_PORT} | ||||
.endif | .endif | ||||
.if defined(USE_APACHE) || defined(USE_APACHE_RUN) | .if defined(_APACHE_RUN_DEP) | ||||
RUN_DEPENDS+= ${APXS}:${APACHE_PORT} | RUN_DEPENDS+= ${APXS}:${APACHE_PORT} | ||||
.endif | .endif | ||||
PLIST_SUB+= AP_NAME="${SHORTMODNAME}" | PLIST_SUB+= AP_NAME="${SHORTMODNAME}" | ||||
PLIST_SUB+= AP_MODULE="${MODULENAME}.so" | PLIST_SUB+= AP_MODULE="${MODULENAME}.so" | ||||
.if defined(AP_GENPLIST) | .if defined(AP_GENPLIST) | ||||
PLIST?= ${WRKDIR}/ap-plist | PLIST?= ${WRKDIR}/ap-plist | ||||
.endif | .endif | ||||
.if defined(AP_INC) | .if defined(AP_INC) | ||||
AP_EXTRAS+= -I ${AP_INC} | AP_EXTRAS+= -I ${AP_INC} | ||||
.endif | .endif | ||||
.if defined(AP_LIB) | .if defined(AP_LIB) | ||||
AP_EXTRAS+= -L ${AP_LIB} | AP_EXTRAS+= -L ${AP_LIB} | ||||
.endif | .endif | ||||
.endif # End of AP_PORT_IS_SERVER / AP_PORT_IS_MOULE | .endif # End of _APACHE_PORT_IS_SERVER / _APACHE_PORT_IS_MOULE | ||||
.endif # End of !Apache_Pre_Include | .endif # End of !_INCLUDE_USES_APACHE_PRE_MK | ||||
# =============================================================== | # =============================================================== | ||||
.if defined(_POSTMKINCLUDED) && !defined(Apache_Post_Include) | .if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_APACHE_POST_MK) | ||||
Apache_Post_Include= bsd.apache.mk | _INCLUDE_USES_APACHE_POST_MK= apache.mk | ||||
.if defined(NO_BUILD) && !defined(_APACHE_RUN_DEP) | |||||
.if defined(USE_APACHE_RUN) && !empty(USE_APACHE_RUN) | BROKEN= If NO_BUILD is used, then apache:run is sufficient. Please fix your Makefile | ||||
. if ${USE_APACHE_RUN:C/\-//:S/^22//:S/^24//:C/\+$//} != "" | |||||
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE_RUN ( ${USE_APACHE_RUN} ) | |||||
. endif | .endif | ||||
Done Inline ActionsThis code will never be used, you never set _USES_POST+=apache. See Mk/Uses/libtool.mk for an example of how to write a USES with b.p.post.m support. mat: This code will never be used, you never set `_USES_POST+=apache`. See `Mk/Uses/libtool.mk` for… | |||||
Not Done Inline ActionsLooking at Mk/Uses/libtool.mk makes it clearer how that works brnrd: Looking at `Mk/Uses/libtool.mk` makes it clearer how that works | |||||
.elif defined(USE_APACHE_RUN) | |||||
IGNORE= ${_ERROR_MSG} Illegal use of USE_APACHE_RUN ( no valid version specified ) | |||||
.endif | |||||
.if defined(USE_APACHE_BUILD) && !empty(USE_APACHE_BUILD) | .if defined(_APACHE_PORT_IS_SERVER) | ||||
. 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 !target(print-closest-mirrors) | .if !target(print-closest-mirrors) | ||||
print-closest-mirrors: | print-closest-mirrors: | ||||
@${ECHO_MSG} -n "Fetching list of nearest mirror: " >&2 | @${ECHO_MSG} -n "Fetching list of nearest mirror: " >&2 | ||||
@MIRRORS=`${FETCH_CMD} -T 30 -qo - http://www.apache.org/dyn/closer.cgi/httpd/ 2> /dev/null\ | @MIRRORS=`${FETCH_CMD} -T 30 -qo - http://www.apache.org/dyn/closer.cgi/httpd/ 2> /dev/null\ | ||||
| ${GREP} /httpd/ | ${SED} 's/.*href="\(.*\)"><str.*/\1/g' | \ | | ${GREP} /httpd/ | ${SED} 's/.*href="\(.*\)"><str.*/\1/g' | \ | ||||
${HEAD} -7 | ${TAIL} -6` ; \ | ${HEAD} -7 | ${TAIL} -6` ; \ | ||||
${ECHO_MSG} done >&2; if [ "x$$MIRRORS" != "x" ]; then \ | ${ECHO_MSG} done >&2; if [ "x$$MIRRORS" != "x" ]; then \ | ||||
${ECHO_MSG} -n "MASTER_SITE_APACHE_HTTPD?= ";\ | ${ECHO_MSG} -n "MASTER_SITE_APACHE_HTTPD?= ";\ | ||||
Show All 19 Lines | |||||
.endfor | .endfor | ||||
.else | .else | ||||
.for module in ${AVAILABLE_MODULES} | .for module in ${AVAILABLE_MODULES} | ||||
@${PRINTF} "%-20s : disabled\n" ${module} | @${PRINTF} "%-20s : disabled\n" ${module} | ||||
.endfor | .endfor | ||||
.endif | .endif | ||||
.endif | .endif | ||||
.elif defined(AP_PORT_IS_MODULE) | .elif defined(_APACHE_PORT_IS_MODULE) | ||||
brnrdAuthorUnsubmitted Done Inline ActionsThis must be the .else clause _APACHE_PORT_IS_MODULE is no longer used brnrd: This must be the `.else` clause `_APACHE_PORT_IS_MODULE` is no longer used | |||||
.if defined(AP_MODENABLE) | .if defined(AP_MODENABLE) | ||||
AP_MOD_EN= -a | AP_MOD_EN= -a | ||||
.else | .else | ||||
AP_MOD_EN= -A | AP_MOD_EN= -A | ||||
.endif | .endif | ||||
PLIST_SUB+= AP_MOD_EN="${AP_MOD_EN}" | PLIST_SUB+= AP_MOD_EN="${AP_MOD_EN}" | ||||
Show All 25 Lines | . if !defined(DEBUG) | ||||
@${ECHO_MSG} "===> strip ${APACHEMODDIR}/${MODULENAME}.so" | @${ECHO_MSG} "===> strip ${APACHEMODDIR}/${MODULENAME}.so" | ||||
@[ -e ${STAGEDIR}${PREFIX}/${APACHEMODDIR}/${MODULENAME}.so ] && ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}/${MODULENAME}.so | @[ -e ${STAGEDIR}${PREFIX}/${APACHEMODDIR}/${MODULENAME}.so ] && ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}/${MODULENAME}.so | ||||
. else | . else | ||||
@${ECHO_MSG} "===> DEBUG is set, will not strip ${APACHEMODDIR}/${MODULENAME}.so" | @${ECHO_MSG} "===> DEBUG is set, will not strip ${APACHEMODDIR}/${MODULENAME}.so" | ||||
. endif | . endif | ||||
.endif | .endif | ||||
.endif # defined(AP_FAST_BUILD) | .endif # defined(AP_FAST_BUILD) | ||||
.endif # defined(AP_PORT_IS_SERVER / AP_PORT_IS_MODULE) | .endif # defined(_APACHE_PORT_IS_SERVER / _APACHE_PORT_IS_MODULE) | ||||
.endif # defined(_POSTMKINCLUDED) && !defined(Apache_Post_Include) | .endif # defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_APACHE_PRE_MK) |
Left-over from testing with an additional httpd-trunk port, removed locally