summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authortaca <taca>2010-03-16 15:25:36 +0000
committertaca <taca>2010-03-16 15:25:36 +0000
commitc443890557a01ea4441863f1154d1b1ebf586334 (patch)
treeb0c070949f65a440f1ef5b3dc2b68f4adadb67cd /lang
parentecd7abe0bba76afed803fc9d42477f40263865f5 (diff)
downloadpkgsrc-c443890557a01ea4441863f1154d1b1ebf586334.tar.gz
Prepair for importing PHP 5.3.2.
* Add "53" as PHP 5.3.x for several PHP_VERSION_* and its frends. * Add PKG_PHP_MAJOR_VERS which currently only takes "5". * Add "php53" to PHP_PKG_PREFIX. * Add checking installed PHP's version against required version.
Diffstat (limited to 'lang')
-rw-r--r--lang/php/phpversion.mk50
1 files changed, 38 insertions, 12 deletions
diff --git a/lang/php/phpversion.mk b/lang/php/phpversion.mk
index 6a833a764da..864d9f70d62 100644
--- a/lang/php/phpversion.mk
+++ b/lang/php/phpversion.mk
@@ -1,4 +1,4 @@
-# $NetBSD: phpversion.mk,v 1.10 2010/02/10 17:46:10 joerg Exp $
+# $NetBSD: phpversion.mk,v 1.11 2010/03/16 15:25:36 taca Exp $
#
# This file selects a PHP version, based on the user's preferences and
# the installed packages. It does not add a dependency on the PHP
@@ -10,7 +10,7 @@
# The PHP version to choose when more than one is acceptable to
# the package.
#
-# Possible: 5
+# Possible: 5 53
# Default: 5
#
# === Package-settable variables ===
@@ -18,14 +18,14 @@
# PHP_VERSIONS_ACCEPTED
# The PHP versions that are accepted by the package.
#
-# Possible: 5
+# Possible: 5 53
# Default: 5
#
# PHP_VERSION_REQD
# If the package works only with a specific PHP version, this
# variable can be used to force it.
#
-# Possible: (undefined) 5
+# Possible: (undefined) 5 53
# Default: (undefined)
#
# === Variables defined by this file ===
@@ -33,12 +33,17 @@
# PKG_PHP_VERSION
# The selected PHP version.
#
-# Possible: 5
+# Possible: 5 53
# Default: ${PHP_VERSION_DEFAULT}
#
+# PKG_PHP_MAJOR_VERS
+# The selected PHP's major version.
+#
+# Possible: 5
+# Default: 5
+#
# PKG_PHP
-# The same as ${PKG_PHP_VERSION}, prefixed with "PHP".
-# XXX: Why is this necessary?
+# The same as ${PKG_PHP_VERSION}, prefixed with "php-".
#
# PHPPKGSRCDIR
# The directory of the PHP implementation, relative to the
@@ -49,7 +54,7 @@
# PHP_PKG_PREFIX
# The prefix that is prepended to the package name.
#
-# Example: php5
+# Example: php5, php53
#
# Keywords: php
#
@@ -60,12 +65,13 @@ PHPVERSION_MK= defined
_VARGROUPS+= php
_USER_VARS.php= PHP_VERSION_DEFAULT
_PKG_VARS.php= PHP_VERSIONS_ACCEPTED PHP_VERSION_REQD
-_SYS_VARS.php= PKG_PHP_VERSION PKG_PHP PHPPKGSRCDIR PHP_PKG_PREFIX
+_SYS_VARS.php= PKG_PHP_VERSION PKG_PHP PHPPKGSRCDIR PHP_PKG_PREFIX \
+ PKG_PHP_MAJOR_VERS
.include "../../mk/bsd.prefs.mk"
PHP_VERSION_DEFAULT?= 5
-PHP_VERSIONS_ACCEPTED?= 5
+PHP_VERSIONS_ACCEPTED?= 5 53
# transform the list into individual variables
.for pv in ${PHP_VERSIONS_ACCEPTED}
@@ -75,6 +81,10 @@ _PHP_VERSION_${pv}_OK= yes
# check what is installed
.if exists(${LOCALBASE}/lib/php/20040412)
_PHP_VERSION_5_INSTALLED= yes
+_PHP_VERSION_INSTALLED= 5
+.elif exists(${LOCALBASE}/lib/php/20090630)
+_PHP_VERSION_53_INSTALLED= yes
+_PHP_VERSION_INSTALLED= 53
.endif
# if a version is explicitely required, take it
@@ -113,11 +123,15 @@ _PHP_VERSION= ${_PHP_VERSION_FIRSTACCEPTED}
# export some of internal variables
PKG_PHP_VERSION:= ${_PHP_VERSION}
-PKG_PHP:= PHP${_PHP_VERSION}
+PKG_PHP:= php-${_PHP_VERSION}
+
+# currently we have only PHP 5.x packages.
+PKG_PHP_MAJOR_VERS:= 5
MESSAGE_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \
PKG_PHP=${PKG_PHP}
-PLIST_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION}
+PLIST_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \
+ PKG_PHP_MAJOR_VERS=${PKG_PHP_MAJOR_VERS}
# force the selected PHP version for recursive builds
PHP_VERSION_REQD:= ${PKG_PHP_VERSION}
@@ -128,9 +142,21 @@ PHP_VERSION_REQD:= ${PKG_PHP_VERSION}
.if ${_PHP_VERSION} == "5"
PHPPKGSRCDIR= ../../lang/php5
PHP_PKG_PREFIX= php5
+.elif ${_PHP_VERSION} == "53"
+PHPPKGSRCDIR= ../../lang/php53
+PHP_PKG_PREFIX= php53
.else
# force an error
PKG_SKIP_REASON+= "${PKG_PHP} is not a valid package"
.endif
+#
+# check installed version aginst required:
+#
+.if defined(_PHP_VERSION_INSTALLED)
+.if ${_PHP_VERSION} != ${_PHP_VERSION_INSTALLED}
+PKG_SKIP_REASON+= "${PKGBASE} requires ${PKG_PHP}, but php-${_PHP_VERSION_INSTALLED} is installed."
+.endif
+.endif
+
.endif # PHPVERSION_MK