wok-next rev 21348

updated php (5.5.13 -> 7.4.4)
author Hans-G?nter Theisgen
date Thu Apr 09 14:26:22 2020 +0100 (2020-04-09)
parents 8889c64e3dd7
children f48466f5cf01
files php/receipt
line diff
     1.1 --- a/php/receipt	Thu Apr 09 13:46:30 2020 +0100
     1.2 +++ b/php/receipt	Thu Apr 09 14:26:22 2020 +0100
     1.3 @@ -1,21 +1,22 @@
     1.4  # SliTaz package receipt v2.
     1.5  
     1.6  PACKAGE="php"
     1.7 -VERSION="5.5.13"
     1.8 +VERSION="7.4.4"
     1.9  CATEGORY="development"
    1.10  SHORT_DESC="PHP web programming language"
    1.11 -MAINTAINER="devel@slitaz.org"
    1.12 +MAINTAINER="maintainer@slitaz.org"
    1.13  LICENSE="BSD"
    1.14 -WEB_SITE="http://www.php.net/"
    1.15 +WEB_SITE="https://www.php.net/"
    1.16  
    1.17 -TARBALL="$PACKAGE-$VERSION.tar.bz2"
    1.18 -WGET_URL="http://www.php.net/distributions/$TARBALL"
    1.19 +TARBALL="$PACKAGE-$VERSION.tar.xz"
    1.20 +WGET_URL="https://www.php.net/distributions/$TARBALL"
    1.21  
    1.22 -BUILD_DEPENDS="sqlite3-dev libxml2-dev zlib-dev libmysqlclient mysql-dev \
    1.23 -net-snmp-dev postgresql-dev gettext-dev openssl-dev apache-dev apr-util-dev \
    1.24 -c-client mhash-dev libpng-dev libunixODBC unixODBC-dev openldap-dev \
    1.25 -libldap apr-dev libmcrypt-dev curl-dev cyrus-sasl-dev perl \
    1.26 -jpeg-dev net-snmp-dev libvpx-dev apache coreutils-conditions sed re2c"
    1.27 +BUILD_DEPENDS="apache apache-dev apr-dev apr-util-dev c-client 
    1.28 +	coreutils-conditions curl-dev cyrus-sasl-dev gettext-dev 
    1.29 +	jpeg-dev libldap libmcrypt-dev libmysqlclient libpng-dev 
    1.30 +	libunixODBC libvpx-dev libxml2-dev mhash-dev mysql-dev 
    1.31 +	net-snmp-dev openldap-dev openssl-dev perl postgresql-dev 
    1.32 +	re2c sed sqlite3-dev unixODBC-dev zlib-dev"
    1.33  SPLIT="\
    1.34  $PACKAGE-apache    $PACKAGE-cherokee $PACKAGE-cli     $PACKAGE-common \
    1.35  $PACKAGE-curl      $PACKAGE-dba      $PACKAGE-dev     $PACKAGE-gd \
    1.36 @@ -24,65 +25,69 @@
    1.37  $PACKAGE-pdo-pgsql $PACKAGE-pear     $PACKAGE-pgsql   $PACKAGE-snmp \
    1.38  $PACKAGE-soap      $PACKAGE-sqlite"
    1.39  
    1.40 -compile_rules() {
    1.41 +compile_rules()
    1.42 +{
    1.43  	ARCH_ARGS="\
    1.44 -	--enable-mbstring \
    1.45 -	--enable-sockets \
    1.46 -	--enable-ftp \
    1.47 -	--enable-zip \
    1.48 -	--enable-calendar \
    1.49 -	--enable-exif \
    1.50 -	--config-cache \
    1.51 -	--enable-dba=shared \
    1.52 -	--with-config-file-path=/etc \
    1.53 -	--with-zlib \
    1.54 -	--with-gettext \
    1.55 -	--with-mcrypt=shared,/usr \
    1.56 -	--with-mysql=shared,/usr \
    1.57 -	--with-mysqli=shared \
    1.58 -	--with-mysql-sock=/var/run/mysqld/mysql.sock \
    1.59 -	--with-pdo-sqlite=shared,/usr \
    1.60 -	--with-pgsql=shared,/usr \
    1.61 -	--with-snmp=shared,/usr \
    1.62 -	--enable-soap=shared,/usr \
    1.63 -	--with-ldap=shared \
    1.64 -	--with-imap=shared \
    1.65 -	--with-imap-ssl \
    1.66 -	--with-mhash \
    1.67 -	--with-gd=shared \
    1.68 -	--with-jpeg-dir=/usr \
    1.69 -	--with-png-dir=/usr \
    1.70 -	--with-vpx-dir=/usr \
    1.71 -	--with-openssl=shared \
    1.72 -	--with-unixODBC=shared,/usr \
    1.73 -	--with-pear=/usr/share/php \
    1.74 -	--with-pdo-mysql=shared \
    1.75 -	--with-pdo-pgsql=shared \
    1.76 -	--with-curl=shared \
    1.77 -	--with-sqlite3=shared,/usr \
    1.78 +	--enable-mbstring				\
    1.79 +	--enable-sockets				\
    1.80 +	--enable-ftp					\
    1.81 +	--enable-zip					\
    1.82 +	--enable-calendar				\
    1.83 +	--enable-exif					\
    1.84 +	--config-cache					\
    1.85 +	--enable-dba=shared				\
    1.86 +	--with-config-file-path=/etc			\
    1.87 +	--with-zlib					\
    1.88 +	--with-gettext					\
    1.89 +	--with-mcrypt=shared,/usr			\
    1.90 +	--with-mysql=shared,/usr			\
    1.91 +	--with-mysqli=shared				\
    1.92 +	--with-mysql-sock=/var/run/mysqld/mysql.sock	\
    1.93 +	--with-pdo-sqlite=shared,/usr			\
    1.94 +	--with-pgsql=shared,/usr			\
    1.95 +	--with-snmp=shared,/usr				\
    1.96 +	--enable-soap=shared,/usr			\
    1.97 +	--with-ldap=shared				\
    1.98 +	--with-imap=shared				\
    1.99 +	--with-imap-ssl					\
   1.100 +	--with-mhash					\
   1.101 +	--with-gd=shared				\
   1.102 +	--with-jpeg-dir=/usr				\
   1.103 +	--with-png-dir=/usr				\
   1.104 +	--with-vpx-dir=/usr				\
   1.105 +	--with-openssl=shared				\
   1.106 +	--with-unixODBC=shared,/usr			\
   1.107 +	--with-pear=/usr/share/php			\
   1.108 +	--with-pdo-mysql=shared				\
   1.109 +	--with-pdo-pgsql=shared				\
   1.110 +	--with-curl=shared				\
   1.111 +	--with-sqlite3=shared,/usr			\
   1.112  	--enable-maintainer-zts"
   1.113  
   1.114 -	sed -i 's|PLANE_[UVY]\]|VPX_&|;s|IMG_FMT_I420|VPX_&|' ext/gd/libgd/webpimg.c
   1.115 -	sed -i 's/pam_start/pam_nostart/' configure
   1.116 +	sed -i 's|PLANE_[UVY]\]|VPX_&|;s|IMG_FMT_I420|VPX_&|' \
   1.117 +		ext/gd/libgd/webpimg.c
   1.118 +	sed -i 's/pam_start/pam_nostart/' \
   1.119 +		configure
   1.120  
   1.121 -	./configure \
   1.122 -		$ARCH_ARGS \
   1.123 +	./configure		\
   1.124 +		$ARCH_ARGS	\
   1.125  		$CONFIGURE_ARGS &&
   1.126  	make $MAKEFLAGS &&
   1.127  	make -j1 INSTALL_ROOT=$install install
   1.128  
   1.129 -	./configure \
   1.130 -		$ARCH_ARGS \
   1.131 +	./configure		\
   1.132 +		$ARCH_ARGS	\
   1.133  		$CONFIGURE_ARGS \
   1.134  		--with-apxs2=/usr/bin/apxs &&
   1.135  	make $MAKEFLAGS &&
   1.136  	mkdir -p $install/etc/apache &&
   1.137 -	cp /etc/apache/httpd.conf $install/etc/apache/httpd.conf &&
   1.138 +	cp /etc/apache/httpd.conf	$install/etc/apache/httpd.conf &&
   1.139  	make -j1 INSTALL_ROOT=$install install || return 1
   1.140  
   1.141 -	# Production config file.
   1.142 +	# Production configuration file.
   1.143  	mkdir -p $install/etc
   1.144 -	cp $src/php.ini-production $install/etc/php.ini || return 1
   1.145 +
   1.146 +	cp $src/php.ini-production		$install/etc/php.ini || return 1
   1.147  	sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
   1.148  		-i $install/etc/php.ini
   1.149  
   1.150 @@ -93,7 +98,8 @@
   1.151  	install -Dm644 $stuff/php.png           $install/usr/share/pixmaps/php.png
   1.152  }
   1.153  
   1.154 -genpkg_rules() {
   1.155 +genpkg_rules()
   1.156 +{
   1.157  	case $PACKAGE in
   1.158  		php)
   1.159  			copy usr/bin/php-cgi
   1.160 @@ -218,16 +224,19 @@
   1.161  }
   1.162  
   1.163  # -----------------------------------------------------------------------------
   1.164 -pre_install_php() {
   1.165 -	if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
   1.166 +pre_install_php()
   1.167 +{
   1.168 +	if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]
   1.169 +	  then
   1.170  		/etc/init.d/lighttpd stop
   1.171  	fi
   1.172  }
   1.173  
   1.174 -post_install_php() {
   1.175 +post_install_php()
   1.176 +{
   1.177  	# Enable php
   1.178 -	if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
   1.179 -
   1.180 +	if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
   1.181 +	  then
   1.182  		[ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] ||
   1.183  		tazpkg get-install lighttpd-modules --root="$1/"
   1.184  
   1.185 @@ -250,19 +259,23 @@
   1.186  	fi
   1.187  
   1.188  	# Start Web server.
   1.189 -	if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]; then
   1.190 +	if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]
   1.191 +	  then
   1.192  		/etc/init.d/lighttpd start
   1.193  	fi
   1.194  }
   1.195  
   1.196  # -----------------------------------------------------------------------------
   1.197 -pre_installi_php_apache() {
   1.198 -	if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
   1.199 +pre_installi_php_apache()
   1.200 +{
   1.201 +	if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
   1.202 +	  then
   1.203  		/etc/init.d/apache stop
   1.204  	fi
   1.205  }
   1.206  
   1.207 -post_install_php_apache() {
   1.208 +post_install_php_apache()
   1.209 +{
   1.210  	grep -q php5_module "$1/etc/apache/httpd.conf" ||
   1.211  	{
   1.212  		sed \
   1.213 @@ -287,7 +300,8 @@
   1.214  EOT
   1.215  
   1.216  	# Restart Web server.
   1.217 -	if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
   1.218 +	if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
   1.219 +	  then
   1.220  		/etc/init.d/apache stop
   1.221  		sleep 2
   1.222  	fi
   1.223 @@ -297,13 +311,16 @@
   1.224  }
   1.225  
   1.226  # -----------------------------------------------------------------------------
   1.227 -pre_install_php_cherokee() {
   1.228 -	if [ -z "$1" -a ! -f "/var/run/cherokee.pid" ]; then
   1.229 +pre_install_php_cherokee()
   1.230 +{
   1.231 +	if [ -z "$1" -a ! -f "/var/run/cherokee.pid" ]
   1.232 +	  then
   1.233  		/etc/init.d/cherokee stop
   1.234  	fi
   1.235  }
   1.236  
   1.237 -post_install_php_cherokee() {
   1.238 +post_install_php_cherokee()
   1.239 +{
   1.240  	# Enable php
   1.241  #	if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
   1.242  #	  [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] || \
   1.243 @@ -321,28 +338,226 @@
   1.244  #	fi
   1.245  
   1.246  	# Start Web server.
   1.247 -	if [ -z "$1" -a ! -f /var/run/cherokee.pid -a -f /etc/init.d/cherokee ]; then
   1.248 +	if [ -z "$1" -a ! -f /var/run/cherokee.pid -a -f /etc/init.d/cherokee ]
   1.249 +	  then
   1.250  		/etc/init.d/cherokee start
   1.251  	fi
   1.252  }
   1.253  
   1.254  # -----------------------------------------------------------------------------
   1.255 -pre_install_php_common() {
   1.256 +pre_install_php_common()
   1.257 +{
   1.258  	# Backup existing php.ini
   1.259 -	if [ -f "$1/etc/php.ini" ]; then
   1.260 +	if [ -f "$1/etc/php.ini" ]
   1.261 +	  then
   1.262  		cp "$1/etc/php.ini" "$1/etc/php.ini.bak"
   1.263  	fi
   1.264  }
   1.265  
   1.266 -post_install_php_common() {
   1.267 +post_install_php_common()
   1.268 +{
   1.269  	# Restore original php.ini
   1.270 -	if [ -f "$1/etc/php.ini.bak" ]; then
   1.271 +	if [ -f "$1/etc/php.ini.bak" ]
   1.272 +	  then
   1.273  		mv -f "$1/etc/php.ini.bak" "$1/etc/php.ini"
   1.274  	fi
   1.275  }
   1.276  
   1.277  # -----------------------------------------------------------------------------
   1.278 -pre_install_php_curl() {
   1.279 +pre_install_php_curl()
   1.280 +{
   1.281 +	while read daemon file
   1.282 +	  do
   1.283 +		if [ -z "$1" -a -f "/var/run/$file" ]
   1.284 +		  then
   1.285 +			/etc/init.d/$daemon stop
   1.286 +		fi
   1.287 +	  done <<EOT
   1.288 +apache   apache/httpd.pid
   1.289 +lighttpd lighttpd.pid
   1.290 +EOT
   1.291 +}
   1.292 +
   1.293 +post_install_php_curl()
   1.294 +{
   1.295 +	grep -q ^extension=curl.so "$1/etc/php.ini" ||
   1.296 +	sed	-e 's|extension=msql.so|extension=msql.so\nextension=curl.so|' \
   1.297 +		-i "$1/etc/php.ini"
   1.298 +
   1.299 +	# Start Web server.
   1.300 +	while read daemon file
   1.301 +	  do
   1.302 +		[ -z "$1" ] || continue
   1.303 +		if [ -f "/var/run/$file" ]
   1.304 +		  then
   1.305 +			/etc/init.d/$daemon stop
   1.306 +			sleep 2
   1.307 +		fi
   1.308 +		if [ -f /etc/init.d/$daemon ]
   1.309 +		  then
   1.310 +			/etc/init.d/$daemon start
   1.311 +		fi
   1.312 +	  done <<EOT
   1.313 +apache   apache/httpd.pid
   1.314 +lighttpd lighttpd.pid
   1.315 +EOT
   1.316 +}
   1.317 +
   1.318 +pre_remove_php_curl()
   1.319 +{
   1.320 +	sed -i '/.*=curl.so.*/d' /etc/php.ini
   1.321 +
   1.322 +	# Start Web server.
   1.323 +	while read daemon file
   1.324 +	  do
   1.325 +		[ -z "$1" ] || continue
   1.326 +		if [ -f "/var/run/$file" ]
   1.327 +		  then
   1.328 +			/etc/init.d/$daemon stop
   1.329 +			sleep 2
   1.330 +		fi
   1.331 +		if [ -f /etc/init.d/$daemon ]
   1.332 +		  then
   1.333 +			/etc/init.d/$daemon start
   1.334 +		fi
   1.335 +	  done <<EOT
   1.336 +apache   apache/httpd.pid
   1.337 +lighttpd lighttpd.pid
   1.338 +EOT
   1.339 +}
   1.340 +
   1.341 +# -----------------------------------------------------------------------------
   1.342 +pre_install_php_dba()
   1.343 +{
   1.344 +	while read daemon file
   1.345 +	  do
   1.346 +		if [ -z "$1" -a -f "/var/run/$file" ]
   1.347 +		  then
   1.348 +			/etc/init.d/$daemon stop
   1.349 +		fi
   1.350 +	  done <<EOT
   1.351 +apache   apache/httpd.pid
   1.352 +lighttpd lighttpd.pid
   1.353 +EOT
   1.354 +}
   1.355 +
   1.356 +post_install_php_dba()
   1.357 +{
   1.358 +	grep -q ^extension=dba.so "$1/etc/php.ini" ||
   1.359 +	sed	-e 's|extension=msql.so|extension=msql.so\nextension=dba.so|' \
   1.360 +		-i "$1/etc/php.ini"
   1.361 +
   1.362 +	# Start Web server.
   1.363 +	while read daemon file
   1.364 +	  do
   1.365 +		[ -z "$1" ] || continue
   1.366 +		if [ -f "/var/run/$file" ]
   1.367 +		  then
   1.368 +			/etc/init.d/$daemon stop
   1.369 +			sleep 2
   1.370 +		fi
   1.371 +		if [ -f /etc/init.d/$daemon ]
   1.372 +		  then
   1.373 +			/etc/init.d/$daemon start
   1.374 +		fi
   1.375 +	done <<EOT
   1.376 +apache   apache/httpd.pid
   1.377 +lighttpd lighttpd.pid
   1.378 +EOT
   1.379 +}
   1.380 +
   1.381 +pre_remove_php_dba()
   1.382 +{
   1.383 +	sed -i '/.*=dba.so.*/d' /etc/php.ini
   1.384 +
   1.385 +	# Start Web server.
   1.386 +	while read daemon file
   1.387 +	  do
   1.388 +		[ -z "$1" ] || continue
   1.389 +		if [ -f "/var/run/$file" ]
   1.390 +		  then
   1.391 +			/etc/init.d/$daemon stop
   1.392 +			sleep 2
   1.393 +		fi
   1.394 +		if [ -f /etc/init.d/$daemon ]
   1.395 +		  then
   1.396 +			/etc/init.d/$daemon start
   1.397 +		fi
   1.398 +	  done <<EOT
   1.399 +apache   apache/httpd.pid
   1.400 +lighttpd lighttpd.pid
   1.401 +EOT
   1.402 +}
   1.403 +
   1.404 +# -----------------------------------------------------------------------------
   1.405 +pre_install_php_gd()
   1.406 +{
   1.407 +	while read daemon file
   1.408 +	  do
   1.409 +		if [ -z "$1" -a -f "/var/run/$file" ]
   1.410 +		  then
   1.411 +			/etc/init.d/$daemon stop
   1.412 +		fi
   1.413 +	  done <<EOT
   1.414 +apache   apache/httpd.pid
   1.415 +lighttpd lighttpd.pid
   1.416 +EOT
   1.417 +}
   1.418 +
   1.419 +post_install_php_gd()
   1.420 +{
   1.421 +	grep -q ^extension=gd.so "$1/etc/php.ini" ||
   1.422 +	sed	-e 's|extension=msql.so|extension=msql.so\nextension=gd.so|' \
   1.423 +		-i "$1/etc/php.ini"
   1.424 +
   1.425 +	# Start Web server.
   1.426 +	while read daemon file
   1.427 +	  do
   1.428 +		[ -z "$1" ] || continue
   1.429 +		if [ -z "$1" -a -f "/var/run/$file" ]
   1.430 +		  then
   1.431 +			/etc/init.d/$daemon stop
   1.432 +			sleep 2
   1.433 +		fi
   1.434 +		if [ -z "$1" -a -f /etc/init.d/$daemon ]
   1.435 +		  then
   1.436 +			/etc/init.d/$daemon start
   1.437 +		fi
   1.438 +	  done <<EOT
   1.439 +apache   apache/httpd.pid
   1.440 +lighttpd lighttpd.pid
   1.441 +EOT
   1.442 +}
   1.443 +
   1.444 +pre_remove_php_gd()
   1.445 +{
   1.446 +	sed -i '/.*=gd.so.*/d' "$1/etc/php.ini"
   1.447 +
   1.448 +	# Start Web server.
   1.449 +	while read daemon file
   1.450 +	  do
   1.451 +		if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]
   1.452 +		  then
   1.453 +			[ -z "$1" ] || continue
   1.454 +			if [ -z "$1" -a -f "/var/run/$file" ]
   1.455 +			  then
   1.456 +				/etc/init.d/$daemon stop
   1.457 +				sleep 2
   1.458 +			fi
   1.459 +			if [ -z "$1" -a -f /etc/init.d/$daemon ]
   1.460 +			  then
   1.461 +				/etc/init.d/$daemon start
   1.462 +			fi
   1.463 +		fi
   1.464 +	  done <<EOT
   1.465 +apache   apache/httpd.pid
   1.466 +lighttpd lighttpd.pid
   1.467 +EOT
   1.468 +}
   1.469 +
   1.470 +# -----------------------------------------------------------------------------
   1.471 +pre_install_php_imap()
   1.472 +{
   1.473  	while read daemon file; do
   1.474  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.475  			/etc/init.d/$daemon stop
   1.476 @@ -353,162 +568,8 @@
   1.477  EOT
   1.478  }
   1.479  
   1.480 -post_install_php_curl() {
   1.481 -	grep -q ^extension=curl.so "$1/etc/php.ini" ||
   1.482 -	sed -e 's|extension=msql.so|extension=msql.so\nextension=curl.so|' -i "$1/etc/php.ini"
   1.483 -
   1.484 -	# Start Web server.
   1.485 -	while read daemon file; do
   1.486 -		[ -z "$1" ] || continue
   1.487 -		if [ -f "/var/run/$file" ]; then
   1.488 -			/etc/init.d/$daemon stop
   1.489 -			sleep 2
   1.490 -		fi
   1.491 -		if [ -f /etc/init.d/$daemon ]; then
   1.492 -			/etc/init.d/$daemon start
   1.493 -		fi
   1.494 -	done <<EOT
   1.495 -apache   apache/httpd.pid
   1.496 -lighttpd lighttpd.pid
   1.497 -EOT
   1.498 -}
   1.499 -
   1.500 -pre_remove_php_curl() {
   1.501 -	sed -i '/.*=curl.so.*/d' /etc/php.ini
   1.502 -
   1.503 -	# Start Web server.
   1.504 -	while read daemon file; do
   1.505 -		[ -z "$1" ] || continue
   1.506 -		if [ -f "/var/run/$file" ]; then
   1.507 -			/etc/init.d/$daemon stop
   1.508 -			sleep 2
   1.509 -		fi
   1.510 -		if [ -f /etc/init.d/$daemon ]; then
   1.511 -			/etc/init.d/$daemon start
   1.512 -		fi
   1.513 -	done <<EOT
   1.514 -apache   apache/httpd.pid
   1.515 -lighttpd lighttpd.pid
   1.516 -EOT
   1.517 -}
   1.518 -
   1.519 -# -----------------------------------------------------------------------------
   1.520 -pre_install_php_dba() {
   1.521 -	while read daemon file; do
   1.522 -		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.523 -			/etc/init.d/$daemon stop
   1.524 -		fi
   1.525 -	done <<EOT
   1.526 -apache   apache/httpd.pid
   1.527 -lighttpd lighttpd.pid
   1.528 -EOT
   1.529 -}
   1.530 -
   1.531 -post_install_php_dba() {
   1.532 -	grep -q ^extension=dba.so "$1/etc/php.ini" ||
   1.533 -	sed -e 's|extension=msql.so|extension=msql.so\nextension=dba.so|' -i "$1/etc/php.ini"
   1.534 -
   1.535 -	# Start Web server.
   1.536 -	while read daemon file; do
   1.537 -		[ -z "$1" ] || continue
   1.538 -		if [ -f "/var/run/$file" ]; then
   1.539 -			/etc/init.d/$daemon stop
   1.540 -			sleep 2
   1.541 -		fi
   1.542 -		if [ -f /etc/init.d/$daemon ]; then
   1.543 -			/etc/init.d/$daemon start
   1.544 -		fi
   1.545 -	done <<EOT
   1.546 -apache   apache/httpd.pid
   1.547 -lighttpd lighttpd.pid
   1.548 -EOT
   1.549 -}
   1.550 -
   1.551 -pre_remove_php_dba() {
   1.552 -	sed -i '/.*=dba.so.*/d' /etc/php.ini
   1.553 -
   1.554 -	# Start Web server.
   1.555 -	while read daemon file; do
   1.556 -		[ -z "$1" ] || continue
   1.557 -		if [ -f "/var/run/$file" ]; then
   1.558 -			/etc/init.d/$daemon stop
   1.559 -			sleep 2
   1.560 -		fi
   1.561 -		if [ -f /etc/init.d/$daemon ]; then
   1.562 -			/etc/init.d/$daemon start
   1.563 -		fi
   1.564 -	done <<EOT
   1.565 -apache   apache/httpd.pid
   1.566 -lighttpd lighttpd.pid
   1.567 -EOT
   1.568 -}
   1.569 -
   1.570 -# -----------------------------------------------------------------------------
   1.571 -pre_install_php_gd() {
   1.572 -	while read daemon file; do
   1.573 -		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.574 -			/etc/init.d/$daemon stop
   1.575 -		fi
   1.576 -	done <<EOT
   1.577 -apache   apache/httpd.pid
   1.578 -lighttpd lighttpd.pid
   1.579 -EOT
   1.580 -}
   1.581 -
   1.582 -post_install_php_gd() {
   1.583 -	grep -q ^extension=gd.so "$1/etc/php.ini" ||
   1.584 -	sed -e 's|extension=msql.so|extension=msql.so\nextension=gd.so|' -i "$1/etc/php.ini"
   1.585 -
   1.586 -	# Start Web server.
   1.587 -	while read daemon file; do
   1.588 -		[ -z "$1" ] || continue
   1.589 -		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.590 -			/etc/init.d/$daemon stop
   1.591 -			sleep 2
   1.592 -		fi
   1.593 -		if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
   1.594 -			/etc/init.d/$daemon start
   1.595 -		fi
   1.596 -	done <<EOT
   1.597 -apache   apache/httpd.pid
   1.598 -lighttpd lighttpd.pid
   1.599 -EOT
   1.600 -}
   1.601 -
   1.602 -pre_remove_php_gd() {
   1.603 -	sed -i '/.*=gd.so.*/d' "$1/etc/php.ini"
   1.604 -
   1.605 -	# Start Web server.
   1.606 -	while read daemon file; do
   1.607 -		if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
   1.608 -			[ -z "$1" ] || continue
   1.609 -			if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.610 -				/etc/init.d/$daemon stop
   1.611 -				sleep 2
   1.612 -			fi
   1.613 -			if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
   1.614 -				/etc/init.d/$daemon start
   1.615 -			fi
   1.616 -		fi
   1.617 -	done <<EOT
   1.618 -apache   apache/httpd.pid
   1.619 -lighttpd lighttpd.pid
   1.620 -EOT
   1.621 -}
   1.622 -
   1.623 -# -----------------------------------------------------------------------------
   1.624 -pre_install_php_imap() {
   1.625 -	while read daemon file; do
   1.626 -		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.627 -			/etc/init.d/$daemon stop
   1.628 -		fi
   1.629 -	done <<EOT
   1.630 -apache   apache/httpd.pid
   1.631 -lighttpd lighttpd.pid
   1.632 -EOT
   1.633 -}
   1.634 -
   1.635 -post_install_php_imap() {
   1.636 +post_install_php_imap()
   1.637 +{
   1.638  	grep -q ^extension=imap.so "$1/etc/php.ini" ||
   1.639  	sed -e 's|extension=msql.so|extension=msql.so\nextension=imap.so|' -i "$1/etc/php.ini"
   1.640  
   1.641 @@ -528,7 +589,8 @@
   1.642  EOT
   1.643  }
   1.644  
   1.645 -pre_remove_php_imap() {
   1.646 +pre_remove_php_imap()
   1.647 +{
   1.648  	sed -i '/.*=imap.so.*/d' /etc/php.ini
   1.649  
   1.650  	# Start Web server.
   1.651 @@ -548,7 +610,8 @@
   1.652  }
   1.653  
   1.654  # -----------------------------------------------------------------------------
   1.655 -pre_install_php_ldap() {
   1.656 +pre_install_php_ldap()
   1.657 +{
   1.658  	while read daemon file; do
   1.659  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.660  			/etc/init.d/$daemon stop
   1.661 @@ -559,7 +622,8 @@
   1.662  EOT
   1.663  }
   1.664  
   1.665 -post_install_php_ldap() {
   1.666 +post_install_php_ldap()
   1.667 +{
   1.668  	grep -q ^extension=ldap.so "$1/etc/php.ini" ||
   1.669  	sed -e 's|extension=msql.so|extension=msql.so\nextension=ldap.so|' -i "$1/etc/php.ini"
   1.670  
   1.671 @@ -579,7 +643,8 @@
   1.672  EOT
   1.673  }
   1.674  
   1.675 -pre_remove_php_ldap() {
   1.676 +pre_remove_php_ldap()
   1.677 +{
   1.678  	sed -i '/.*=ldap.so.*/d' /etc/php.ini
   1.679  
   1.680  	# Start Web server.
   1.681 @@ -599,7 +664,8 @@
   1.682  }
   1.683  
   1.684  # -----------------------------------------------------------------------------
   1.685 -pre_install_php_mcrypt() {
   1.686 +pre_install_php_mcrypt()
   1.687 +{
   1.688  	while read daemon file; do
   1.689  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.690  			/etc/init.d/$daemon stop
   1.691 @@ -610,7 +676,8 @@
   1.692  EOT
   1.693  }
   1.694  
   1.695 -post_install_php_mcrypt() {
   1.696 +post_install_php_mcrypt()
   1.697 +{
   1.698  	grep -q ^extension=mcrypt.so "$1/etc/php.ini" ||
   1.699  	sed -e 's|extension=msql.so|extension=msql.so\nextension=mcrypt.so|' -i "$1/etc/php.ini"
   1.700  
   1.701 @@ -630,7 +697,8 @@
   1.702  EOT
   1.703  }
   1.704  
   1.705 -pre_remove_php_mcrypt() {
   1.706 +pre_remove_php_mcrypt()
   1.707 +{
   1.708  	sed -i '/.*=mcrypt.so.*/d' /etc/php.ini
   1.709  
   1.710  	# Start Web server.
   1.711 @@ -650,7 +718,8 @@
   1.712  }
   1.713  
   1.714  # -----------------------------------------------------------------------------
   1.715 -pre_install_php_mysqli() {
   1.716 +pre_install_php_mysqli()
   1.717 +{
   1.718  	while read daemon file; do
   1.719  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.720  			/etc/init.d/$daemon stop
   1.721 @@ -661,7 +730,8 @@
   1.722  EOT
   1.723  }
   1.724  
   1.725 -post_install_php_mysqli() {
   1.726 +post_install_php_mysqli()
   1.727 +{
   1.728  	grep -q ^extension=mysqli.so "$1/etc/php.ini" ||
   1.729  	sed -e 's|extension=msql.so|extension=msql.so\nextension=mysqli.so|' -i "$1/etc/php.ini"
   1.730  
   1.731 @@ -681,7 +751,8 @@
   1.732  EOT
   1.733  }
   1.734  
   1.735 -pre_remove_php_mysqli() {
   1.736 +pre_remove_php_mysqli()
   1.737 +{
   1.738  	sed -i '/.*=mysqli.so.*/d' /etc/php.ini
   1.739  
   1.740  	# Start Web server.
   1.741 @@ -701,7 +772,8 @@
   1.742  }
   1.743  
   1.744  # -----------------------------------------------------------------------------
   1.745 -pre_install_php_mysql() {
   1.746 +pre_install_php_mysql()
   1.747 +{
   1.748  	while read daemon file; do
   1.749  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.750  			/etc/init.d/$daemon stop
   1.751 @@ -712,7 +784,8 @@
   1.752  EOT
   1.753  }
   1.754  
   1.755 -post_install_php_mysql() {
   1.756 +post_install_php_mysql()
   1.757 +{
   1.758  	grep -q ^extension=mysql.so "$1/etc/php.ini" ||
   1.759  	sed -e 's|extension=msql.so|extension=msql.so\nextension=mysql.so|' -i "$1/etc/php.ini"
   1.760  
   1.761 @@ -732,7 +805,8 @@
   1.762  EOT
   1.763  }
   1.764  
   1.765 -pre_remove_php_mysql() {
   1.766 +pre_remove_php_mysql()
   1.767 +{
   1.768  	sed -i '/.*=mysql.so.*/d' /etc/php.ini
   1.769  
   1.770  	# Start Web server.
   1.771 @@ -752,7 +826,8 @@
   1.772  }
   1.773  
   1.774  # -----------------------------------------------------------------------------
   1.775 -pre_install_php_odbc() {
   1.776 +pre_install_php_odbc()
   1.777 +{
   1.778  	while read daemon file; do
   1.779  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.780  			/etc/init.d/$daemon stop
   1.781 @@ -763,7 +838,8 @@
   1.782  EOT
   1.783  }
   1.784  
   1.785 -post_install_php_odbc() {
   1.786 +post_install_php_odbc()
   1.787 +{
   1.788  	grep -q ^extension=odbc.so "$1/etc/php.ini" ||
   1.789  	sed -e 's|extension=msql.so|extension=msql.so\nextension=odbc.so|' -i "$1/etc/php.ini"
   1.790  
   1.791 @@ -783,7 +859,8 @@
   1.792  EOT
   1.793  }
   1.794  
   1.795 -pre_remove_php_odbc() {
   1.796 +pre_remove_php_odbc()
   1.797 +{
   1.798  	sed -i '/.*=odbc.so.*/d' /etc/php.ini
   1.799  
   1.800  	# Start Web server.
   1.801 @@ -803,7 +880,8 @@
   1.802  }
   1.803  
   1.804  # -----------------------------------------------------------------------------
   1.805 -pre_install_php_openssl() {
   1.806 +pre_install_php_openssl()
   1.807 +{
   1.808  	while read daemon file; do
   1.809  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.810  			/etc/init.d/$daemon stop
   1.811 @@ -814,7 +892,8 @@
   1.812  EOT
   1.813  }
   1.814  
   1.815 -post_install_php_openssl() {
   1.816 +post_install_php_openssl()
   1.817 +{
   1.818  	grep -q ^extension=openssl.so "$1/etc/php.ini" ||
   1.819  	sed -e 's|extension=msql.so|extension=msql.so\nextension=openssl.so|' -i "$1/etc/php.ini"
   1.820  
   1.821 @@ -834,7 +913,8 @@
   1.822  EOT
   1.823  }
   1.824  
   1.825 -pre_remove_php_openssl() {
   1.826 +pre_remove_php_openssl()
   1.827 +{
   1.828  	sed -i '/.*=openssl.so.*/d' /etc/php.ini
   1.829  
   1.830  	# Start Web server.
   1.831 @@ -865,7 +945,8 @@
   1.832  EOT
   1.833  }
   1.834  
   1.835 -post_install_pdo_mysql() {
   1.836 +post_install_pdo_mysql()
   1.837 +{
   1.838  	grep -q ^extension=pdo_mysql.so "$1/etc/php.ini" ||
   1.839  	sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_mysql.so|' -i "$1/etc/php.ini"
   1.840  
   1.841 @@ -885,7 +966,8 @@
   1.842  EOT
   1.843  }
   1.844  
   1.845 -pre_remove_pdo_mysql() {
   1.846 +pre_remove_pdo_mysql()
   1.847 +{
   1.848  	sed -i '/.*=pdo_mysql.so.*/d' /etc/php.ini
   1.849  
   1.850  	# Start Web server.
   1.851 @@ -905,7 +987,8 @@
   1.852  }
   1.853  
   1.854  # -----------------------------------------------------------------------------
   1.855 -pre_install_pdo_pgsql() {
   1.856 +pre_install_pdo_pgsql()
   1.857 +{
   1.858  	while read daemon file; do
   1.859  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.860  			/etc/init.d/$daemon stop
   1.861 @@ -916,7 +999,8 @@
   1.862  EOT
   1.863  }
   1.864  
   1.865 -post_install_pdo_pgsql() {
   1.866 +post_install_pdo_pgsql()
   1.867 +{
   1.868  	grep -q ^extension=pdo_pgsql.so "$1/etc/php.ini" ||
   1.869  	sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_pgsql.so|' -i "$1/etc/php.ini"
   1.870  
   1.871 @@ -936,7 +1020,8 @@
   1.872  EOT
   1.873  }
   1.874  
   1.875 -pre_remove_pdo_pgsql() {
   1.876 +pre_remove_pdo_pgsql()
   1.877 +{
   1.878  	sed -i '/.*=pdo_pgsql.so.*/d' /etc/php.ini
   1.879  
   1.880  	# Start Web server.
   1.881 @@ -956,7 +1041,8 @@
   1.882  }
   1.883  
   1.884  # -----------------------------------------------------------------------------
   1.885 -pre_install_php_pear() {
   1.886 +pre_install_php_pear()
   1.887 +{
   1.888  	while read daemon file; do
   1.889  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.890  			/etc/init.d/$daemon stop
   1.891 @@ -967,7 +1053,8 @@
   1.892  EOT
   1.893  }
   1.894  
   1.895 -post_install_php_pear() {
   1.896 +post_install_php_pear()
   1.897 +{
   1.898  	grep ^include_path "$1/etc/php.ini"
   1.899  	sed -i 's|/php/includes"|/php/includes"\ninclude_path = ".:/usr/share/php"|' "$1/etc/php.ini"
   1.900  	# Restart Web server.
   1.901 @@ -987,7 +1074,8 @@
   1.902  }
   1.903  
   1.904  # -----------------------------------------------------------------------------
   1.905 -pre_install_php_pgsql() {
   1.906 +pre_install_php_pgsql()
   1.907 +{
   1.908  	while read daemon file; do
   1.909  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.910  			/etc/init.d/$daemon stop
   1.911 @@ -998,7 +1086,8 @@
   1.912  EOT
   1.913  }
   1.914  
   1.915 -post_install_php_pgsql() {
   1.916 +post_install_php_pgsql()
   1.917 +{
   1.918  	grep -q ^extension=pgsql.so "$1/etc/php.ini" ||
   1.919  	sed -e 's|extension=msql.so|extension=msql.so\nextension=pgsql.so|' -i "$1/etc/php.ini"
   1.920  
   1.921 @@ -1018,7 +1107,8 @@
   1.922  EOT
   1.923  }
   1.924  
   1.925 -pre_remove_php_pgsql() {
   1.926 +pre_remove_php_pgsql()
   1.927 +{
   1.928  	sed -i '/.*=pgsql.so.*/d' /etc/php.ini
   1.929  
   1.930  	# Start Web server.
   1.931 @@ -1038,7 +1128,8 @@
   1.932  }
   1.933  
   1.934  # -----------------------------------------------------------------------------
   1.935 -pre_install_php_snmp() {
   1.936 +pre_install_php_snmp()
   1.937 +{
   1.938  	while read daemon file; do
   1.939  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.940  			/etc/init.d/$daemon stop
   1.941 @@ -1049,7 +1140,8 @@
   1.942  EOT
   1.943  }
   1.944  
   1.945 -post_install_php_snmp() {
   1.946 +post_install_php_snmp()
   1.947 +{
   1.948  	grep -q ^extension=snmp.so "$1/etc/php.ini" ||
   1.949  	sed -e 's|extension=msql.so|extension=msql.so\nextension=snmp.so|' -i "$1/etc/php.ini"
   1.950  
   1.951 @@ -1069,7 +1161,8 @@
   1.952  EOT
   1.953  }
   1.954  
   1.955 -pre_remove_php_snmp() {
   1.956 +pre_remove_php_snmp()
   1.957 +{
   1.958  	sed -i '/.*=snmp.so.*/d' /etc/php.ini
   1.959  
   1.960  	# Start Web server.
   1.961 @@ -1089,7 +1182,8 @@
   1.962  }
   1.963  
   1.964  # -----------------------------------------------------------------------------
   1.965 -pre_install_php_soap() {
   1.966 +pre_install_php_soap()
   1.967 +{
   1.968  	while read daemon file; do
   1.969  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.970  			/etc/init.d/$daemon stop
   1.971 @@ -1100,7 +1194,8 @@
   1.972  EOT
   1.973  }
   1.974  
   1.975 -post_install_php_soap() {
   1.976 +post_install_php_soap()
   1.977 +{
   1.978  	grep -q ^extension=soap.so "$1/etc/php.ini" ||
   1.979  	sed -e 's|extension=msql.so|extension=msql.so\nextension=soap.so|' -i "$1/etc/php.ini"
   1.980  
   1.981 @@ -1120,7 +1215,8 @@
   1.982  EOT
   1.983  }
   1.984  
   1.985 -pre_remove_php_soap() {
   1.986 +pre_remove_php_soap()
   1.987 +{
   1.988  	sed -i '/.*=soap.so.*/d' /etc/php.ini
   1.989  
   1.990  	# Start Web server.
   1.991 @@ -1140,7 +1236,8 @@
   1.992  }
   1.993  
   1.994  # -----------------------------------------------------------------------------
   1.995 -post_install_php_sqlite() {
   1.996 +post_install_php_sqlite()
   1.997 +{
   1.998  	grep -q ^extension=sqlite3.so "$1/etc/php.ini" ||
   1.999  	sed -e 's|extension=msql.so|extension=msql.so\nextension=sqlite3.so|' -i "$1/etc/php.ini"
  1.1000  
  1.1001 @@ -1160,7 +1257,8 @@
  1.1002  EOT
  1.1003  }
  1.1004  
  1.1005 -pre_remove_php_sqlite() {
  1.1006 +pre_remove_php_sqlite()
  1.1007 +{
  1.1008  	sed -i '/.*=sqlite3.so.*/d' /etc/php.ini
  1.1009  
  1.1010  	# Start Web server.