2015-02-20 02:17:49 +01:00
|
|
|
# $NetBSD: phpversion.mk,v 1.88 2015/02/20 01:17:49 taca Exp $
|
2007-06-18 09:21:09 +02:00
|
|
|
#
|
|
|
|
# This file selects a PHP version, based on the user's preferences and
|
2007-10-11 10:51:43 +02:00
|
|
|
# the installed packages. It does not add a dependency on the PHP
|
|
|
|
# package.
|
2007-06-18 09:21:09 +02:00
|
|
|
#
|
|
|
|
# === User-settable variables ===
|
|
|
|
#
|
|
|
|
# PHP_VERSION_DEFAULT
|
|
|
|
# The PHP version to choose when more than one is acceptable to
|
2012-06-16 04:47:51 +02:00
|
|
|
# the package.
|
2007-06-18 09:21:09 +02:00
|
|
|
#
|
2014-11-24 16:36:05 +01:00
|
|
|
# Possible: 53 54 55 56
|
2013-03-16 03:02:13 +01:00
|
|
|
# Default: 54
|
2007-06-18 09:21:09 +02:00
|
|
|
#
|
2012-10-04 01:48:00 +02:00
|
|
|
# === Infrastructure variables ===
|
|
|
|
#
|
2012-09-16 22:03:50 +02:00
|
|
|
# PHP_VERSION_REQD
|
2012-10-04 01:48:00 +02:00
|
|
|
# PHP version to use. This variable should not be set in
|
|
|
|
# packages. Normally it is used by bulk build tools.
|
2012-09-16 22:03:50 +02:00
|
|
|
#
|
|
|
|
# Possible: ${PHP_VERSIONS_ACCEPTED}
|
|
|
|
# Default: ${PHP_VERSION_DEFAULT}
|
|
|
|
#
|
2007-06-18 09:21:09 +02:00
|
|
|
# === Package-settable variables ===
|
|
|
|
#
|
|
|
|
# PHP_VERSIONS_ACCEPTED
|
|
|
|
# The PHP versions that are accepted by the package.
|
|
|
|
#
|
2014-11-24 16:36:05 +01:00
|
|
|
# Possible: 53 54 55 56
|
2013-03-16 03:02:13 +01:00
|
|
|
# Default: 54 53
|
2007-06-18 09:21:09 +02:00
|
|
|
#
|
2013-07-21 19:29:47 +02:00
|
|
|
# PHP_CHECK_INSTALLED
|
|
|
|
# Check installed version of PHP. Should be used lang/php53,
|
2014-11-24 16:36:05 +01:00
|
|
|
# lang/php54, lang/php55 and lang/php56 only.
|
2013-07-21 19:29:47 +02:00
|
|
|
#
|
|
|
|
# Possible: Yes No
|
|
|
|
# Default: Yes
|
|
|
|
#
|
2007-06-18 09:21:09 +02:00
|
|
|
# === Variables defined by this file ===
|
|
|
|
#
|
|
|
|
# PKG_PHP_VERSION
|
|
|
|
# The selected PHP version.
|
|
|
|
#
|
2014-11-24 16:36:05 +01:00
|
|
|
# Possible: 53 54 55 56
|
2007-06-18 09:21:09 +02:00
|
|
|
# Default: ${PHP_VERSION_DEFAULT}
|
|
|
|
#
|
2012-06-16 04:47:51 +02:00
|
|
|
# PHP_BASE_VERS
|
|
|
|
# The selected PHP's full version depends on PKG_PHP_VERSION
|
|
|
|
#
|
2010-03-16 16:25:36 +01:00
|
|
|
# PKG_PHP_MAJOR_VERS
|
|
|
|
# The selected PHP's major version.
|
|
|
|
#
|
|
|
|
# Possible: 5
|
|
|
|
# Default: 5
|
|
|
|
#
|
2007-06-18 09:21:09 +02:00
|
|
|
# PKG_PHP
|
2010-03-16 16:25:36 +01:00
|
|
|
# The same as ${PKG_PHP_VERSION}, prefixed with "php-".
|
2007-06-18 09:21:09 +02:00
|
|
|
#
|
|
|
|
# PHPPKGSRCDIR
|
|
|
|
# The directory of the PHP implementation, relative to the
|
|
|
|
# package directory.
|
|
|
|
#
|
2013-03-16 03:02:13 +01:00
|
|
|
# Example: ../../lang/php54
|
2007-06-18 09:21:09 +02:00
|
|
|
#
|
|
|
|
# PHP_PKG_PREFIX
|
|
|
|
# The prefix that is prepended to the package name.
|
|
|
|
#
|
2014-11-24 16:36:05 +01:00
|
|
|
# Example: php53, php54, php55 php56
|
2007-06-18 09:21:09 +02:00
|
|
|
#
|
2013-07-21 19:29:47 +02:00
|
|
|
# PHP_EXTENSION_DIR
|
|
|
|
# Relative path to ${PREFIX} for PHP's extensions. It is derived from
|
|
|
|
# initial release of major version.
|
|
|
|
#
|
|
|
|
# Example: lib/php/20090630
|
|
|
|
#
|
2007-06-18 09:21:09 +02:00
|
|
|
# Keywords: php
|
|
|
|
#
|
2004-10-31 20:30:29 +01:00
|
|
|
|
|
|
|
.if !defined(PHPVERSION_MK)
|
|
|
|
PHPVERSION_MK= defined
|
|
|
|
|
2013-07-21 19:29:47 +02:00
|
|
|
# Define each PHP's version.
|
Update php53 to 5.3.29, final PHP 5.3 release.
14 Aug 2014, PHP 5.3.29
- Core:
. Fixed bug #66127 (Segmentation fault with ArrayObject unset). (Stas)
. Fixed bug #67247 (spl_fixedarray_resize integer overflow). (Stas)
. Fixed bug #67249 (printf out-of-bounds read). (Stas)
. Fixed bug #67250 (iptcparse out-of-bounds read). (Stas)
. Fixed bug #67252 (convert_uudecode out-of-bounds read). (Stas)
. Fixed bug #67359 (Segfault in recursiveDirectoryIterator). (Laruence)
. Fixed bug #67390 (insecure temporary file use in the configure script).
(Remi) (CVE-2014-3981)
. Fixed bug #67399 (putenv with empty variable may lead to crash). (Stas)
. Fixed bug #67492 (unserialize() SPL ArrayObject / SPLObjectStorage Type
Confusion) (CVE-2014-3515). (Stefan Esser)
. Fixed bug #67498 (phpinfo() Type Confusion Information Leak Vulnerability).
(Stefan Esser)
- COM:
. Fixed missing type checks in com_event_sink (Yussuf Khalil, Stas).
- Date:
. Fixed bug #66060 (Heap buffer over-read in DateInterval). (CVE-2013-6712)
(Remi)
. Fixed bug #67251 (date_parse_from_format out-of-bounds read). (Stas)
. Fixed bug #67253 (timelib_meridian_with_check out-of-bounds read). (Stas)
- Exif:
. Fixed bug #65873 (Integer overflow in exif_read_data()). (Stas)
- Fileinfo:
. Fixed bug #66307 (Fileinfo crashes with powerpoint files). (Anatol)
. Fixed bug #67326 (fileinfo: cdf_read_short_sector insufficient boundary
check). (CVE-2014-0207)
. Fixed bug #67327 (fileinfo: CDF infinite loop in nelements DoS).
(CVE-2014-0238)
. Fixed bug #67328 (fileinfo: fileinfo: numerous file_printf calls resulting
in performance degradation). (CVE-2014-0237)
. Fixed bug #67410 (fileinfo: mconvert incorrect handling of truncated pascal
string size). (Francisco Alonso, Jan Kaluza, Remi)
. Fixed bug #67411 (fileinfo: cdf_check_stream_offset insufficient boundary
check). (Francisco Alonso, Jan Kaluza, Remi)
. Fixed bug #67412 (fileinfo: cdf_count_chain insufficient boundary check).
(Francisco Alonso, Jan Kaluza, Remi)
. Fixed bug #67413 (fileinfo: cdf_read_property_info insufficient boundary
check). (Francisco Alonso, Jan Kaluza, Remi)
- Intl:
. Fixed bug #67349 (Locale::parseLocale Double Free). (Stas)
. Fixed bug #67397 (Buffer overflow in locale_get_display_name and
uloc_getDisplayName (libicu 4.8.1)). (Stas)
- Network:
. Fixed bug #67432 (Fix potential segfault in dns_check_record()).
(CVE-2014-4049). (Sara)
- OpenSSL:
. Fixed missing type checks in OpenSSL options (Yussuf Khalil, Stas).
- Session:
. Fixed missing type checks in php_session_create_id (Yussuf Khalil, Stas).
2014-08-15 18:09:16 +02:00
|
|
|
PHP53_VERSION= 5.3.29
|
2015-02-19 14:14:59 +01:00
|
|
|
PHP54_VERSION= 5.4.38
|
2015-02-19 14:35:24 +01:00
|
|
|
PHP55_VERSION= 5.5.22
|
2015-02-20 02:17:49 +01:00
|
|
|
PHP56_VERSION= 5.6.6
|
2013-07-21 19:29:47 +02:00
|
|
|
|
|
|
|
# Define initial release of major version.
|
|
|
|
PHP53_RELDATE= 20090630
|
|
|
|
PHP54_RELDATE= 20120301
|
|
|
|
PHP55_RELDATE= 20130620
|
2014-11-24 16:36:05 +01:00
|
|
|
PHP56_RELDATE= 20140828
|
2013-07-21 19:29:47 +02:00
|
|
|
|
2007-09-20 11:11:07 +02:00
|
|
|
_VARGROUPS+= php
|
|
|
|
_USER_VARS.php= PHP_VERSION_DEFAULT
|
|
|
|
_PKG_VARS.php= PHP_VERSIONS_ACCEPTED PHP_VERSION_REQD
|
2010-03-16 16:25:36 +01:00
|
|
|
_SYS_VARS.php= PKG_PHP_VERSION PKG_PHP PHPPKGSRCDIR PHP_PKG_PREFIX \
|
|
|
|
PKG_PHP_MAJOR_VERS
|
2007-09-20 11:11:07 +02:00
|
|
|
|
2004-10-31 20:30:29 +01:00
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
2013-03-16 03:02:13 +01:00
|
|
|
PHP_VERSION_DEFAULT?= 54
|
2014-11-24 16:36:05 +01:00
|
|
|
PHP_VERSIONS_ACCEPTED?= 54 55 56 53
|
2004-10-31 20:30:29 +01:00
|
|
|
|
|
|
|
# transform the list into individual variables
|
|
|
|
.for pv in ${PHP_VERSIONS_ACCEPTED}
|
|
|
|
_PHP_VERSION_${pv}_OK= yes
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
# check what is installed
|
2014-11-24 16:36:05 +01:00
|
|
|
.if exists(${LOCALBASE}/lib/php/20140828)
|
|
|
|
_PHP_VERSION_56_INSTALLED= yes
|
|
|
|
_PHP_INSTALLED= yes
|
|
|
|
.elif exists(${LOCALBASE}/lib/php/20130620)
|
2013-07-29 18:38:12 +02:00
|
|
|
_PHP_VERSION_55_INSTALLED= yes
|
|
|
|
_PHP_INSTALLED= yes
|
|
|
|
.elif exists(${LOCALBASE}/lib/php/20120301)
|
2012-06-16 04:47:51 +02:00
|
|
|
_PHP_VERSION_54_INSTALLED= yes
|
|
|
|
_PHP_INSTALLED= yes
|
|
|
|
.elif exists(${LOCALBASE}/lib/php/20090626) || exists(${LOCALBASE}/include/php/Zend/zend_gc.h)
|
2010-03-16 16:25:36 +01:00
|
|
|
_PHP_VERSION_53_INSTALLED= yes
|
2012-06-16 04:47:51 +02:00
|
|
|
_PHP_INSTALLED= yes
|
2004-10-31 20:30:29 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
# if a version is explicitely required, take it
|
|
|
|
.if defined(PHP_VERSION_REQD)
|
|
|
|
_PHP_VERSION= ${PHP_VERSION_REQD}
|
|
|
|
.endif
|
|
|
|
# if the default is already installed, it is first choice
|
|
|
|
.if !defined(_PHP_VERSION)
|
|
|
|
.if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_OK)
|
|
|
|
.if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_INSTALLED)
|
|
|
|
_PHP_VERSION= ${PHP_VERSION_DEFAULT}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
# prefer an already installed version, in order of "accepted"
|
|
|
|
.if !defined(_PHP_VERSION)
|
|
|
|
.for pv in ${PHP_VERSIONS_ACCEPTED}
|
|
|
|
.if defined(_PHP_VERSION_${pv}_INSTALLED)
|
|
|
|
_PHP_VERSION?= ${pv}
|
|
|
|
.else
|
|
|
|
# keep information as last resort - see below
|
|
|
|
_PHP_VERSION_FIRSTACCEPTED?= ${pv}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
# if the default is OK for the addon pkg, take this
|
|
|
|
.if !defined(_PHP_VERSION)
|
|
|
|
.if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_OK)
|
|
|
|
_PHP_VERSION= ${PHP_VERSION_DEFAULT}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
# take the first one accepted by the package
|
|
|
|
.if !defined(_PHP_VERSION)
|
|
|
|
_PHP_VERSION= ${_PHP_VERSION_FIRSTACCEPTED}
|
|
|
|
.endif
|
|
|
|
|
2011-03-12 15:07:13 +01:00
|
|
|
#
|
|
|
|
# Variable assignment for multi-PHP packages
|
|
|
|
MULTI+= PHP_VERSION_REQD=${_PHP_VERSION}
|
|
|
|
|
2004-11-04 19:40:39 +01:00
|
|
|
# export some of internal variables
|
2010-03-21 12:07:37 +01:00
|
|
|
PKG_PHP_VERSION:= ${_PHP_VERSION:C/\.[0-9]//}
|
2013-07-29 18:38:12 +02:00
|
|
|
PKG_PHP:= PHP${_PHP_VERSION:C/([0-9])([0-9])/\1.\2/}
|
2010-03-16 16:25:36 +01:00
|
|
|
|
|
|
|
# currently we have only PHP 5.x packages.
|
|
|
|
PKG_PHP_MAJOR_VERS:= 5
|
2004-11-04 19:40:39 +01:00
|
|
|
|
2013-07-21 19:29:47 +02:00
|
|
|
PHP_CHECK_INSTALLED?= Yes
|
|
|
|
|
2010-03-21 12:07:37 +01:00
|
|
|
# if installed PHP isn't compatible with required PHP, bail out
|
2013-08-14 16:53:03 +02:00
|
|
|
.if empty(PHP_CHECK_INSTALLED:M[nN][oO])
|
2010-03-21 12:07:37 +01:00
|
|
|
.if defined(_PHP_INSTALLED) && !defined(_PHP_VERSION_${_PHP_VERSION}_INSTALLED)
|
2015-01-01 12:51:41 +01:00
|
|
|
PKG_FAIL_REASON+= "Package accepts ${PKG_PHP}, but different version is installed"
|
2010-03-21 12:07:37 +01:00
|
|
|
.endif
|
2013-07-21 19:29:47 +02:00
|
|
|
.endif
|
2010-03-21 12:07:37 +01:00
|
|
|
|
2004-11-04 19:40:39 +01:00
|
|
|
MESSAGE_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \
|
|
|
|
PKG_PHP=${PKG_PHP}
|
2010-03-16 16:25:36 +01:00
|
|
|
PLIST_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \
|
2012-06-16 04:47:51 +02:00
|
|
|
PKG_PHP_MAJOR_VERS=${PKG_PHP_MAJOR_VERS} \
|
|
|
|
PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR}
|
2004-11-04 19:40:39 +01:00
|
|
|
|
2005-05-09 21:24:46 +02:00
|
|
|
# force the selected PHP version for recursive builds
|
|
|
|
PHP_VERSION_REQD:= ${PKG_PHP_VERSION}
|
|
|
|
|
2004-10-31 20:30:29 +01:00
|
|
|
#
|
|
|
|
# set variables for the version we decided to use:
|
|
|
|
#
|
2012-06-16 17:18:13 +02:00
|
|
|
.if ${_PHP_VERSION} == "53"
|
2010-03-16 16:25:36 +01:00
|
|
|
PHPPKGSRCDIR= ../../lang/php53
|
2012-06-16 04:47:51 +02:00
|
|
|
PHP_BASE_VERS= ${PHP53_VERSION}
|
2010-03-16 16:25:36 +01:00
|
|
|
PHP_PKG_PREFIX= php53
|
2013-07-21 19:29:47 +02:00
|
|
|
PHP_EXTENSION_DIR= lib/php/${PHP53_RELDATE}
|
2012-06-16 04:47:51 +02:00
|
|
|
.elif ${_PHP_VERSION} == "54"
|
|
|
|
PHPPKGSRCDIR= ../../lang/php54
|
|
|
|
PHP_BASE_VERS= ${PHP54_VERSION}
|
|
|
|
PHP_PKG_PREFIX= php54
|
2013-07-21 19:29:47 +02:00
|
|
|
PHP_EXTENSION_DIR= lib/php/${PHP54_RELDATE}
|
2013-07-29 18:38:12 +02:00
|
|
|
.elif ${_PHP_VERSION} == "55"
|
|
|
|
PHPPKGSRCDIR= ../../lang/php55
|
|
|
|
PHP_BASE_VERS= ${PHP55_VERSION}
|
|
|
|
PHP_PKG_PREFIX= php55
|
|
|
|
PHP_EXTENSION_DIR= lib/php/${PHP55_RELDATE}
|
2014-11-24 16:36:05 +01:00
|
|
|
.elif ${_PHP_VERSION} == "56"
|
|
|
|
PHPPKGSRCDIR= ../../lang/php56
|
|
|
|
PHP_BASE_VERS= ${PHP56_VERSION}
|
|
|
|
PHP_PKG_PREFIX= php56
|
|
|
|
PHP_EXTENSION_DIR= lib/php/${PHP56_RELDATE}
|
2004-10-31 20:30:29 +01:00
|
|
|
.else
|
|
|
|
# force an error
|
2015-01-01 12:51:41 +01:00
|
|
|
PKG_FAIL_REASON+= "${PKG_PHP} is not a valid package"
|
2004-10-31 20:30:29 +01:00
|
|
|
.endif
|
|
|
|
|
2010-03-16 16:25:36 +01:00
|
|
|
#
|
|
|
|
# check installed version aginst required:
|
|
|
|
#
|
2013-07-21 19:29:47 +02:00
|
|
|
.if !empty(PHP_CHECK_INSTALLED:M[nN][oO])
|
|
|
|
.if defined(_PHP_VERSION_INSTALLED) && ${_PHP_VERSION} != ${_PHP_VERSION_INSTALLED}
|
2015-01-01 12:51:41 +01:00
|
|
|
PKG_FAIL_REASON+= "${PKGBASE} requires ${PKG_PHP}, but php-${_PHP_VERSION_INSTALLED} is already installed."
|
2010-03-16 16:25:36 +01:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2004-10-31 20:30:29 +01:00
|
|
|
.endif # PHPVERSION_MK
|