summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Samu Voutilainen <smar@smar.fi> 2012-07-30 10:41:44 +0300
committerAvatar Wulf C. Krueger <philantrop@exherbo.org> 2012-08-10 23:55:44 +0200
commitaebac9578ea9c699dcce22dfb0922c689f73f7f7 (patch)
tree965925ca11c7bdf7bb5762dbd3cf54284b08d90f
parent8a2d79deb2ead4c78a0e2c94eabcf07e5505c8b0 (diff)
downloadphp-aebac9578ea9c699dcce22dfb0922c689f73f7f7.tar.gz
php-aebac9578ea9c699dcce22dfb0922c689f73f7f7.tar.xz
exlibs/php-pecl: zend module support
There is now optional argument module=zend that can be passed to install zend module install of standard PHP module to the php.ini configuration file.
-rw-r--r--exlibs/php-pecl.exlib42
-rw-r--r--packages/dev-pecl/bcompiler/bcompiler-0.9.3-r2.exheres-0 (renamed from packages/dev-pecl/bcompiler/bcompiler-0.9.3-r1.exheres-0)0
2 files changed, 35 insertions, 7 deletions
diff --git a/exlibs/php-pecl.exlib b/exlibs/php-pecl.exlib
index fa9c8d5..31daa26 100644
--- a/exlibs/php-pecl.exlib
+++ b/exlibs/php-pecl.exlib
@@ -5,6 +5,8 @@
export_exlib_phases src_install src_configure
+myexparam module=extension
+
DEPENDENCIES="
build+run:
dev-lang/php[pear]
@@ -30,6 +32,30 @@ UPSTREAM_CHANGELOG="http://pecl.php.net/package-changelog.php?package=${PN}&rele
WORK=${WORKBASE}/${PN}-${PECL_PV}
+install_module_config() {
+ hasLines=$(grep -c "extension = ${PN}.so" "${IMAGE}"/etc/php/php.ini)
+ if [[ $hasLines -eq 0 ]] ; then
+ # Find linenumber extension_dir and use the next line.
+ linenum=$(edo grep -n "extension_dir" "${IMAGE}"/etc/php/php.ini | head -1 | awk -F: '{ print $1}')
+ linenum=$((linenum+1))
+ # Insert extension in php.ini.
+ edo sed -i "${linenum}i\extension = ${PN}.so" "${IMAGE}"/etc/php/php.ini
+ fi
+}
+
+install_zend_config() {
+ extensionDir=$(php-config --extension-dir)
+ extensionFileName="${extensionDir}/${PN}.so"
+ hasLines=$(grep -c "zend_extension = ${extensionFileName}" "${IMAGE}"/etc/php/php.ini)
+ if [[ $hasLines -eq 0 ]] ; then
+ # Find linenumber extension_dir and use the next line.
+ linenum=$(edo grep -n "extension_dir" "${IMAGE}"/etc/php/php.ini | head -1 | awk -F: '{ print $1}')
+ linenum=$((linenum+1))
+ # Insert extension in php.ini.
+ edo sed -i "${linenum}i\zend_extension = ${extensionFileName}" "${IMAGE}"/etc/php/php.ini
+ fi
+}
+
php-pecl_src_configure() {
phpize
@@ -37,19 +63,21 @@ php-pecl_src_configure() {
}
php-pecl_src_install() {
+ exparam -v PHP_MODULE_TYPE module
+
# Let install write to PHP exstension directory.
sydboxcmd write $(php-config --extension-dir)
# Provide a updated php.ini which loads the new extension - based on the current php.ini.
edo mkdir -p "${IMAGE}"/etc/php
edo cp /etc/php/php.ini "${IMAGE}"/etc/php/php.ini
- hasLines=$(grep -c "extension = ${PN}.so" "${IMAGE}"/etc/php/php.ini)
- if [[ $hasLines -eq 0 ]] ; then
- # Find linenumber extension_dir and use the next line.
- linenum=$(edo grep -n "extension_dir" "${IMAGE}"/etc/php/php.ini | head -1 | awk -F: '{ print $1}')
- linenum=$((linenum+1))
- # Insert extension in php.ini.
- edo sed -i "${linenum}i\extension = ${PN}.so" "${IMAGE}"/etc/php/php.ini
+
+ if [[ "$PHP_MODULE_TYPE" == "zend" ]] ; then
+ install_zend_config
+ elif [[ "$PHP_MODULE_TYPE" == "module" ]] ; then
+ install_module_config
+ else
+ die "Invalid module type"
fi
default
diff --git a/packages/dev-pecl/bcompiler/bcompiler-0.9.3-r1.exheres-0 b/packages/dev-pecl/bcompiler/bcompiler-0.9.3-r2.exheres-0
index 0764284..0764284 100644
--- a/packages/dev-pecl/bcompiler/bcompiler-0.9.3-r1.exheres-0
+++ b/packages/dev-pecl/bcompiler/bcompiler-0.9.3-r2.exheres-0