summaryrefslogtreecommitdiff
path: root/lang/php
diff options
context:
space:
mode:
authortaca <taca>2013-07-21 17:29:47 +0000
committertaca <taca>2013-07-21 17:29:47 +0000
commit01cd67d3eab7bf3938bc4aee763dba3b08551717 (patch)
tree8659004723fcc8e45a7c4e09ba29004214f11f24 /lang/php
parent547cca5a06c523d397064e55f1242b4d2589f816 (diff)
downloadpkgsrc-01cd67d3eab7bf3938bc4aee763dba3b08551717.tar.gz
Clean up php's framework.
* Define PHP's version at one place. * Remove obsolete description in comments. * Add "used by www/php-fpm/Makefile" in php5[34]/Makefile.php. * Remove commented out support for suhosin extension from php54. * Add PHP_CHECK_INSTALLED and PHP_EXTENSION_DIR to php/phpversion.mk. No functional should be made.
Diffstat (limited to 'lang/php')
-rw-r--r--lang/php/common.mk24
-rw-r--r--lang/php/ext.mk6
-rw-r--r--lang/php/phpversion.mk40
3 files changed, 62 insertions, 8 deletions
diff --git a/lang/php/common.mk b/lang/php/common.mk
new file mode 100644
index 00000000000..118224ea475
--- /dev/null
+++ b/lang/php/common.mk
@@ -0,0 +1,24 @@
+# $NetBSD: common.mk,v 1.1 2013/07/21 17:29:47 taca Exp $
+# used by lang/php53/Makefile.common
+# used by lang/php54/Makefile.common
+#
+.if !defined(PHPCOMMON_MK)
+PHPCOMMON_MK= defined
+
+DISTNAME?= php-${PHP_BASE_VERS}
+
+.if !defined(PECL_VERSION)
+MASTER_SITES?= http://www.php.net/distributions/ \
+ http://uk.php.net/distributions/ \
+ http://de.php.net/distributions/ \
+ http://us.php.net/distributions/
+EXTRACT_SUFX?= .tar.bz2
+.endif
+
+HOMEPAGE?= http://www.php.net/
+
+PLIST_SUBST+= PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR}
+PKG_SYSCONFVAR?= php
+
+.include "../../lang/php/phpversion.mk"
+.endif # PHPCOMMON_MK
diff --git a/lang/php/ext.mk b/lang/php/ext.mk
index d9646514f4a..523d76eb4fa 100644
--- a/lang/php/ext.mk
+++ b/lang/php/ext.mk
@@ -1,4 +1,4 @@
-# $NetBSD: ext.mk,v 1.29 2012/08/17 15:38:19 taca Exp $
+# $NetBSD: ext.mk,v 1.30 2013/07/21 17:29:47 taca Exp $
#
# PHP extension package framework, for both PECL and bundled PHP extensions.
#
@@ -21,7 +21,9 @@ HOMEPAGE?= http://pecl.php.net/package/${MODNAME}
.include "../../lang/php/phpversion.mk"
+.if defined(PHPPKGSRCDIR)
.include "${PHPPKGSRCDIR}/Makefile.common"
+.endif
PKGMODNAME?= ${MODNAME:S/-/_/}
PHPSETUPSUBDIR?= #empty
@@ -112,6 +114,8 @@ do-patch:
done || ${TRUE}
.endif
+.if defined(PHPPKGSRCDIR)
.include "${PHPPKGSRCDIR}/buildlink3.mk"
+.endif
.endif # PHPEXT_MK
diff --git a/lang/php/phpversion.mk b/lang/php/phpversion.mk
index 87c4b82febb..3bc877e2e6e 100644
--- a/lang/php/phpversion.mk
+++ b/lang/php/phpversion.mk
@@ -1,4 +1,4 @@
-# $NetBSD: phpversion.mk,v 1.36 2013/07/12 00:09:14 taca Exp $
+# $NetBSD: phpversion.mk,v 1.37 2013/07/21 17:29:47 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
@@ -30,6 +30,13 @@
# Possible: 53 54
# Default: 54 53
#
+# PHP_CHECK_INSTALLED
+# Check installed version of PHP. Should be used lang/php53,
+# and lang/php54 only.
+#
+# Possible: Yes No
+# Default: Yes
+#
# === Variables defined by this file ===
#
# PKG_PHP_VERSION
@@ -61,12 +68,28 @@
#
# Example: php53, php54
#
+# PHP_EXTENSION_DIR
+# Relative path to ${PREFIX} for PHP's extensions. It is derived from
+# initial release of major version.
+#
+# Example: lib/php/20090630
+#
# Keywords: php
#
.if !defined(PHPVERSION_MK)
PHPVERSION_MK= defined
+# Define each PHP's version.
+PHP53_VERSION= 5.3.27
+PHP54_VERSION= 5.4.17
+PHP55_VERSION= 5.5.1
+
+# Define initial release of major version.
+PHP53_RELDATE= 20090630
+PHP54_RELDATE= 20120301
+PHP55_RELDATE= 20130620
+
_VARGROUPS+= php
_USER_VARS.php= PHP_VERSION_DEFAULT
_PKG_VARS.php= PHP_VERSIONS_ACCEPTED PHP_VERSION_REQD
@@ -75,9 +98,6 @@ _SYS_VARS.php= PKG_PHP_VERSION PKG_PHP PHPPKGSRCDIR PHP_PKG_PREFIX \
.include "../../mk/bsd.prefs.mk"
-PHP53_VERSION= 5.3.27
-PHP54_VERSION= 5.4.17
-
PHP_VERSION_DEFAULT?= 54
PHP_VERSIONS_ACCEPTED?= 54 53
@@ -135,15 +155,19 @@ MULTI+= PHP_VERSION_REQD=${_PHP_VERSION}
# export some of internal variables
PKG_PHP_VERSION:= ${_PHP_VERSION:C/\.[0-9]//}
-PKG_PHP:= PHP${_PHP_VERSION:C/([0-9])([0-9])/\1.\2/}
+PKG_PHP:= php-${_PHP_VERSION:C/([0-9])([0-9])/\1.\2/}
# currently we have only PHP 5.x packages.
PKG_PHP_MAJOR_VERS:= 5
+PHP_CHECK_INSTALLED?= Yes
+
# if installed PHP isn't compatible with required PHP, bail out
+.if !empty(PHP_CHECK_INSTALLED:M[nN][oO])
.if defined(_PHP_INSTALLED) && !defined(_PHP_VERSION_${_PHP_VERSION}_INSTALLED)
PKG_SKIP_REASON+= "Package accepts ${PKG_PHP}, but different version is installed"
.endif
+.endif
MESSAGE_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \
PKG_PHP=${PKG_PHP}
@@ -161,10 +185,12 @@ PHP_VERSION_REQD:= ${PKG_PHP_VERSION}
PHPPKGSRCDIR= ../../lang/php53
PHP_BASE_VERS= ${PHP53_VERSION}
PHP_PKG_PREFIX= php53
+PHP_EXTENSION_DIR= lib/php/${PHP53_RELDATE}
.elif ${_PHP_VERSION} == "54"
PHPPKGSRCDIR= ../../lang/php54
PHP_BASE_VERS= ${PHP54_VERSION}
PHP_PKG_PREFIX= php54
+PHP_EXTENSION_DIR= lib/php/${PHP54_RELDATE}
.else
# force an error
PKG_SKIP_REASON+= "${PKG_PHP} is not a valid package"
@@ -173,8 +199,8 @@ PKG_SKIP_REASON+= "${PKG_PHP} is not a valid package"
#
# check installed version aginst required:
#
-.if defined(_PHP_VERSION_INSTALLED)
-.if ${_PHP_VERSION} != ${_PHP_VERSION_INSTALLED}
+.if !empty(PHP_CHECK_INSTALLED:M[nN][oO])
+.if defined(_PHP_VERSION_INSTALLED) && ${_PHP_VERSION} != ${_PHP_VERSION_INSTALLED}
PKG_SKIP_REASON+= "${PKGBASE} requires ${PKG_PHP}, but php-${_PHP_VERSION_INSTALLED} is already installed."
.endif
.endif