Sun Mar 15 15:25:57 2015 UTC ()
Drop php53 support.


(taca)
diff -r1.37 -r1.38 pkgsrc/lang/php/ext.mk
diff -r1.89 -r1.90 pkgsrc/lang/php/phpversion.mk

cvs diff -r1.37 -r1.38 pkgsrc/lang/php/ext.mk (switch to unified diff)

--- pkgsrc/lang/php/ext.mk 2015/02/16 10:30:15 1.37
+++ pkgsrc/lang/php/ext.mk 2015/03/15 15:25:57 1.38
@@ -1,126 +1,121 @@ @@ -1,126 +1,121 @@
1# $NetBSD: ext.mk,v 1.37 2015/02/16 10:30:15 jperkin Exp $ 1# $NetBSD: ext.mk,v 1.38 2015/03/15 15:25:57 taca Exp $
2# 2#
3# PHP extension package framework, for both PECL and bundled PHP extensions. 3# PHP extension package framework, for both PECL and bundled PHP extensions.
4# 4#
5# Just include this file, define MODNAME, define PKGREVISION if necessary, 5# Just include this file, define MODNAME, define PKGREVISION if necessary,
6# add dependencies, and add the appropriate --with-configure-arg, then include 6# add dependencies, and add the appropriate --with-configure-arg, then include
7# bsd.pkg.mk. 7# bsd.pkg.mk.
8 8
9.if !defined(PHPEXT_MK) 9.if !defined(PHPEXT_MK)
10PHPEXT_MK= defined 10PHPEXT_MK= defined
11 11
12_VARGROUPS+= phpext 12_VARGROUPS+= phpext
13_USER_VARS.phpext= # none 13_USER_VARS.phpext= # none
14_PKG_VARS.phpext= MODNAME PECL_VERSION PKGMODNAME MODULESDIR \ 14_PKG_VARS.phpext= MODNAME PECL_VERSION PKGMODNAME MODULESDIR \
15 USE_PHP_EXT_PATCHES 15 USE_PHP_EXT_PATCHES
16_SYS_VARS.phpext= DISTINFO_FILE PATCHDIR 16_SYS_VARS.phpext= DISTINFO_FILE PATCHDIR
17 17
18.if defined(PECL_VERSION) 18.if defined(PECL_VERSION)
19HOMEPAGE?= http://pecl.php.net/package/${MODNAME} 19HOMEPAGE?= http://pecl.php.net/package/${MODNAME}
20.endif 20.endif
21 21
22.include "../../lang/php/phpversion.mk" 22.include "../../lang/php/phpversion.mk"
23 23
24.if defined(PHPPKGSRCDIR) 24.if defined(PHPPKGSRCDIR)
25.include "${PHPPKGSRCDIR}/Makefile.common" 25.include "${PHPPKGSRCDIR}/Makefile.common"
26.endif 26.endif
27 27
28PKGMODNAME?= ${MODNAME:S/-/_/} 28PKGMODNAME?= ${MODNAME:S/-/_/}
29PHPSETUPSUBDIR?= #empty 29PHPSETUPSUBDIR?= #empty
30MODULESDIR?= ${WRKSRC}/modules 30MODULESDIR?= ${WRKSRC}/modules
31PLIST_SUBST+= MODNAME=${PKGMODNAME} 31PLIST_SUBST+= MODNAME=${PKGMODNAME}
32 32
33.if !defined(PECL_VERSION) 33.if !defined(PECL_VERSION)
34# bundled extension 34# bundled extension
35PKGNAME?= ${PHP_PKG_PREFIX}-${MODNAME}-${PHP_BASE_VERS} 35PKGNAME?= ${PHP_PKG_PREFIX}-${MODNAME}-${PHP_BASE_VERS}
36EXTRACT_ELEMENTS?= ${DISTNAME}/ext/${PKGMODNAME} 36EXTRACT_ELEMENTS?= ${DISTNAME}/ext/${PKGMODNAME}
37WRKSRC?= ${WRKDIR}/${EXTRACT_ELEMENTS} 37WRKSRC?= ${WRKDIR}/${EXTRACT_ELEMENTS}
38DISTINFO_FILE= ${.CURDIR}/${PHPPKGSRCDIR}/distinfo 38DISTINFO_FILE= ${.CURDIR}/${PHPPKGSRCDIR}/distinfo
39.else 39.else
40# PECL extension 40# PECL extension
41# WARINING: following fixed version number for PHP 5.3.x must not be bumped! 
42.if defined(PECL_LEGACY_VERSION_SCHEME) && ${PKG_PHP_VERSION} == "53" 
43PKGNAME?= ${PHP_PKG_PREFIX}-${MODNAME}-5.3.9.${PECL_VERSION} 
44.else 
45PKGNAME?= ${PHP_PKG_PREFIX}-${MODNAME}-${PECL_VERSION} 41PKGNAME?= ${PHP_PKG_PREFIX}-${MODNAME}-${PECL_VERSION}
46.endif 
47MASTER_SITES?= http://pecl.php.net/get/ 42MASTER_SITES?= http://pecl.php.net/get/
48PECL_DISTNAME?= ${MODNAME}-${PECL_VERSION} 43PECL_DISTNAME?= ${MODNAME}-${PECL_VERSION}
49DISTNAME= ${PECL_DISTNAME} 44DISTNAME= ${PECL_DISTNAME}
50DIST_SUBDIR?= php-${MODNAME} 45DIST_SUBDIR?= php-${MODNAME}
51EXTRACT_SUFX?= .tgz 46EXTRACT_SUFX?= .tgz
52.endif 47.endif
53 48
54PHPIZE?= ${BUILDLINK_PREFIX.php}/bin/phpize 49PHPIZE?= ${BUILDLINK_PREFIX.php}/bin/phpize
55PHP_CONFIG?= ${BUILDLINK_PREFIX.php}/bin/php-config 50PHP_CONFIG?= ${BUILDLINK_PREFIX.php}/bin/php-config
56 51
57GNU_CONFIGURE= YES 52GNU_CONFIGURE= YES
58CONFIGURE_ARGS+= --with-php-config=${PHP_CONFIG} 53CONFIGURE_ARGS+= --with-php-config=${PHP_CONFIG}
59 54
60USE_CONFIG_WRAPPER= YES 55USE_CONFIG_WRAPPER= YES
61USE_LIBTOOL= YES 56USE_LIBTOOL= YES
62LIBTOOL_OVERRIDE= YES 57LIBTOOL_OVERRIDE= YES
63USE_TOOLS+= automake 58USE_TOOLS+= automake
64 59
65# Ensure we export symbols in the linked shared object. 60# Ensure we export symbols in the linked shared object.
66LDFLAGS+= ${EXPORT_SYMBOLS_LDFLAGS} 61LDFLAGS+= ${EXPORT_SYMBOLS_LDFLAGS}
67MAKE_ENV+= EXPORT_SYMBOLS_LDFLAGS="${EXPORT_SYMBOLS_LDFLAGS}" 62MAKE_ENV+= EXPORT_SYMBOLS_LDFLAGS="${EXPORT_SYMBOLS_LDFLAGS}"
68 63
69PLIST_SRC+= ${.CURDIR}/../../lang/php/PLIST.module 64PLIST_SRC+= ${.CURDIR}/../../lang/php/PLIST.module
70MESSAGE_SRC= ${.CURDIR}/../../lang/php/MESSAGE.module 65MESSAGE_SRC= ${.CURDIR}/../../lang/php/MESSAGE.module
71MESSAGE_SUBST+= MODNAME=${PKGMODNAME} 66MESSAGE_SUBST+= MODNAME=${PKGMODNAME}
72MESSAGE_SUBST+= PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR} 67MESSAGE_SUBST+= PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR}
73.if !empty(PHP_ZEND_EXTENSION:U:M[Yy][Ye][Ss]) 68.if !empty(PHP_ZEND_EXTENSION:U:M[Yy][Ye][Ss])
74MESSAGE_SUBST+= EXTENSION_DIRECTIVE=zend_extension 69MESSAGE_SUBST+= EXTENSION_DIRECTIVE=zend_extension
75.else 70.else
76MESSAGE_SUBST+= EXTENSION_DIRECTIVE=extension 71MESSAGE_SUBST+= EXTENSION_DIRECTIVE=extension
77.endif 72.endif
78 73
79# Also include extension-specific message 74# Also include extension-specific message
80.if exists(${.CURDIR}/MESSAGE) 75.if exists(${.CURDIR}/MESSAGE)
81MESSAGE_SRC+= ${.CURDIR}/MESSAGE 76MESSAGE_SRC+= ${.CURDIR}/MESSAGE
82.endif 77.endif
83 78
84.if ${OBJECT_FMT} == "SOM" 79.if ${OBJECT_FMT} == "SOM"
85SHLIB_SUFFIX= sl 80SHLIB_SUFFIX= sl
86.else 81.else
87SHLIB_SUFFIX= so 82SHLIB_SUFFIX= so
88.endif 83.endif
89 84
90pre-configure: phpize-module 85pre-configure: phpize-module
91 86
92phpize-module: 87phpize-module:
93 @cookie=${WRKDIR}/.phpize_module_done; \ 88 @cookie=${WRKDIR}/.phpize_module_done; \
94 if [ ! -f $${cookie} ]; then \ 89 if [ ! -f $${cookie} ]; then \
95 cd ${WRKSRC}/${PHPSETUPSUBDIR} && \ 90 cd ${WRKSRC}/${PHPSETUPSUBDIR} && \
96 ${SETENV} \ 91 ${SETENV} \
97 AUTOCONF=${TOOLS_DIR:Q}/bin/autoconf \ 92 AUTOCONF=${TOOLS_DIR:Q}/bin/autoconf \
98 AUTOHEADER=${TOOLS_DIR:Q}/bin/autoheader \ 93 AUTOHEADER=${TOOLS_DIR:Q}/bin/autoheader \
99 ACLOCAL=${TOOLS_DIR:Q}/bin/aclocal \ 94 ACLOCAL=${TOOLS_DIR:Q}/bin/aclocal \
100 LIBTOOLIZE=${LOCALBASE:Q}/bin/libtoolize \ 95 LIBTOOLIZE=${LOCALBASE:Q}/bin/libtoolize \
101 ${PHPIZE} && \ 96 ${PHPIZE} && \
102 ${TOUCH} ${TOUCH_FLAGS} $${cookie}; \ 97 ${TOUCH} ${TOUCH_FLAGS} $${cookie}; \
103 fi 98 fi
104 99
105do-install: do-module-install 100do-install: do-module-install
106 101
107do-module-install: 102do-module-install:
108 ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/${PHP_EXTENSION_DIR} 103 ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/${PHP_EXTENSION_DIR}
109 ${INSTALL_LIB} ${MODULESDIR}/${PKGMODNAME}.${SHLIB_SUFFIX} \ 104 ${INSTALL_LIB} ${MODULESDIR}/${PKGMODNAME}.${SHLIB_SUFFIX} \
110 ${DESTDIR}${PREFIX}/${PHP_EXTENSION_DIR} 105 ${DESTDIR}${PREFIX}/${PHP_EXTENSION_DIR}
111 106
112.if defined(USE_PHP_EXT_PATCHES) 107.if defined(USE_PHP_EXT_PATCHES)
113PATCHDIR= ${.CURDIR}/${PHPPKGSRCDIR}/patches 108PATCHDIR= ${.CURDIR}/${PHPPKGSRCDIR}/patches
114do-patch: 109do-patch:
115 ${_PKG_SILENT}${_PKG_DEBUG} \ 110 ${_PKG_SILENT}${_PKG_DEBUG} \
116 cd ${WRKSRC}; \ 111 cd ${WRKSRC}; \
117 for p in `${EGREP} -l '^\+\+\+ ext/${MODNAME}/' ${PATCHDIR}/patch-*`;do\ 112 for p in `${EGREP} -l '^\+\+\+ ext/${MODNAME}/' ${PATCHDIR}/patch-*`;do\
118 ${SED} -e 's,^+++ ext/${MODNAME}/,+++ ,' $$p | ${PATCH} ${PATCH_ARGS}; \ 113 ${SED} -e 's,^+++ ext/${MODNAME}/,+++ ,' $$p | ${PATCH} ${PATCH_ARGS}; \
119 done || ${TRUE} 114 done || ${TRUE}
120.endif 115.endif
121 116
122.if defined(PHPPKGSRCDIR) 117.if defined(PHPPKGSRCDIR)
123.include "${PHPPKGSRCDIR}/buildlink3.mk" 118.include "${PHPPKGSRCDIR}/buildlink3.mk"
124.endif 119.endif
125 120
126.endif # PHPEXT_MK 121.endif # PHPEXT_MK

cvs diff -r1.89 -r1.90 pkgsrc/lang/php/phpversion.mk (switch to unified diff)

--- pkgsrc/lang/php/phpversion.mk 2015/03/15 11:50:53 1.89
+++ pkgsrc/lang/php/phpversion.mk 2015/03/15 15:25:57 1.90
@@ -1,235 +1,224 @@ @@ -1,235 +1,224 @@
1# $NetBSD: phpversion.mk,v 1.89 2015/03/15 11:50:53 taca Exp $ 1# $NetBSD: phpversion.mk,v 1.90 2015/03/15 15:25:57 taca Exp $
2# 2#
3# This file selects a PHP version, based on the user's preferences and 3# This file selects a PHP version, based on the user's preferences and
4# the installed packages. It does not add a dependency on the PHP 4# the installed packages. It does not add a dependency on the PHP
5# package. 5# package.
6# 6#
7# === User-settable variables === 7# === User-settable variables ===
8# 8#
9# PHP_VERSION_DEFAULT 9# PHP_VERSION_DEFAULT
10# The PHP version to choose when more than one is acceptable to 10# The PHP version to choose when more than one is acceptable to
11# the package. 11# the package.
12# 12#
13# Possible: 53 54 55 56 13# Possible: 54 55 56
14# Default: 54 14# Default: 54
15# 15#
16# === Infrastructure variables === 16# === Infrastructure variables ===
17# 17#
18# PHP_VERSION_REQD 18# PHP_VERSION_REQD
19# PHP version to use. This variable should not be set in 19# PHP version to use. This variable should not be set in
20# packages. Normally it is used by bulk build tools. 20# packages. Normally it is used by bulk build tools.
21# 21#
22# Possible: ${PHP_VERSIONS_ACCEPTED} 22# Possible: ${PHP_VERSIONS_ACCEPTED}
23# Default: ${PHP_VERSION_DEFAULT} 23# Default: ${PHP_VERSION_DEFAULT}
24# 24#
25# === Package-settable variables === 25# === Package-settable variables ===
26# 26#
27# PHP_VERSIONS_ACCEPTED 27# PHP_VERSIONS_ACCEPTED
28# The PHP versions that are accepted by the package. 28# The PHP versions that are accepted by the package.
29# 29#
30# Possible: 53 54 55 56 30# Possible: 54 55 56
31# Default: 54 53 31# Default: 54
32# 32#
33# PHP_CHECK_INSTALLED 33# PHP_CHECK_INSTALLED
34# Check installed version of PHP. Should be used lang/php53, 34# Check installed version of PHP. Should be used by lang/php54,
35# lang/php54, lang/php55 and lang/php56 only. 35# lang/php55 and lang/php56 only.
36# 36#
37# Possible: Yes No 37# Possible: Yes No
38# Default: Yes 38# Default: Yes
39# 39#
40# === Variables defined by this file === 40# === Variables defined by this file ===
41# 41#
42# PKG_PHP_VERSION 42# PKG_PHP_VERSION
43# The selected PHP version. 43# The selected PHP version.
44# 44#
45# Possible: 53 54 55 56 45# Possible: 54 55 56
46# Default: ${PHP_VERSION_DEFAULT} 46# Default: ${PHP_VERSION_DEFAULT}
47# 47#
48# PHP_BASE_VERS 48# PHP_BASE_VERS
49# The selected PHP's full version depends on PKG_PHP_VERSION 49# The selected PHP's full version depends on PKG_PHP_VERSION
50# 50#
51# PKG_PHP_MAJOR_VERS 51# PKG_PHP_MAJOR_VERS
52# The selected PHP's major version. 52# The selected PHP's major version.
53# 53#
54# Possible: 5 54# Possible: 5
55# Default: 5 55# Default: 5
56# 56#
57# PKG_PHP 57# PKG_PHP
58# The same as ${PKG_PHP_VERSION}, prefixed with "php-". 58# The same as ${PKG_PHP_VERSION}, prefixed with "php-".
59# 59#
60# PHPPKGSRCDIR 60# PHPPKGSRCDIR
61# The directory of the PHP implementation, relative to the 61# The directory of the PHP implementation, relative to the
62# package directory. 62# package directory.
63# 63#
64# Example: ../../lang/php54 64# Example: ../../lang/php54
65# 65#
66# PHP_PKG_PREFIX 66# PHP_PKG_PREFIX
67# The prefix that is prepended to the package name. 67# The prefix that is prepended to the package name.
68# 68#
69# Example: php53, php54, php55 php56 69# Example: php54, php55 php56
70# 70#
71# PHP_EXTENSION_DIR 71# PHP_EXTENSION_DIR
72# Relative path to ${PREFIX} for PHP's extensions. It is derived from 72# Relative path to ${PREFIX} for PHP's extensions. It is derived from
73# initial release of major version. 73# initial release of major version.
74# 74#
75# Example: lib/php/20090630 75# Example: lib/php/20090630
76# 76#
77# Keywords: php 77# Keywords: php
78# 78#
79 79
80.if !defined(PHPVERSION_MK) 80.if !defined(PHPVERSION_MK)
81PHPVERSION_MK= defined 81PHPVERSION_MK= defined
82 82
83# Define each PHP's version. 83# Define each PHP's version.
84PHP53_VERSION= 5.3.29 
85PHP54_VERSION= 5.4.38 84PHP54_VERSION= 5.4.38
86PHP55_VERSION= 5.5.22 85PHP55_VERSION= 5.5.22
87PHP56_VERSION= 5.6.6 86PHP56_VERSION= 5.6.6
88 87
89# Define initial release of major version. 88# Define initial release of major version.
90PHP53_RELDATE= 20090630 
91PHP54_RELDATE= 20120301 89PHP54_RELDATE= 20120301
92PHP55_RELDATE= 20130620 90PHP55_RELDATE= 20130620
93PHP56_RELDATE= 20140828 91PHP56_RELDATE= 20140828
94 92
95_VARGROUPS+= php 93_VARGROUPS+= php
96_USER_VARS.php= PHP_VERSION_DEFAULT 94_USER_VARS.php= PHP_VERSION_DEFAULT
97_PKG_VARS.php= PHP_VERSIONS_ACCEPTED PHP_VERSION_REQD 95_PKG_VARS.php= PHP_VERSIONS_ACCEPTED PHP_VERSION_REQD
98_SYS_VARS.php= PKG_PHP_VERSION PKG_PHP PHPPKGSRCDIR PHP_PKG_PREFIX \ 96_SYS_VARS.php= PKG_PHP_VERSION PKG_PHP PHPPKGSRCDIR PHP_PKG_PREFIX \
99 PKG_PHP_MAJOR_VERS 97 PKG_PHP_MAJOR_VERS
100 98
101.include "../../mk/bsd.prefs.mk" 99.include "../../mk/bsd.prefs.mk"
102 100
103PHP_VERSION_DEFAULT?= 54 101PHP_VERSION_DEFAULT?= 54
104PHP_VERSIONS_ACCEPTED?= 54 55 56 53 102PHP_VERSIONS_ACCEPTED?= 54 55 56
105 103
106# transform the list into individual variables 104# transform the list into individual variables
107.for pv in ${PHP_VERSIONS_ACCEPTED} 105.for pv in ${PHP_VERSIONS_ACCEPTED}
108_PHP_VERSION_${pv}_OK= yes 106_PHP_VERSION_${pv}_OK= yes
109.endfor 107.endfor
110 108
111# check what is installed 109# check what is installed
112.if exists(${LOCALBASE}/lib/php/20140828) 110.if exists(${LOCALBASE}/lib/php/20140828)
113_PHP_VERSION_56_INSTALLED= yes 111_PHP_VERSION_56_INSTALLED= yes
114_PHP_INSTALLED= yes 112_PHP_INSTALLED= yes
115.elif exists(${LOCALBASE}/lib/php/20130620) 113.elif exists(${LOCALBASE}/lib/php/20130620)
116_PHP_VERSION_55_INSTALLED= yes 114_PHP_VERSION_55_INSTALLED= yes
117_PHP_INSTALLED= yes 115_PHP_INSTALLED= yes
118.elif exists(${LOCALBASE}/lib/php/20120301) 116.elif exists(${LOCALBASE}/lib/php/20120301)
119_PHP_VERSION_54_INSTALLED= yes 117_PHP_VERSION_54_INSTALLED= yes
120_PHP_INSTALLED= yes 118_PHP_INSTALLED= yes
121.elif exists(${LOCALBASE}/lib/php/20090626) || exists(${LOCALBASE}/include/php/Zend/zend_gc.h) 
122_PHP_VERSION_53_INSTALLED= yes 
123_PHP_INSTALLED= yes 
124.endif 119.endif
125 120
126# if a version is explicitely required, take it 121# if a version is explicitely required, take it
127.if defined(PHP_VERSION_REQD) 122.if defined(PHP_VERSION_REQD)
128_PHP_VERSION= ${PHP_VERSION_REQD} 123_PHP_VERSION= ${PHP_VERSION_REQD}
129.endif 124.endif
130# if the default is already installed, it is first choice 125# if the default is already installed, it is first choice
131.if !defined(_PHP_VERSION) 126.if !defined(_PHP_VERSION)
132.if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_OK) 127.if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_OK)
133.if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_INSTALLED) 128.if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_INSTALLED)
134_PHP_VERSION= ${PHP_VERSION_DEFAULT} 129_PHP_VERSION= ${PHP_VERSION_DEFAULT}
135.endif 130.endif
136.endif 131.endif
137.endif 132.endif
138# prefer an already installed version, in order of "accepted" 133# prefer an already installed version, in order of "accepted"
139.if !defined(_PHP_VERSION) 134.if !defined(_PHP_VERSION)
140.for pv in ${PHP_VERSIONS_ACCEPTED} 135.for pv in ${PHP_VERSIONS_ACCEPTED}
141.if defined(_PHP_VERSION_${pv}_INSTALLED) 136.if defined(_PHP_VERSION_${pv}_INSTALLED)
142_PHP_VERSION?= ${pv} 137_PHP_VERSION?= ${pv}
143.else 138.else
144# keep information as last resort - see below 139# keep information as last resort - see below
145_PHP_VERSION_FIRSTACCEPTED?= ${pv} 140_PHP_VERSION_FIRSTACCEPTED?= ${pv}
146.endif 141.endif
147.endfor 142.endfor
148.endif 143.endif
149# if the default is OK for the addon pkg, take this 144# if the default is OK for the addon pkg, take this
150.if !defined(_PHP_VERSION) 145.if !defined(_PHP_VERSION)
151.if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_OK) 146.if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_OK)
152_PHP_VERSION= ${PHP_VERSION_DEFAULT} 147_PHP_VERSION= ${PHP_VERSION_DEFAULT}
153.endif 148.endif
154.endif 149.endif
155# take the first one accepted by the package 150# take the first one accepted by the package
156.if !defined(_PHP_VERSION) 151.if !defined(_PHP_VERSION)
157_PHP_VERSION= ${_PHP_VERSION_FIRSTACCEPTED} 152_PHP_VERSION= ${_PHP_VERSION_FIRSTACCEPTED}
158.endif 153.endif
159 154
160# 155#
161# Variable assignment for multi-PHP packages 156# Variable assignment for multi-PHP packages
162MULTI+= PHP_VERSION_REQD=${_PHP_VERSION} 157MULTI+= PHP_VERSION_REQD=${_PHP_VERSION}
163 158
164# export some of internal variables 159# export some of internal variables
165PKG_PHP_VERSION:= ${_PHP_VERSION:C/\.[0-9]//} 160PKG_PHP_VERSION:= ${_PHP_VERSION:C/\.[0-9]//}
166PKG_PHP:= PHP${_PHP_VERSION:C/([0-9])([0-9])/\1.\2/} 161PKG_PHP:= PHP${_PHP_VERSION:C/([0-9])([0-9])/\1.\2/}
167 162
168# currently we have only PHP 5.x packages. 163# currently we have only PHP 5.x packages.
169PKG_PHP_MAJOR_VERS:= 5 164PKG_PHP_MAJOR_VERS:= 5
170 165
171PHP_CHECK_INSTALLED?= Yes 166PHP_CHECK_INSTALLED?= Yes
172 167
173# if installed PHP isn't compatible with required PHP, bail out 168# if installed PHP isn't compatible with required PHP, bail out
174.if empty(PHP_CHECK_INSTALLED:M[nN][oO]) 169.if empty(PHP_CHECK_INSTALLED:M[nN][oO])
175.if defined(_PHP_INSTALLED) && !defined(_PHP_VERSION_${_PHP_VERSION}_INSTALLED) 170.if defined(_PHP_INSTALLED) && !defined(_PHP_VERSION_${_PHP_VERSION}_INSTALLED)
176PKG_FAIL_REASON+= "Package accepts ${PKG_PHP}, but different version is installed" 171PKG_FAIL_REASON+= "Package accepts ${PKG_PHP}, but different version is installed"
177.endif 172.endif
178.endif 173.endif
179 174
180MESSAGE_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \ 175MESSAGE_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \
181 PKG_PHP=${PKG_PHP} 176 PKG_PHP=${PKG_PHP}
182PLIST_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \ 177PLIST_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \
183 PKG_PHP_MAJOR_VERS=${PKG_PHP_MAJOR_VERS} \ 178 PKG_PHP_MAJOR_VERS=${PKG_PHP_MAJOR_VERS} \
184 PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR} 179 PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR}
185 180
186# force the selected PHP version for recursive builds 181# force the selected PHP version for recursive builds
187PHP_VERSION_REQD:= ${PKG_PHP_VERSION} 182PHP_VERSION_REQD:= ${PKG_PHP_VERSION}
188 183
189# 184#
190# set variables for the version we decided to use: 185# set variables for the version we decided to use:
191# 186#
192.if ${_PHP_VERSION} == "53" 187.if ${_PHP_VERSION} == "54"
193PHPPKGSRCDIR= ../../lang/php53 
194PHP_VERSION= ${PHP53_VERSION} 
195PHP_INITIAL_TEENY= 2 
196PHP_PKG_PREFIX= php53 
197PHP_EXTENSION_DIR= lib/php/${PHP53_RELDATE} 
198.elif ${_PHP_VERSION} == "54" 
199PHPPKGSRCDIR= ../../lang/php54 188PHPPKGSRCDIR= ../../lang/php54
200PHP_VERSION= ${PHP54_VERSION} 189PHP_VERSION= ${PHP54_VERSION}
201PHP_INITIAL_TEENY= 4 190PHP_INITIAL_TEENY= 4
202PHP_PKG_PREFIX= php54 191PHP_PKG_PREFIX= php54
203PHP_EXTENSION_DIR= lib/php/${PHP54_RELDATE} 192PHP_EXTENSION_DIR= lib/php/${PHP54_RELDATE}
204.elif ${_PHP_VERSION} == "55" 193.elif ${_PHP_VERSION} == "55"
205PHPPKGSRCDIR= ../../lang/php55 194PHPPKGSRCDIR= ../../lang/php55
206PHP_VERSION= ${PHP55_VERSION} 195PHP_VERSION= ${PHP55_VERSION}
207PHP_INITIAL_TEENY= 1 196PHP_INITIAL_TEENY= 1
208PHP_PKG_PREFIX= php55 197PHP_PKG_PREFIX= php55
209PHP_EXTENSION_DIR= lib/php/${PHP55_RELDATE} 198PHP_EXTENSION_DIR= lib/php/${PHP55_RELDATE}
210.elif ${_PHP_VERSION} == "56" 199.elif ${_PHP_VERSION} == "56"
211PHPPKGSRCDIR= ../../lang/php56 200PHPPKGSRCDIR= ../../lang/php56
212PHP_VERSION= ${PHP56_VERSION} 201PHP_VERSION= ${PHP56_VERSION}
213PHP_INITIAL_TEENY= 3 202PHP_INITIAL_TEENY= 3
214PHP_PKG_PREFIX= php56 203PHP_PKG_PREFIX= php56
215PHP_EXTENSION_DIR= lib/php/${PHP56_RELDATE} 204PHP_EXTENSION_DIR= lib/php/${PHP56_RELDATE}
216.else 205.else
217# force an error 206# force an error
218PKG_FAIL_REASON+= "${PKG_PHP} is not a valid package" 207PKG_FAIL_REASON+= "${PKG_PHP} is not a valid package"
219.endif 208.endif
220 209
221_PHP_VER_MAJOR= ${PHP_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/} 210_PHP_VER_MAJOR= ${PHP_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/}
222_PHP_VER_MINOR= ${PHP_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/} 211_PHP_VER_MINOR= ${PHP_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/}
223 212
224PHP_BASE_VERS= ${_PHP_VER_MAJOR}.${_PHP_VER_MINOR}.${PHP_INITIAL_TEENY} 213PHP_BASE_VERS= ${_PHP_VER_MAJOR}.${_PHP_VER_MINOR}.${PHP_INITIAL_TEENY}
225 214
226# 215#
227# check installed version aginst required: 216# check installed version aginst required:
228# 217#
229.if !empty(PHP_CHECK_INSTALLED:M[nN][oO]) 218.if !empty(PHP_CHECK_INSTALLED:M[nN][oO])
230.if defined(_PHP_VERSION_INSTALLED) && ${_PHP_VERSION} != ${_PHP_VERSION_INSTALLED} 219.if defined(_PHP_VERSION_INSTALLED) && ${_PHP_VERSION} != ${_PHP_VERSION_INSTALLED}
231PKG_FAIL_REASON+= "${PKGBASE} requires ${PKG_PHP}, but php-${_PHP_VERSION_INSTALLED} is already installed." 220PKG_FAIL_REASON+= "${PKGBASE} requires ${PKG_PHP}, but php-${_PHP_VERSION_INSTALLED} is already installed."
232.endif 221.endif
233.endif 222.endif
234 223
235.endif # PHPVERSION_MK 224.endif # PHPVERSION_MK