2017-03-11 19:29:24 +01:00
|
|
|
# $NetBSD: apache.mk,v 1.30 2017/03/11 18:29:24 maya Exp $
|
2003-09-04 05:00:19 +02:00
|
|
|
#
|
2006-10-14 03:09:45 +02:00
|
|
|
# This file is meant to be included by packages that require an apache
|
|
|
|
# web server.
|
2003-09-04 05:00:19 +02:00
|
|
|
#
|
2006-10-14 03:09:45 +02:00
|
|
|
# User-settable variables:
|
2003-09-04 05:00:19 +02:00
|
|
|
#
|
2006-10-14 03:09:45 +02:00
|
|
|
# PKG_APACHE_DEFAULT
|
|
|
|
# The default apache server to use and install. If there already
|
|
|
|
# is an apache installed, this will have no effect.
|
2003-09-04 05:00:19 +02:00
|
|
|
#
|
2014-06-10 17:22:13 +02:00
|
|
|
# Possible values: apache22 apache24
|
2003-09-04 05:00:19 +02:00
|
|
|
#
|
2006-10-14 03:09:45 +02:00
|
|
|
# Package-settable variables:
|
2003-09-04 05:00:19 +02:00
|
|
|
#
|
2006-10-14 03:09:45 +02:00
|
|
|
# PKG_APACHE_ACCEPTED
|
|
|
|
# The list of apache packages that can be used as a dependency for
|
|
|
|
# the package.
|
2003-09-04 05:00:19 +02:00
|
|
|
#
|
2006-10-14 03:09:45 +02:00
|
|
|
# Possible values: (see PKG_APACHE_DEFAULT)
|
2003-09-04 05:00:19 +02:00
|
|
|
#
|
2006-10-14 03:09:45 +02:00
|
|
|
# USE_APR
|
2014-06-10 17:22:13 +02:00
|
|
|
# If this variable is set to "yes", a full dependency to the
|
|
|
|
# Apache Portable Runtime library will be added.
|
2003-09-04 05:00:19 +02:00
|
|
|
#
|
2006-10-14 03:09:45 +02:00
|
|
|
# Variables defined by this file:
|
|
|
|
#
|
|
|
|
# PKG_APACHE
|
|
|
|
# The Apache version that is actually used.
|
|
|
|
#
|
|
|
|
# Possible values: (see PKG_APACHE_DEFAULT)
|
|
|
|
#
|
|
|
|
# APACHE_PKG_PREFIX
|
|
|
|
# The package name prefix for apache modules.
|
|
|
|
#
|
2014-06-10 17:22:13 +02:00
|
|
|
# Possible values: ap22 ap24
|
2003-09-04 05:00:19 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
.if !defined(APACHE_MK)
|
2006-10-14 03:09:45 +02:00
|
|
|
APACHE_MK= # defined
|
|
|
|
|
2007-05-07 11:32:11 +02:00
|
|
|
_VARGROUPS+= apache
|
|
|
|
_USER_VARS.apache= PKG_APACHE_DEFAULT
|
|
|
|
_PKG_VARS.apache= PKG_APACHE_ACCEPTED USE_APR
|
|
|
|
_SYS_VARS.apache= PKG_APACHE APACHE_PKG_PREFIX
|
|
|
|
|
2007-10-17 12:43:36 +02:00
|
|
|
.include "bsd.fast.prefs.mk"
|
2006-10-14 03:09:45 +02:00
|
|
|
|
2017-03-11 19:29:24 +01:00
|
|
|
PKG_APACHE_DEFAULT?= apache24
|
2006-10-14 03:09:45 +02:00
|
|
|
BUILD_DEFS+= PKG_APACHE_DEFAULT
|
2006-11-09 03:05:08 +01:00
|
|
|
BUILD_DEFS_EFFECTS+= PKG_APACHE APACHE_PKG_PREFIX
|
2003-09-04 05:00:19 +02:00
|
|
|
|
2006-10-14 03:09:45 +02:00
|
|
|
# Package-settable variables
|
|
|
|
PKG_APACHE_ACCEPTED?= ${_PKG_APACHES}
|
|
|
|
USE_APR?= no
|
|
|
|
|
|
|
|
# The available apache packages:
|
2014-06-10 17:22:13 +02:00
|
|
|
_PKG_APACHES= apache22 apache24
|
2003-11-21 08:04:43 +01:00
|
|
|
|
2012-04-14 14:58:19 +02:00
|
|
|
_APACHE_PKGBASE.apache22= apache-2.[23]*
|
2007-05-09 21:56:18 +02:00
|
|
|
_APACHE_PKG_PREFIX.apache22= ap22
|
2006-12-09 00:33:15 +01:00
|
|
|
_APACHE_PKGSRCDIR.apache22= ../../www/apache22
|
|
|
|
|
2012-04-14 14:58:19 +02:00
|
|
|
_APACHE_PKGBASE.apache24= apache-2.[456789]*
|
|
|
|
_APACHE_PKG_PREFIX.apache24= ap24
|
|
|
|
_APACHE_PKGSRCDIR.apache24= ../../www/apache24
|
|
|
|
|
2003-11-25 12:42:09 +01:00
|
|
|
#
|
2006-10-14 03:09:45 +02:00
|
|
|
# Sanity checks.
|
|
|
|
#
|
|
|
|
|
|
|
|
.if empty(_PKG_APACHES:M${PKG_APACHE_DEFAULT})
|
2014-07-04 23:20:52 +02:00
|
|
|
_PKG_APACHE_MESSAGE:= "[apache.mk] Invalid apache package \""${PKG_APACHE_DEFAULT:Q}"\" in PKG_APACHE_DEFAULT."
|
|
|
|
PKG_FAIL_REASON+= ${_PKG_APACHE_MESSAGE}
|
2014-06-10 17:22:13 +02:00
|
|
|
PKG_APACHE_DEFAULT= apache22
|
2003-09-04 05:00:19 +02:00
|
|
|
.endif
|
|
|
|
|
2006-10-14 03:09:45 +02:00
|
|
|
.for _ap_ in ${PKG_APACHE_ACCEPTED}
|
|
|
|
. if empty(_PKG_APACHES:M${_ap_})
|
|
|
|
PKG_FAIL_REASON+= "[apache.mk] Invalid apache package \""${_ap_:Q}"\" in PKG_APACHE_ACCEPTED."
|
|
|
|
PKG_APACHE_ACCEPTED= # none
|
2003-10-19 09:46:50 +02:00
|
|
|
. endif
|
2006-10-14 03:09:45 +02:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
# Mark the acceptable apaches and check which apache packages are installed.
|
|
|
|
.for _ap_ in ${PKG_APACHE_ACCEPTED}
|
|
|
|
_APACHE_OK.${_ap_}= yes
|
|
|
|
_APACHE_INSTALLED.${_ap_}!= \
|
2007-05-11 10:35:52 +02:00
|
|
|
if ${PKG_INFO} -qe ${_APACHE_PKGBASE.${_ap_}:Q}; then \
|
2006-10-14 03:09:45 +02:00
|
|
|
${ECHO} yes; \
|
|
|
|
else \
|
|
|
|
${ECHO} no; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
.for ap in ${_PKG_APACHES}
|
|
|
|
_APACHE_OK.${ap}?= no
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.undef PKG_APACHE
|
|
|
|
|
|
|
|
# Use one of the installed apaches, ...
|
|
|
|
.for _ap_ in ${PKG_APACHE_ACCEPTED}
|
|
|
|
. if ${_APACHE_INSTALLED.${_ap_}} == "yes"
|
|
|
|
PKG_APACHE?= ${_ap_}
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
# ... otherwise, prefer the default one if it's accepted, ...
|
|
|
|
.if ${_APACHE_OK.${PKG_APACHE_DEFAULT}} == "yes"
|
|
|
|
PKG_APACHE?= ${PKG_APACHE_DEFAULT}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# ... otherwise, just use the first accepted apache.
|
|
|
|
.for ap in ${PKG_APACHE_ACCEPTED}
|
|
|
|
PKG_APACHE?= ${ap}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.if defined(PKG_APACHE)
|
|
|
|
. include "${_APACHE_PKGSRCDIR.${PKG_APACHE}}/buildlink3.mk"
|
|
|
|
.else
|
|
|
|
PKG_FAIL_REASON+= "[apache.mk] No acceptable apache package found."
|
|
|
|
PKG_APACHE= none
|
|
|
|
.endif
|
|
|
|
|
|
|
|
APACHE_PKG_PREFIX= ${_APACHE_PKG_PREFIX.${PKG_APACHE}}
|
|
|
|
|
2014-06-10 17:22:13 +02:00
|
|
|
.if !empty(USE_APR:M[Yy][Ee][Ss])
|
2007-01-24 20:48:44 +01:00
|
|
|
. include "../../devel/apr/buildlink3.mk"
|
|
|
|
. include "../../devel/apr-util/buildlink3.mk"
|
2003-09-04 05:00:19 +02:00
|
|
|
.endif
|
|
|
|
|
2011-03-12 15:07:13 +01:00
|
|
|
#
|
|
|
|
# Variable assignment for multi-apache packages
|
|
|
|
MULTI+= PKG_APACHE=${PKG_APACHE}
|
|
|
|
|
2003-09-04 05:00:19 +02:00
|
|
|
.endif # APACHE_MK
|