Lines 21-26
Link Here
|
21 |
# |
21 |
# |
22 |
# USE_PHP= ext1 ext2 ext3 |
22 |
# USE_PHP= ext1 ext2 ext3 |
23 |
# |
23 |
# |
|
|
24 |
# PHP and Zend extensions built with :ext and :zend are automatically enabled |
25 |
# when the port is installed. Each port creates a PHP_EXT_INI_FILE file and |
26 |
# registers the extension in it. |
27 |
# |
28 |
# The PHP_EXT_INI_FILE file has a priority number embeded into its name so that |
29 |
# extensions are loaded in the right order. The priority is defined by |
30 |
# PHP_MOD_PRIO and is a number between 00 and 99. |
31 |
# |
32 |
# For extensions that do not depend on any extension, the priority is |
33 |
# automatically set to 20, for extensions that depend on another extension, the |
34 |
# priority is automatically set to 30. Some extensions may need to be loaded |
35 |
# before everyone else (for example opcache), or after an extension with a |
36 |
# priotity of 30, in that case, add PHP_MOD_PRIO=XX in the port's Makefile. |
37 |
# For example: |
38 |
# |
39 |
# USES= php:ext |
40 |
# USE_PHP= xml wddx |
41 |
# PHP_MOD_PRIO= 40 |
42 |
# |
24 |
# The port can set these options in its Makefile before bsd.port.pre.mk: |
43 |
# The port can set these options in its Makefile before bsd.port.pre.mk: |
25 |
# |
44 |
# |
26 |
# DEFAULT_PHP_VER=N - Use PHP version N if PHP is not yet installed. |
45 |
# DEFAULT_PHP_VER=N - Use PHP version N if PHP is not yet installed. |
Lines 204-216
_INCLUDE_USES_PHP_POST_MK=yes
Link Here
|
204 |
|
223 |
|
205 |
. if ${php_ARGS:Mext} || ${php_ARGS:Mzend} |
224 |
. if ${php_ARGS:Mext} || ${php_ARGS:Mzend} |
206 |
PHP_MODNAME?= ${PORTNAME} |
225 |
PHP_MODNAME?= ${PORTNAME} |
207 |
PHP_HEADER_DIRS?= "" |
226 |
PHP_EXT_PKGMESSAGE= ${WRKDIR}/php-ext-pkg-message |
|
|
227 |
PKGMESSAGE+= ${PHP_EXT_PKGMESSAGE} |
228 |
PHP_HEADER_DIRS+= . |
229 |
# If there is no priority defined, we wing it. |
230 |
. if !defined(PHP_MOD_PRIO) |
231 |
. if defined(USE_PHP) |
232 |
# If an extension needs another, put it after the others. |
233 |
PHP_MOD_PRIO= 30 |
234 |
. else |
235 |
# Otherwise, put it where it with everybody. |
236 |
PHP_MOD_PRIO= 20 |
237 |
. endif |
238 |
. endif |
239 |
PHP_EXT_INI_FILE= etc/php/ext-${PHP_MOD_PRIO}-${PHP_MODNAME}.ini |
208 |
|
240 |
|
209 |
do-install: |
241 |
do-install: |
210 |
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/php/${PHP_EXT_DIR} |
242 |
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/php/${PHP_EXT_DIR} |
211 |
@${INSTALL_LIB} ${WRKSRC}/modules/${PHP_MODNAME}.so \ |
243 |
@${INSTALL_LIB} ${WRKSRC}/modules/${PHP_MODNAME}.so \ |
212 |
${STAGEDIR}${PREFIX}/lib/php/${PHP_EXT_DIR} |
244 |
${STAGEDIR}${PREFIX}/lib/php/${PHP_EXT_DIR} |
213 |
. for header in . ${PHP_HEADER_DIRS} |
245 |
. for header in ${PHP_HEADER_DIRS} |
214 |
@${MKDIR} ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/${header} |
246 |
@${MKDIR} ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/${header} |
215 |
@${INSTALL_DATA} ${WRKSRC}/${header}/*.h \ |
247 |
@${INSTALL_DATA} ${WRKSRC}/${header}/*.h \ |
216 |
${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/${header} |
248 |
${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/${header} |
Lines 219-226
do-install:
Link Here
|
219 |
@${GREP} "#define \(COMPILE\|HAVE\|USE\)_" ${WRKSRC}/config.h \ |
251 |
@${GREP} "#define \(COMPILE\|HAVE\|USE\)_" ${WRKSRC}/config.h \ |
220 |
> ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/config.h |
252 |
> ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/config.h |
221 |
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/php |
253 |
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/php |
|
|
254 |
. if ${php_ARGS:Mzend} |
255 |
@${ECHO_CMD} "zend_extension=${PHP_MODNAME}.so" > ${STAGEDIR}${PREFIX}/${PHP_EXT_INI_FILE} |
256 |
. else |
257 |
@${ECHO_CMD} "extension=${PHP_MODNAME}.so" > ${STAGEDIR}${PREFIX}/${PHP_EXT_INI_FILE} |
258 |
. endif |
222 |
|
259 |
|
223 |
add-plist-info: add-plist-phpext |
260 |
_USES_stage+= 899:add-plist-phpext |
224 |
add-plist-phpext: |
261 |
add-plist-phpext: |
225 |
@${ECHO_CMD} "lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}.so" \ |
262 |
@${ECHO_CMD} "lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}.so" \ |
226 |
>> ${TMPPLIST} |
263 |
>> ${TMPPLIST} |
Lines 234-277
add-plist-phpext:
Link Here
|
234 |
>> ${TMPPLIST} |
271 |
>> ${TMPPLIST} |
235 |
@${ECHO_CMD} "@unexec rm %D/include/php/ext/php_config.h.orig" \ |
272 |
@${ECHO_CMD} "@unexec rm %D/include/php/ext/php_config.h.orig" \ |
236 |
>> ${TMPPLIST} |
273 |
>> ${TMPPLIST} |
237 |
@${ECHO_CMD} "@dir etc/php" \ |
274 |
@${ECHO_CMD} "${PHP_EXT_INI_FILE}" \ |
238 |
>> ${TMPPLIST} |
275 |
>> ${TMPPLIST} |
|
|
276 |
@${ECHO_CMD} "****************************************************************************" > ${PHP_EXT_PKGMESSAGE} |
277 |
@${ECHO_CMD} "" >> ${PHP_EXT_PKGMESSAGE} |
278 |
@${ECHO_CMD} "The following line has been added to your ${PREFIX}/${PHP_EXT_INI_FILE}" >> ${PHP_EXT_PKGMESSAGE} |
279 |
@${ECHO_CMD} "configuration file to automatically load the installed extension:" >> ${PHP_EXT_PKGMESSAGE} |
280 |
@${ECHO_CMD} "" >> ${PHP_EXT_PKGMESSAGE} |
239 |
. if ${php_ARGS:Mzend} |
281 |
. if ${php_ARGS:Mzend} |
240 |
@${ECHO_CMD} "@exec echo zend_extension=%D/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}.so >> %D/etc/php/extensions.ini" \ |
282 |
@${ECHO_CMD} "zend_extension=${PHP_MODNAME}.so" >> ${PHP_EXT_PKGMESSAGE} |
241 |
>> ${TMPPLIST} |
|
|
242 |
. else |
243 |
@${ECHO_CMD} "@exec echo extension=${PHP_MODNAME}.so >> %D/etc/php/extensions.ini" \ |
244 |
>> ${TMPPLIST} |
245 |
. endif |
246 |
@${ECHO_CMD} "@unexec cp %D/etc/php/extensions.ini %D/etc/php/extensions.ini.orig" \ |
247 |
>> ${TMPPLIST} |
248 |
. if ${php_ARGS:Mzend} |
249 |
@${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" \ |
250 |
>> ${TMPPLIST} |
251 |
. else |
252 |
@${ECHO_CMD} "@unexec grep -v extension=${PHP_MODNAME}\\\.so %D/etc/php/extensions.ini.orig > %D/etc/php/extensions.ini || true" \ |
253 |
>> ${TMPPLIST} |
254 |
. endif |
255 |
@${ECHO_CMD} "@unexec rm %D/etc/php/extensions.ini.orig" \ |
256 |
>> ${TMPPLIST} |
257 |
@${ECHO_CMD} "@unexec [ -s %D/etc/php/extensions.ini ] || rm %D/etc/php/extensions.ini" \ |
258 |
>> ${TMPPLIST} |
259 |
|
260 |
package-message: php-ini |
261 |
|
262 |
php-ini: |
263 |
@${ECHO_CMD} "****************************************************************************" |
264 |
@${ECHO_CMD} "" |
265 |
@${ECHO_CMD} "The following line has been added to your ${PREFIX}/etc/php/extensions.ini" |
266 |
@${ECHO_CMD} "configuration file to automatically load the installed extension:" |
267 |
@${ECHO_CMD} "" |
268 |
. if ${php_ARGS:Mzend} |
269 |
@${ECHO_CMD} "zend_extension=${PREFIX}/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}.so" |
270 |
. else |
283 |
. else |
271 |
@${ECHO_CMD} "extension=${PHP_MODNAME}.so" |
284 |
@${ECHO_CMD} "extension=${PHP_MODNAME}.so" >> ${PHP_EXT_PKGMESSAGE} |
272 |
. endif |
285 |
. endif |
273 |
@${ECHO_CMD} "" |
286 |
@${ECHO_CMD} "" >> ${PHP_EXT_PKGMESSAGE} |
274 |
@${ECHO_CMD} "****************************************************************************" |
287 |
@${ECHO_CMD} "****************************************************************************" >> ${PHP_EXT_PKGMESSAGE} |
275 |
. endif |
288 |
. endif |
276 |
|
289 |
|
277 |
# Extensions |
290 |
# Extensions |