Lines 4-10
Link Here
|
4 |
# |
4 |
# |
5 |
# Feature: php |
5 |
# Feature: php |
6 |
# Usage: USES=php |
6 |
# Usage: USES=php |
7 |
# Valid ARGS: (none) |
7 |
# Valid ARGS: (none), phpize, ext, zend, build, cli, cgi, mod, web, embed |
|
|
8 |
# |
9 |
# - phpize : Use to build a PHP extension. |
10 |
# - ext : Use to build, install and register a PHP extension. |
11 |
# - zend : Use to build, install and register a Zend extension. |
12 |
# - build : Set PHP also as a build dependency. |
13 |
# - cli : Want the CLI version of PHP. |
14 |
# - cgi : Want the CGI version of PHP. |
15 |
# - mod : Want the Apache Module for PHP. |
16 |
# - web : Want the Apache Module or the CGI version of PHP. |
17 |
# - embed : Want the embedded library version of PHP. |
8 |
# |
18 |
# |
9 |
# If the port requires a predefined set of PHP extensions, they can be |
19 |
# If the port requires a predefined set of PHP extensions, they can be |
10 |
# listed in this way: |
20 |
# listed in this way: |
Lines 15-29
Link Here
|
15 |
# |
25 |
# |
16 |
# DEFAULT_PHP_VER=N - Use PHP version N if PHP is not yet installed. |
26 |
# DEFAULT_PHP_VER=N - Use PHP version N if PHP is not yet installed. |
17 |
# IGNORE_WITH_PHP=N - The port doesn't work with PHP version N. |
27 |
# IGNORE_WITH_PHP=N - The port doesn't work with PHP version N. |
18 |
# USE_PHPIZE=yes - Use to build a PHP extension. |
|
|
19 |
# USE_PHPEXT=yes - Use to build, install and register a PHP extension. |
20 |
# USE_ZENDEXT=yes - Use to build, install and register a Zend extension. |
21 |
# USE_PHP_BUILD=yes - Set PHP also as a build dependency. |
22 |
# WANT_PHP_CLI=yes - Want the CLI version of PHP. |
23 |
# WANT_PHP_CGI=yes - Want the CGI version of PHP. |
24 |
# WANT_PHP_MOD=yes - Want the Apache Module for PHP. |
25 |
# WANT_PHP_WEB=yes - Want the Apache Module or the CGI version of PHP. |
26 |
# WANT_PHP_EMB=yes - Want the embedded library version of PHP. |
27 |
# |
28 |
# |
28 |
# You may combine multiple WANT_PHP_* knobs. |
29 |
# You may combine multiple WANT_PHP_* knobs. |
29 |
# Don't specify any WANT_PHP_* knob if your port will work with every PHP SAPI. |
30 |
# Don't specify any WANT_PHP_* knob if your port will work with every PHP SAPI. |
Lines 43-48
_INCLUDE_USES_PHP_MK= yes
Link Here
|
43 |
WARNING+= "DEFAULT_PHP_VER is defined, consider using DEFAULT_VERSIONS=php=${DEFAULT_PHP_VER} instead" |
44 |
WARNING+= "DEFAULT_PHP_VER is defined, consider using DEFAULT_VERSIONS=php=${DEFAULT_PHP_VER} instead" |
44 |
. endif |
45 |
. endif |
45 |
|
46 |
|
|
|
47 |
. if defined(USE_PHPIZE) && empty(php_ARGS:Mphpize) |
48 |
php_ARGS+= phpize |
49 |
. endif |
50 |
. if defined(USE_PHPEXT) && empty(php_ARGS:Mext) |
51 |
php_ARGS+= ext |
52 |
. endif |
53 |
. if defined(USE_ZENDEXT) && empty(php_ARGS:Mzend) |
54 |
php_ARGS+= zend |
55 |
. endif |
56 |
. if defined(USE_PHP_BUILD) && empty(php_ARGS:Mbuild) |
57 |
php_ARGS+= build |
58 |
. endif |
59 |
. if defined(WANT_PHP_CLI) && empty(php_ARGS:Mcli) |
60 |
php_ARGS+= cli |
61 |
. endif |
62 |
. if defined(WANT_PHP_CGI) && empty(php_ARGS:Mcgi) |
63 |
php_ARGS+= cgi |
64 |
. endif |
65 |
. if defined(WANT_PHP_MOD) && empty(php_ARGS:Mmod) |
66 |
php_ARGS+= mod |
67 |
. endif |
68 |
. if defined(WANT_PHP_WEB) && empty(php_ARGS:Mweb) |
69 |
php_ARGS+= web |
70 |
. endif |
71 |
. if defined(WANT_PHP_EMB) && empty(php_ARGS:Membed) |
72 |
php_ARGS+= embed |
73 |
. endif |
74 |
|
75 |
. if ${php_ARGS:Mbuild} && ( ${php_ARGS:Mphpize} || ${php_ARGS:Mext} || ${php_ARGS:Mzend} ) |
76 |
DEV_WARNING+= "USES=php:build is included in USES=php:phpize, USES=php:ext, and USES=php:zend, so it is not needed" |
77 |
. endif |
78 |
. if ${php_ARGS:Mphpize} && ( ${php_ARGS:Mext} || ${php_ARGS:Mzend} ) |
79 |
DEV_WARNING+= "USES=php:phpize is included in USES=php:ext and USES=php:zend, so it is not needed" |
80 |
. endif |
81 |
. if ${php_ARGS:Mext} && ${php_ARGS:Mzend} |
82 |
DEV_WARNING+= "USES=php:ext is included in USES=php:zend, so it is not needed" |
83 |
. endif |
84 |
|
46 |
PHPBASE?= ${LOCALBASE} |
85 |
PHPBASE?= ${LOCALBASE} |
47 |
. if exists(${PHPBASE}/etc/php.conf) |
86 |
. if exists(${PHPBASE}/etc/php.conf) |
48 |
.include "${PHPBASE}/etc/php.conf" |
87 |
.include "${PHPBASE}/etc/php.conf" |
Lines 98-113
IGNORE= cannot be installed: doesn't work with lang/php${PHP_VER} port\
Link Here
|
98 |
. endfor |
137 |
. endfor |
99 |
. endif |
138 |
. endif |
100 |
|
139 |
|
101 |
. if defined(WANT_PHP_WEB) |
140 |
. if ${php_ARGS:Mweb} |
102 |
. if defined(WANT_PHP_CGI) || defined(WANT_PHP_MOD) |
141 |
. if ${php_ARGS:Mcgi} || ${php_ARGS:Mmod} |
103 |
check-makevars:: |
142 |
check-makevars:: |
104 |
@${ECHO_CMD} "If you define WANT_PHP_WEB you cannot set also WANT_PHP_CGI" |
143 |
@${ECHO_CMD} "If you use :web you cannot also use :cgi" |
105 |
@${ECHO_CMD} "or WANT_PHP_MOD. Use only one of them." |
144 |
@${ECHO_CMD} "or :mod. Use only one of them." |
106 |
@${FALSE} |
145 |
@${FALSE} |
107 |
. endif |
146 |
. endif |
108 |
. endif |
147 |
. endif |
109 |
|
148 |
|
110 |
. if defined(WANT_PHP_CGI) |
149 |
. if ${php_ARGS:Mcgi} |
111 |
. if defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "" |
150 |
. if defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "" |
112 |
check-makevars:: |
151 |
check-makevars:: |
113 |
@${ECHO_CMD} "This port requires the CGI version of PHP, but you have already" |
152 |
@${ECHO_CMD} "This port requires the CGI version of PHP, but you have already" |
Lines 116-122
check-makevars::
Link Here
|
116 |
. endif |
155 |
. endif |
117 |
. endif |
156 |
. endif |
118 |
|
157 |
|
119 |
. if defined(WANT_PHP_CLI) |
158 |
. if ${php_ARGS:Mcli} |
120 |
. if defined(PHP_VERSION) && ${PHP_SAPI:Mcli} == "" |
159 |
. if defined(PHP_VERSION) && ${PHP_SAPI:Mcli} == "" |
121 |
check-makevars:: |
160 |
check-makevars:: |
122 |
@${ECHO_CMD} "This port requires the CLI version of PHP, but you have already" |
161 |
@${ECHO_CMD} "This port requires the CLI version of PHP, but you have already" |
Lines 125-131
check-makevars::
Link Here
|
125 |
. endif |
164 |
. endif |
126 |
. endif |
165 |
. endif |
127 |
|
166 |
|
128 |
. if defined(WANT_PHP_EMB) |
167 |
. if ${php_ARGS:Membed} |
129 |
. if defined(PHP_VERSION) && ${PHP_SAPI:Membed} == "" |
168 |
. if defined(PHP_VERSION) && ${PHP_SAPI:Membed} == "" |
130 |
check-makevars:: |
169 |
check-makevars:: |
131 |
@${ECHO_CMD} "This port requires the embedded library version of PHP, but you have already" |
170 |
@${ECHO_CMD} "This port requires the embedded library version of PHP, but you have already" |
Lines 137-147
check-makevars::
Link Here
|
137 |
PHP_PORT?= lang/php${PHP_VER} |
176 |
PHP_PORT?= lang/php${PHP_VER} |
138 |
MOD_PHP_PORT?= www/mod_php${PHP_VER} |
177 |
MOD_PHP_PORT?= www/mod_php${PHP_VER} |
139 |
|
178 |
|
140 |
. if defined(USE_PHP_BUILD) |
179 |
. if ${php_ARGS:Mbuild} |
141 |
BUILD_DEPENDS+= ${PHPBASE}/include/php/main/php.h:${PHP_PORT} |
180 |
BUILD_DEPENDS+= ${PHPBASE}/include/php/main/php.h:${PHP_PORT} |
142 |
. endif |
181 |
. endif |
143 |
RUN_DEPENDS+= ${PHPBASE}/include/php/main/php.h:${PHP_PORT} |
182 |
RUN_DEPENDS+= ${PHPBASE}/include/php/main/php.h:${PHP_PORT} |
144 |
. if defined(WANT_PHP_MOD) || (defined(WANT_PHP_WEB) && defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "") |
183 |
. if ${php_ARGS:Mmod} || (${php_ARGS:Mweb} && defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "") |
145 |
USE_APACHE_RUN= 22+ |
184 |
USE_APACHE_RUN= 22+ |
146 |
.include "${PORTSDIR}/Mk/bsd.apache.mk" |
185 |
.include "${PORTSDIR}/Mk/bsd.apache.mk" |
147 |
RUN_DEPENDS+= ${PHPBASE}/${APACHEMODDIR}/libphp5.so:${MOD_PHP_PORT} |
186 |
RUN_DEPENDS+= ${PHPBASE}/${APACHEMODDIR}/libphp5.so:${MOD_PHP_PORT} |
Lines 150-156
RUN_DEPENDS+= ${PHPBASE}/${APACHEMODDIR}/libphp5.so:${MOD_PHP_PORT}
Link Here
|
150 |
PLIST_SUB+= PHP_EXT_DIR=${PHP_EXT_DIR} |
189 |
PLIST_SUB+= PHP_EXT_DIR=${PHP_EXT_DIR} |
151 |
SUB_LIST+= PHP_EXT_DIR=${PHP_EXT_DIR} |
190 |
SUB_LIST+= PHP_EXT_DIR=${PHP_EXT_DIR} |
152 |
|
191 |
|
153 |
. if defined(USE_PHPIZE) || defined(USE_PHPEXT) || defined(USE_ZENDEXT) |
192 |
. if ${php_ARGS:Mphpize} || ${php_ARGS:Mext} || ${php_ARGS:Mzend} |
154 |
BUILD_DEPENDS+= ${PHPBASE}/bin/phpize:${PHP_PORT} |
193 |
BUILD_DEPENDS+= ${PHPBASE}/bin/phpize:${PHP_PORT} |
155 |
GNU_CONFIGURE= yes |
194 |
GNU_CONFIGURE= yes |
156 |
USE_AUTOTOOLS+= autoconf:env |
195 |
USE_AUTOTOOLS+= autoconf:env |
Lines 172-178
_USES_POST+=php
Link Here
|
172 |
|
211 |
|
173 |
_INCLUDE_USES_PHP_POST_MK=yes |
212 |
_INCLUDE_USES_PHP_POST_MK=yes |
174 |
|
213 |
|
175 |
. if (defined(USE_PHPEXT) || defined(USE_ZENDEXT)) |
214 |
. if ${php_ARGS:Mext} || ${php_ARGS:Mzend} |
176 |
PHP_MODNAME?= ${PORTNAME} |
215 |
PHP_MODNAME?= ${PORTNAME} |
177 |
PHP_HEADER_DIRS?= "" |
216 |
PHP_HEADER_DIRS?= "" |
178 |
|
217 |
|
Lines 206-212
add-plist-phpext:
Link Here
|
206 |
>> ${TMPPLIST} |
245 |
>> ${TMPPLIST} |
207 |
@${ECHO_CMD} "@dir etc/php" \ |
246 |
@${ECHO_CMD} "@dir etc/php" \ |
208 |
>> ${TMPPLIST} |
247 |
>> ${TMPPLIST} |
209 |
. if defined(USE_ZENDEXT) |
248 |
. if ${php_ARGS:Mzend} |
210 |
@${ECHO_CMD} "@exec echo zend_extension=%D/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}.so >> %D/etc/php/extensions.ini" \ |
249 |
@${ECHO_CMD} "@exec echo zend_extension=%D/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}.so >> %D/etc/php/extensions.ini" \ |
211 |
>> ${TMPPLIST} |
250 |
>> ${TMPPLIST} |
212 |
. else |
251 |
. else |
Lines 215-221
add-plist-phpext:
Link Here
|
215 |
. endif |
254 |
. endif |
216 |
@${ECHO_CMD} "@unexec cp %D/etc/php/extensions.ini %D/etc/php/extensions.ini.orig" \ |
255 |
@${ECHO_CMD} "@unexec cp %D/etc/php/extensions.ini %D/etc/php/extensions.ini.orig" \ |
217 |
>> ${TMPPLIST} |
256 |
>> ${TMPPLIST} |
218 |
. if defined(USE_ZENDEXT) |
257 |
. if ${php_ARGS:Mzend} |
219 |
@${ECHO_CMD} "@unexec grep -v zend_extension=%D/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}\\\.so %D/etc/php/extensions.ini.orig > %D/etc/php/extensions.ini || true" \ |
258 |
@${ECHO_CMD} "@unexec grep -v zend_extension=%D/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}\\\.so %D/etc/php/extensions.ini.orig > %D/etc/php/extensions.ini || true" \ |
220 |
>> ${TMPPLIST} |
259 |
>> ${TMPPLIST} |
221 |
. else |
260 |
. else |
Lines 235-241
php-ini:
Link Here
|
235 |
@${ECHO_CMD} "The following line has been added to your ${PREFIX}/etc/php/extensions.ini" |
274 |
@${ECHO_CMD} "The following line has been added to your ${PREFIX}/etc/php/extensions.ini" |
236 |
@${ECHO_CMD} "configuration file to automatically load the installed extension:" |
275 |
@${ECHO_CMD} "configuration file to automatically load the installed extension:" |
237 |
@${ECHO_CMD} "" |
276 |
@${ECHO_CMD} "" |
238 |
. if defined(USE_ZENDEXT) |
277 |
. if ${php_ARGS:Mzend} |
239 |
@${ECHO_CMD} "zend_extension=${PREFIX}/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}.so" |
278 |
@${ECHO_CMD} "zend_extension=${PREFIX}/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}.so" |
240 |
. else |
279 |
. else |
241 |
@${ECHO_CMD} "extension=${PHP_MODNAME}.so" |
280 |
@${ECHO_CMD} "extension=${PHP_MODNAME}.so" |
Lines 245-251
php-ini:
Link Here
|
245 |
. endif |
284 |
. endif |
246 |
|
285 |
|
247 |
# Extensions |
286 |
# Extensions |
248 |
. if ${USE_PHP:tl} != "yes" |
287 |
. if defined(USE_PHP) && ${USE_PHP:tl} != "yes" |
249 |
# non-version specific components |
288 |
# non-version specific components |
250 |
_USE_PHP_ALL= apc bcmath bitset bz2 calendar ctype curl dba dom \ |
289 |
_USE_PHP_ALL= apc bcmath bitset bz2 calendar ctype curl dba dom \ |
251 |
exif fileinfo filter ftp gd gettext gmp \ |
290 |
exif fileinfo filter ftp gd gettext gmp \ |
Lines 297-303
ldap_DEPENDS= net/php${PHP_VER}-ldap
Link Here
|
297 |
mbstring_DEPENDS= converters/php${PHP_VER}-mbstring |
336 |
mbstring_DEPENDS= converters/php${PHP_VER}-mbstring |
298 |
mcrypt_DEPENDS= security/php${PHP_VER}-mcrypt |
337 |
mcrypt_DEPENDS= security/php${PHP_VER}-mcrypt |
299 |
memcache_DEPENDS= databases/pecl-memcache |
338 |
memcache_DEPENDS= databases/pecl-memcache |
300 |
mhash_DEPENDS= security/php${PHP_VER}-mhash |
|
|
301 |
mssql_DEPENDS= databases/php${PHP_VER}-mssql |
339 |
mssql_DEPENDS= databases/php${PHP_VER}-mssql |
302 |
mysql_DEPENDS= databases/php${PHP_VER}-mysql |
340 |
mysql_DEPENDS= databases/php${PHP_VER}-mysql |
303 |
mysqli_DEPENDS= databases/php${PHP_VER}-mysqli |
341 |
mysqli_DEPENDS= databases/php${PHP_VER}-mysqli |
Lines 347-369
zip_DEPENDS= archivers/php${PHP_VER}-zip
Link Here
|
347 |
zlib_DEPENDS= archivers/php${PHP_VER}-zlib |
385 |
zlib_DEPENDS= archivers/php${PHP_VER}-zlib |
348 |
|
386 |
|
349 |
. for extension in ${USE_PHP} |
387 |
. for extension in ${USE_PHP} |
350 |
. if ${_USE_PHP_VER${PHP_VER}:M${extension}} != "" |
|
|
351 |
. if ${PHP_EXT_INC:M${extension}} == "" |
352 |
. if defined(USE_PHP_BUILD) |
353 |
BUILD_DEPENDS+= ${PHPBASE}/lib/php/${PHP_EXT_DIR}/${extension}.so:${${extension}_DEPENDS} |
354 |
. endif |
355 |
RUN_DEPENDS+= ${PHPBASE}/lib/php/${PHP_EXT_DIR}/${extension}.so:${${extension}_DEPENDS} |
356 |
. endif |
357 |
. else |
358 |
ext= ${extension} |
388 |
ext= ${extension} |
359 |
. if ${ext} == "mhash" |
389 |
. if ${_USE_PHP_VER${PHP_VER}:M${ext:S/:build//}} != "" |
360 |
. if defined(USE_PHP_BUILD) |
390 |
. if ${PHP_EXT_INC:M${extension:S/:build//}} == "" |
361 |
BUILD_DEPENDS+= ${PHPBASE}/lib/php/${PHP_EXT_DIR}/hash.so:${hash_DEPENDS} |
391 |
. if !empty(php_ARGS:Mbuild) || !empty(ext:M*\:build) |
|
|
392 |
BUILD_DEPENDS+= ${PHPBASE}/lib/php/${PHP_EXT_DIR}/${extension:S/:build//}.so:${${extension:S/:build//}_DEPENDS} |
362 |
. endif |
393 |
. endif |
363 |
RUN_DEPENDS+= ${PHPBASE}/lib/php/${PHP_EXT_DIR}/hash.so:${hash_DEPENDS} |
394 |
RUN_DEPENDS+= ${PHPBASE}/lib/php/${PHP_EXT_DIR}/${extension:S/:build//}.so:${${extension:S/:build//}_DEPENDS} |
364 |
. elif ${ext:tl} != "yes" |
395 |
. endif |
|
|
396 |
. else |
397 |
. if ${ext:tl} != "yes" |
365 |
check-makevars:: |
398 |
check-makevars:: |
366 |
@${ECHO_CMD} "Unknown extension ${extension} for PHP ${PHP_VER}." |
399 |
@${ECHO_CMD} "Unknown extension ${extension:S/:build//} for PHP ${PHP_VER}." |
367 |
@${FALSE} |
400 |
@${FALSE} |
368 |
. endif |
401 |
. endif |
369 |
. endif |
402 |
. endif |