| @@ -1,110 +1,106 @@ | | | @@ -1,110 +1,106 @@ |
1 | # $NetBSD: phpversion.mk,v 1.18 2012/06/16 02:47:51 taca Exp $ | | 1 | # $NetBSD: phpversion.mk,v 1.19 2012/06/16 15:18:13 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: 52 53 54 | | 13 | # Possible: 53 54 |
14 | # Default: 53 | | 14 | # Default: 53 |
15 | # | | 15 | # |
16 | # === Package-settable variables === | | 16 | # === Package-settable variables === |
17 | # | | 17 | # |
18 | # PHP_VERSIONS_ACCEPTED | | 18 | # PHP_VERSIONS_ACCEPTED |
19 | # The PHP versions that are accepted by the package. | | 19 | # The PHP versions that are accepted by the package. |
20 | # | | 20 | # |
21 | # Possible: 52 53 54 | | 21 | # Possible: 53 54 |
22 | # Default: 52 53 54 | | 22 | # Default: 53 54 |
23 | # | | 23 | # |
24 | # PHP_VERSION_REQD | | 24 | # PHP_VERSION_REQD |
25 | # If the package works only with a specific PHP version, this | | 25 | # If the package works only with a specific PHP version, this |
26 | # variable can be used to force it. | | 26 | # variable can be used to force it. |
27 | # | | 27 | # |
28 | # Possible: (undefined) 52 53 54 | | 28 | # Possible: (undefined) 53 54 |
29 | # Default: (undefined) | | 29 | # Default: (undefined) |
30 | # | | 30 | # |
31 | # === Variables defined by this file === | | 31 | # === Variables defined by this file === |
32 | # | | 32 | # |
33 | # PKG_PHP_VERSION | | 33 | # PKG_PHP_VERSION |
34 | # The selected PHP version. | | 34 | # The selected PHP version. |
35 | # | | 35 | # |
36 | # Possible: 52 53 54 | | 36 | # Possible: 53 54 |
37 | # Default: ${PHP_VERSION_DEFAULT} | | 37 | # Default: ${PHP_VERSION_DEFAULT} |
38 | # | | 38 | # |
39 | # PHP_BASE_VERS | | 39 | # PHP_BASE_VERS |
40 | # The selected PHP's full version depends on PKG_PHP_VERSION | | 40 | # The selected PHP's full version depends on PKG_PHP_VERSION |
41 | # | | 41 | # |
42 | # PKG_PHP_MAJOR_VERS | | 42 | # PKG_PHP_MAJOR_VERS |
43 | # The selected PHP's major version. | | 43 | # The selected PHP's major version. |
44 | # | | 44 | # |
45 | # Possible: 5 | | 45 | # Possible: 5 |
46 | # Default: 5 | | 46 | # Default: 5 |
47 | # | | 47 | # |
48 | # PKG_PHP | | 48 | # PKG_PHP |
49 | # The same as ${PKG_PHP_VERSION}, prefixed with "php-". | | 49 | # The same as ${PKG_PHP_VERSION}, prefixed with "php-". |
50 | # | | 50 | # |
51 | # PHPPKGSRCDIR | | 51 | # PHPPKGSRCDIR |
52 | # The directory of the PHP implementation, relative to the | | 52 | # The directory of the PHP implementation, relative to the |
53 | # package directory. | | 53 | # package directory. |
54 | # | | 54 | # |
55 | # Example: ../../lang/php5 | | 55 | # Example: ../../lang/php5 |
56 | # | | 56 | # |
57 | # PHP_PKG_PREFIX | | 57 | # PHP_PKG_PREFIX |
58 | # The prefix that is prepended to the package name. | | 58 | # The prefix that is prepended to the package name. |
59 | # | | 59 | # |
60 | # Example: php5, php53, php54 | | 60 | # Example: php53, php54 |
61 | # | | 61 | # |
62 | # Keywords: php | | 62 | # Keywords: php |
63 | # | | 63 | # |
64 | | | 64 | |
65 | .if !defined(PHPVERSION_MK) | | 65 | .if !defined(PHPVERSION_MK) |
66 | PHPVERSION_MK= defined | | 66 | PHPVERSION_MK= defined |
67 | | | 67 | |
68 | _VARGROUPS+= php | | 68 | _VARGROUPS+= php |
69 | _USER_VARS.php= PHP_VERSION_DEFAULT | | 69 | _USER_VARS.php= PHP_VERSION_DEFAULT |
70 | _PKG_VARS.php= PHP_VERSIONS_ACCEPTED PHP_VERSION_REQD | | 70 | _PKG_VARS.php= PHP_VERSIONS_ACCEPTED PHP_VERSION_REQD |
71 | _SYS_VARS.php= PKG_PHP_VERSION PKG_PHP PHPPKGSRCDIR PHP_PKG_PREFIX \ | | 71 | _SYS_VARS.php= PKG_PHP_VERSION PKG_PHP PHPPKGSRCDIR PHP_PKG_PREFIX \ |
72 | PKG_PHP_MAJOR_VERS | | 72 | PKG_PHP_MAJOR_VERS |
73 | | | 73 | |
74 | .include "../../mk/bsd.prefs.mk" | | 74 | .include "../../mk/bsd.prefs.mk" |
75 | | | 75 | |
76 | PHP52_VERSION= 5.2.17 | | | |
77 | PHP53_VERSION= 5.3.14 | | 76 | PHP53_VERSION= 5.3.14 |
78 | PHP54_VERSION= 5.4.4 | | 77 | PHP54_VERSION= 5.4.4 |
79 | | | 78 | |
80 | PHP_VERSION_DEFAULT?= 53 | | 79 | PHP_VERSION_DEFAULT?= 53 |
81 | PHP_VERSIONS_ACCEPTED?= 52 53 54 | | 80 | PHP_VERSIONS_ACCEPTED?= 53 54 |
82 | | | 81 | |
83 | # transform the list into individual variables | | 82 | # transform the list into individual variables |
84 | .for pv in ${PHP_VERSIONS_ACCEPTED} | | 83 | .for pv in ${PHP_VERSIONS_ACCEPTED} |
85 | _PHP_VERSION_${pv}_OK= yes | | 84 | _PHP_VERSION_${pv}_OK= yes |
86 | .endfor | | 85 | .endfor |
87 | | | 86 | |
88 | # check what is installed | | 87 | # check what is installed |
89 | .if exists(${LOCALBASE}/lib/php/20120301) | | 88 | .if exists(${LOCALBASE}/lib/php/20120301) |
90 | _PHP_VERSION_54_INSTALLED= yes | | 89 | _PHP_VERSION_54_INSTALLED= yes |
91 | _PHP_INSTALLED= yes | | 90 | _PHP_INSTALLED= yes |
92 | .elif exists(${LOCALBASE}/lib/php/20090626) || exists(${LOCALBASE}/include/php/Zend/zend_gc.h) | | 91 | .elif exists(${LOCALBASE}/lib/php/20090626) || exists(${LOCALBASE}/include/php/Zend/zend_gc.h) |
93 | _PHP_VERSION_53_INSTALLED= yes | | 92 | _PHP_VERSION_53_INSTALLED= yes |
94 | _PHP_INSTALLED= yes | | 93 | _PHP_INSTALLED= yes |
95 | .elif exists(${LOCALBASE}/lib/php/20040412) | | | |
96 | _PHP_VERSION_52_INSTALLED= yes | | | |
97 | _PHP_INSTALLED= yes | | | |
98 | .endif | | 94 | .endif |
99 | | | 95 | |
100 | # if a version is explicitely required, take it | | 96 | # if a version is explicitely required, take it |
101 | .if defined(PHP_VERSION_REQD) | | 97 | .if defined(PHP_VERSION_REQD) |
102 | _PHP_VERSION= ${PHP_VERSION_REQD} | | 98 | _PHP_VERSION= ${PHP_VERSION_REQD} |
103 | .endif | | 99 | .endif |
104 | # if the default is already installed, it is first choice | | 100 | # if the default is already installed, it is first choice |
105 | .if !defined(_PHP_VERSION) | | 101 | .if !defined(_PHP_VERSION) |
106 | .if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_OK) | | 102 | .if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_OK) |
107 | .if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_INSTALLED) | | 103 | .if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_INSTALLED) |
108 | _PHP_VERSION= ${PHP_VERSION_DEFAULT} | | 104 | _PHP_VERSION= ${PHP_VERSION_DEFAULT} |
109 | .endif | | 105 | .endif |
110 | .endif | | 106 | .endif |
| @@ -149,31 +145,27 @@ PKG_SKIP_REASON+= "Package accepts ${PKG | | | @@ -149,31 +145,27 @@ PKG_SKIP_REASON+= "Package accepts ${PKG |
149 | | | 145 | |
150 | MESSAGE_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \ | | 146 | MESSAGE_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \ |
151 | PKG_PHP=${PKG_PHP} | | 147 | PKG_PHP=${PKG_PHP} |
152 | PLIST_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \ | | 148 | PLIST_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \ |
153 | PKG_PHP_MAJOR_VERS=${PKG_PHP_MAJOR_VERS} \ | | 149 | PKG_PHP_MAJOR_VERS=${PKG_PHP_MAJOR_VERS} \ |
154 | PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR} | | 150 | PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR} |
155 | | | 151 | |
156 | # force the selected PHP version for recursive builds | | 152 | # force the selected PHP version for recursive builds |
157 | PHP_VERSION_REQD:= ${PKG_PHP_VERSION} | | 153 | PHP_VERSION_REQD:= ${PKG_PHP_VERSION} |
158 | | | 154 | |
159 | # | | 155 | # |
160 | # set variables for the version we decided to use: | | 156 | # set variables for the version we decided to use: |
161 | # | | 157 | # |
162 | .if ${_PHP_VERSION} == "52" | | 158 | .if ${_PHP_VERSION} == "53" |
163 | PHPPKGSRCDIR= ../../lang/php5 | | | |
164 | PHP_BASE_VERS= ${PHP52_VERSION} | | | |
165 | PHP_PKG_PREFIX= php5 | | | |
166 | .elif ${_PHP_VERSION} == "53" | | | |
167 | PHPPKGSRCDIR= ../../lang/php53 | | 159 | PHPPKGSRCDIR= ../../lang/php53 |
168 | PHP_BASE_VERS= ${PHP53_VERSION} | | 160 | PHP_BASE_VERS= ${PHP53_VERSION} |
169 | PHP_PKG_PREFIX= php53 | | 161 | PHP_PKG_PREFIX= php53 |
170 | .elif ${_PHP_VERSION} == "54" | | 162 | .elif ${_PHP_VERSION} == "54" |
171 | PHPPKGSRCDIR= ../../lang/php54 | | 163 | PHPPKGSRCDIR= ../../lang/php54 |
172 | PHP_BASE_VERS= ${PHP54_VERSION} | | 164 | PHP_BASE_VERS= ${PHP54_VERSION} |
173 | PHP_PKG_PREFIX= php54 | | 165 | PHP_PKG_PREFIX= php54 |
174 | .else | | 166 | .else |
175 | # force an error | | 167 | # force an error |
176 | PKG_SKIP_REASON+= "${PKG_PHP} is not a valid package" | | 168 | PKG_SKIP_REASON+= "${PKG_PHP} is not a valid package" |
177 | .endif | | 169 | .endif |
178 | | | 170 | |
179 | # | | 171 | # |