Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/apache.mk
#-*- tab-width: 4; -*- | |||||
# ex:ts=4 | |||||
# | |||||
# 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> | # Author: Bernard Spil <brnrd@FreeSBD.org> | ||||
# | # | ||||
# Please view me with 4 column tabs! | # Please view me with 4 column tabs! | ||||
# Feature: apache | # Feature: apache | ||||
# Usage: USES=apache or USES=apache:args | # Usage: USES=apache or USES=apache:args | ||||
# Valid args: <version>, build, run, server | # Valid args: <version>, build, run, server | ||||
# | # | ||||
# version If your port requires a specific Apache httpd version, you can | # 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 | # set this to [min]-[max] or min+ or -max or an explicit version | ||||
# | # | ||||
# USES=apache:2.2 # Only use Apache 2.2 | # USES=apache:2.4 # Only use Apache 2.4 | ||||
# USES=apache:2.4+ # Use Apache 2.4 or newer | # 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:-2.4 # Use Apache 2.4 or earlier | ||||
# USES=apache # Use the default apache version | # USES=apache # Use the default apache version | ||||
# | # | ||||
# Valid version numbers are specified in the variable | # Valid version numbers are specified in the variable | ||||
# APACHE_SUPPORTED_VERSIONS below | # APACHE_SUPPORTED_VERSIONS below | ||||
# | # | ||||
# build Indicates that Apache is needed at build time and adds it to | # build Indicates that Apache is needed at build time and adds it to | ||||
# BUILD_DEPENDS. | # BUILD_DEPENDS. | ||||
Show All 17 Lines | |||||
# SHORTMODNAME Short name of the Apache module | # SHORTMODNAME Short name of the Apache module | ||||
# default: ${MODULENAME:S/mod_//} | # default: ${MODULENAME:S/mod_//} | ||||
# SRC_FILE Source file of the APACHE MODULE | # SRC_FILE Source file of the APACHE MODULE | ||||
# default: ${MODULENAME}.c | # default: ${MODULENAME}.c | ||||
# | # | ||||
# Variables, for internal use by the Apache ports framework only | # Variables, for internal use by the Apache ports framework only | ||||
# The following values for USE_APACHE are reserved and only valid | # The following values for USE_APACHE are reserved and only valid | ||||
# in apache-server ports! | # in apache-server ports! | ||||
# USES= apache:server,2.2 | # USES= apache:server,2.4 | ||||
# | # | ||||
# | # | ||||
# The following variables can be read by ports and must not be modified | # The following variables can be read by ports and must not be modified | ||||
# | # | ||||
# APACHE_VERSION The major-minor release version of the chosen | # APACHE_VERSION The major-minor release version of the chosen | ||||
# Apache server, e.g. 2.2 or 2.4 | # Apache server, e.g. 2.4 | ||||
# | # | ||||
# APACHEETCDIR Location of the Apache configuration directory | # APACHEETCDIR Location of the Apache configuration directory | ||||
# Default: ${LOCALBASE}/etc/apache24 | # Default: ${LOCALBASE}/etc/apache24 | ||||
# | # | ||||
# APACHEINCLUDEDIR Location of the Apache include files | # APACHEINCLUDEDIR Location of the Apache include files | ||||
# Default: ${LOCALBASE}/include/apache24 | # Default: ${LOCALBASE}/include/apache24 | ||||
# | # | ||||
# APACHEMODDIR Location of the Apache modules | # APACHEMODDIR Location of the Apache modules | ||||
# Default: ${LOCALBASE}/libxexec/apache24 | # Default: ${LOCALBASE}/libxexec/apache24 | ||||
# | # | ||||
# APACHE_DEFAULT Default Apache version | # APACHE_DEFAULT Default Apache version | ||||
# | # | ||||
.if !defined(_INCLUDE_USES_APACHE_PRE_MK) | .if !defined(_INCLUDE_USES_APACHE_PRE_MK) | ||||
_INCLUDE_USES_APACHE_PRE_MK= yes | _INCLUDE_USES_APACHE_PRE_MK= yes | ||||
_USES_POST+= apache | _USES_POST+= apache | ||||
# 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_VERSIONS= 2.4 2.2 2.5 # preferred version first | _APACHE_SUPPORTED_VERSIONS= 2.4 # preferred version first | ||||
# Print warnings | # Print warnings | ||||
_ERROR_MSG= : Error from apache.mk. | _ERROR_MSG= : Error from apache.mk. | ||||
# Important Note: | # Important Note: | ||||
# 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(apache_ARGS) && !empty(apache_ARGS) | . if defined(apache_ARGS) && !empty(apache_ARGS) | ||||
▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | |||||
# Remove from _WANTED_VERSIONS that which is not wanted | # Remove from _WANTED_VERSIONS that which is not wanted | ||||
_APACHE_WANTED_VERSIONS= ${_APACHE_SUPPORTED_VERSIONS} | _APACHE_WANTED_VERSIONS= ${_APACHE_SUPPORTED_VERSIONS} | ||||
. for _ver in ${_APACHE_SUPPORTED_VERSIONS:O} | . for _ver in ${_APACHE_SUPPORTED_VERSIONS:O} | ||||
. if !empty(_APACHE_VERSION_MIN) && ${_ver} < ${_APACHE_VERSION_MIN} | . if !empty(_APACHE_VERSION_MIN) && ${_ver} < ${_APACHE_VERSION_MIN} | ||||
_APACHE_WANTED_VERSIONS:= ${_APACHE_WANTED_VERSIONS:N${_ver}} | _APACHE_WANTED_VERSIONS:= ${_APACHE_WANTED_VERSIONS:N${_ver}} | ||||
. endif | . endif | ||||
. if !empty(_APACHE_VERSION_MAX) && ${_ver} > ${_APACHE_VERSION_MAX} | . if !empty(_APACHE_VERSION_MAX) && ${_ver} > ${_APACHE_VERSION_MAX} | ||||
_APACHE_WANTED_VERSIONS:= ${_APACHE_WANTED_VERSIONS:N${_ver}} | _APACHE_WANTED_VERSIONS:= ${_APACHE_WANTED_VERSIONS:N${_ver}} | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
# Check if installed Apache version matches a wanted version | # Check if installed Apache version matches a wanted version | ||||
. if defined(_APACHE_VERSION) && $(_APACHE_WANTED_VERSIONS:M${_APACHE_VERSION}) | . if defined(_APACHE_VERSION) && $(_APACHE_WANTED_VERSIONS:M${_APACHE_VERSION}) | ||||
_APACHE_WANTED_VERSION= ${_APACHE_VERSION} | _APACHE_WANTED_VERSION= ${_APACHE_VERSION} | ||||
. endif | . endif | ||||
# Select Apache version if not already set | # Select Apache version if not already set | ||||
. for _ver in ${APACHE_DEFAULT} ${_APACHE_SUPPORTED_VERSIONS} | . for _ver in ${APACHE_DEFAULT} ${_APACHE_SUPPORTED_VERSIONS} | ||||
. if !defined(_APACHE_WANTED_VERSION) && ${_APACHE_WANTED_VERSIONS:M${_ver}} | . if !defined(_APACHE_WANTED_VERSION) && ${_APACHE_WANTED_VERSIONS:M${_ver}} | ||||
_APACHE_WANTED_VERSION= ${_ver} | _APACHE_WANTED_VERSION= ${_ver} | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
APACHE_VERSION:= ${_APACHE_WANTED_VERSION} | APACHE_VERSION:= ${_APACHE_WANTED_VERSION} | ||||
. if defined(_APACHE_VERSION) && ${_APACHE_VERSION} != ${APACHE_VERSION} | . if defined(_APACHE_VERSION) && ${_APACHE_VERSION} != ${APACHE_VERSION} | ||||
BROKEN= ${_ERROR_MSG} Apache ${_APACHE_VERSION} is installed and port requires ${_APACHE_WANTED_VERSION} | BROKEN= ${_ERROR_MSG} Apache ${_APACHE_VERSION} is installed and port requires ${_APACHE_WANTED_VERSION} | ||||
. endif | . endif | ||||
. if ${APACHE_VERSION} >= 2.5 | |||||
APXS?= ${LOCALBASE}/bin/apxs | |||||
. else | |||||
APXS?= ${LOCALBASE}/sbin/apxs | 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:S/.//} | APACHEMODDIR= libexec/apache${APACHE_VERSION:S/.//} | ||||
APACHEINCLUDEDIR= include/apache${APACHE_VERSION:S/.//} | APACHEINCLUDEDIR= include/apache${APACHE_VERSION:S/.//} | ||||
APACHEETCDIR= etc/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/.//} | _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}" \ | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |