aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorale <ale@FreeBSD.org>2013-10-30 21:28:00 +0800
committerale <ale@FreeBSD.org>2013-10-30 21:28:00 +0800
commit2283730827c47228eee48bc74404cd88dd4e2fcc (patch)
treebb5f03f53e5ed459712766fc823e70db81fd72e7 /Mk
parent3d4da939100183d27862b0dc4e12f0403180ad01 (diff)
downloadfreebsd-ports-gnome-2283730827c47228eee48bc74404cd88dd4e2fcc.tar.gz
freebsd-ports-gnome-2283730827c47228eee48bc74404cd88dd4e2fcc.tar.zst
freebsd-ports-gnome-2283730827c47228eee48bc74404cd88dd4e2fcc.zip
Add support for staging PHP extensions.
Submitted by: antoine
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.php.mk26
1 files changed, 14 insertions, 12 deletions
diff --git a/Mk/bsd.php.mk b/Mk/bsd.php.mk
index 47ad6210950b..9128537f6444 100644
--- a/Mk/bsd.php.mk
+++ b/Mk/bsd.php.mk
@@ -173,20 +173,21 @@ PHP_MODNAME?= ${PORTNAME}
PHP_HEADER_DIRS?= ""
do-install:
- @${MKDIR} ${PREFIX}/lib/php/${PHP_EXT_DIR}
+ @${MKDIR} ${STAGEDIR}${PREFIX}/lib/php/${PHP_EXT_DIR}
@${INSTALL_DATA} ${WRKSRC}/modules/${PHP_MODNAME}.so \
- ${PREFIX}/lib/php/${PHP_EXT_DIR}
+ ${STAGEDIR}${PREFIX}/lib/php/${PHP_EXT_DIR}
. for header in . ${PHP_HEADER_DIRS}
- @${MKDIR} ${PREFIX}/include/php/ext/${PHP_MODNAME}/${header}
+ @${MKDIR} ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/${header}
@${INSTALL_DATA} ${WRKSRC}/${header}/*.h \
- ${PREFIX}/include/php/ext/${PHP_MODNAME}/${header}
+ ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/${header}
. endfor
- @${RM} -f ${PREFIX}/include/php/ext/${PHP_MODNAME}/config.h
+ @${RM} -f ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/config.h
@${GREP} "#define \(COMPILE\|HAVE\|USE\)_" ${WRKSRC}/config.h \
- > ${PREFIX}/include/php/ext/${PHP_MODNAME}/config.h
+ > ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/config.h
+ @${MKDIR} ${STAGEDIR}${PREFIX}/etc/php
+.if defined(NO_STAGE)
@${ECHO_CMD} \#include \"ext/${PHP_MODNAME}/config.h\" \
>> ${PREFIX}/include/php/ext/php_config.h
- @${MKDIR} ${PREFIX}/etc/php
.if defined(USE_ZENDEXT)
@${ECHO_CMD} zend_extension=${PREFIX}/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}.so \
>> ${PREFIX}/etc/php/extensions.ini
@@ -194,6 +195,7 @@ do-install:
@${ECHO_CMD} extension=${PHP_MODNAME}.so \
>> ${PREFIX}/etc/php/extensions.ini
.endif
+.endif
add-plist-info: add-plist-phpext
add-plist-phpext:
@@ -201,10 +203,10 @@ add-plist-phpext:
>> ${TMPPLIST}
@${ECHO_CMD} "@unexec rmdir %D/lib/php/${PHP_EXT_DIR} 2> /dev/null || true" \
>> ${TMPPLIST}
- @${FIND} -P ${PREFIX}/include/php/ext/${PHP_MODNAME} ! -type d 2>/dev/null | \
- ${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST}
- @${FIND} -P -d ${PREFIX}/include/php/ext/${PHP_MODNAME} -type d 2>/dev/null | \
- ${SED} -ne 's,^${PREFIX}/,@dirrm ,p' >> ${TMPPLIST}
+ @${FIND} -P ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME} ! -type d 2>/dev/null | \
+ ${SED} -ne 's,^${STAGEDIR}${PREFIX}/,,p' >> ${TMPPLIST}
+ @${FIND} -P -d ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME} -type d 2>/dev/null | \
+ ${SED} -ne 's,^${STAGEDIR}${PREFIX}/,@dirrm ,p' >> ${TMPPLIST}
@${ECHO_CMD} "@exec echo \#include \\\"ext/${PHP_MODNAME}/config.h\\\" >> %D/include/php/ext/php_config.h" \
>> ${TMPPLIST}
@${ECHO_CMD} "@unexec cp %D/include/php/ext/php_config.h %D/include/php/ext/php_config.h.orig" \
@@ -238,7 +240,7 @@ add-plist-phpext:
@${ECHO_CMD} "@unexec rmdir %D/etc/php 2> /dev/null || true" \
>> ${TMPPLIST}
-security-check: php-ini
+package-message: php-ini
php-ini:
@${ECHO_CMD} "****************************************************************************"