wok-next diff php/receipt @ rev 20607

perdition: up 2.2
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Apr 19 15:57:59 2018 +0300 (2018-04-19)
parents d43bf7aae921
children d5aab818505e
line diff
     1.1 --- a/php/receipt	Wed Mar 21 15:58:17 2018 +0200
     1.2 +++ b/php/receipt	Thu Apr 19 15:57:59 2018 +0300
     1.3 @@ -3,13 +3,15 @@
     1.4  PACKAGE="php"
     1.5  VERSION="5.5.13"
     1.6  CATEGORY="development"
     1.7 -SHORT_DESC="PHP web programming language."
     1.8 +SHORT_DESC="PHP web programming language"
     1.9  MAINTAINER="pankso@slitaz.org"
    1.10  LICENSE="BSD"
    1.11 +WEB_SITE="http://www.php.net/"
    1.12 +
    1.13  TARBALL="$PACKAGE-$VERSION.tar.bz2"
    1.14 -WEB_SITE="http://www.php.net/"
    1.15  WGET_URL="http://www.php.net/distributions/$TARBALL"
    1.16  
    1.17 +BUILD_DEPENDS_arm="sqlite3-dev libxml2-dev zlib-dev curl-dev"
    1.18  BUILD_DEPENDS="sqlite3-dev libxml2-dev zlib-dev libmysqlclient mysql-dev \
    1.19  net-snmp-dev postgresql-dev gettext openssl-dev apache-dev apr-util-dev \
    1.20  c-client mhash-dev libpng16-dev libunixODBC unixODBC-dev openldap-dev \
    1.21 @@ -19,13 +21,37 @@
    1.22  php-gd php-imap php-ldap php-mcrypt php-mysqli php-mysql php-odbc php-openssl \
    1.23  php-pdo-mysql php-pdo-pgsql php-pear php-pgsql php-snmp php-soap php-sqlite"
    1.24  
    1.25 -case "$ARCH" in
    1.26 -	i?86)
    1.27 -		ARCH_ARGS="\
    1.28 +
    1.29 +compile_rules() {
    1.30 +	case "$ARCH" in
    1.31 +		arm*)
    1.32 +			ARCH_ARGS="\
    1.33  			--prefix=/usr \
    1.34  			--sysconfdir=/etc \
    1.35  			--infodir=/usr/share/info \
    1.36  			--mandir=/usr/share/man \
    1.37 +			--config-cache \
    1.38 +			--enable-mbstring \
    1.39 +			--enable-sockets \
    1.40 +			--enable-ftp \
    1.41 +			--enable-zip \
    1.42 +			--enable-calendar \
    1.43 +			--enable-exif \
    1.44 +			--enable-dba=shared \
    1.45 +			--enable-sqlite-utf8 \
    1.46 +			--with-mhash \
    1.47 +			--with-sqlite=shared \
    1.48 +			--with-config-file-path=/etc \
    1.49 +			--with-zlib \
    1.50 +			--with-gettext \
    1.51 +			--with-curl=shared \
    1.52 +			--with-openssl=shared \
    1.53 +			--with-jpeg-dir=/usr \
    1.54 +			--with-png-dir=/usr \
    1.55 +			--with-apxs2=/usr/bin/apxs"
    1.56 +			;;
    1.57 +		*)
    1.58 +			ARCH_ARGS="\
    1.59  			--enable-mbstring \
    1.60  			--enable-sockets \
    1.61  			--enable-ftp \
    1.62 @@ -60,267 +86,221 @@
    1.63  			--with-pdo-pgsql=shared \
    1.64  			--with-curl=shared \
    1.65  			--with-sqlite3=shared,/usr \
    1.66 -			--enable-maintainer-zts" ;;
    1.67 -	arm*)
    1.68 -		BUILD_DEPENDS="sqlite3-dev libxml2-dev zlib-dev curl-dev"
    1.69 -		ARCH_ARGS="\
    1.70 -			--prefix=/usr \
    1.71 -			--sysconfdir=/etc \
    1.72 -			--infodir=/usr/share/info \
    1.73 -			--mandir=/usr/share/man \
    1.74 -			--config-cache \
    1.75 -			--enable-mbstring \
    1.76 -			--enable-sockets \
    1.77 -			--enable-ftp \
    1.78 -			--enable-zip \
    1.79 -			--enable-calendar \
    1.80 -			--enable-exif \
    1.81 -			--enable-dba=shared \
    1.82 -			--enable-sqlite-utf8 \
    1.83 -			--with-mhash \
    1.84 -			--with-sqlite=shared \
    1.85 -			--with-config-file-path=/etc \
    1.86 -			--with-zlib \
    1.87 -			--with-gettext \
    1.88 -			--with-curl=shared \
    1.89 -			--with-openssl=shared \
    1.90 -			--with-jpeg-dir=/usr \
    1.91 -			--with-png-dir=/usr \
    1.92 -			--with-apxs2=/usr/bin/apxs" ;;
    1.93 -esac
    1.94 +			--enable-maintainer-zts"
    1.95 +			;;
    1.96 +	esac
    1.97  
    1.98 -# Rules to configure and make the package.
    1.99 -compile_rules()
   1.100 -{
   1.101  	sed -i 's|PLANE_[UVY]\]|VPX_&|;s|IMG_FMT_I420|VPX_&|' ext/gd/libgd/webpimg.c
   1.102  	sed -i 's/pam_start/pam_nostart/' configure
   1.103 -	./configure $ARCH_ARGS $CONFIGURE_ARGS && \
   1.104 -	make $MAKEFLAGS && make -j1 INSTALL_ROOT=$DESTDIR install
   1.105 -	./configure $ARCH_ARGS $CONFIGURE_ARGS --with-apxs2=/usr/bin/apxs && \
   1.106 -	make $MAKEFLAGS && {
   1.107 -		mkdir -p $DESTDIR/etc/apache
   1.108 -		cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
   1.109 -		make -j1 INSTALL_ROOT=$DESTDIR install
   1.110 -	}
   1.111 +
   1.112 +	./configure \
   1.113 +		$ARCH_ARGS \
   1.114 +		$CONFIGURE_ARGS &&
   1.115 +	make $MAKEFLAGS &&
   1.116 +	make -j1 INSTALL_ROOT=$DESTDIR install
   1.117 +
   1.118 +	./configure \
   1.119 +		$ARCH_ARGS \
   1.120 +		$CONFIGURE_ARGS \
   1.121 +		--with-apxs2=/usr/bin/apxs &&
   1.122 +	make $MAKEFLAGS &&
   1.123 +	mkdir -p $DESTDIR/etc/apache &&
   1.124 +	cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf &&
   1.125 +	make -j1 INSTALL_ROOT=$DESTDIR install || return 1
   1.126 +
   1.127  	# Production config file.
   1.128  	mkdir -p $DESTDIR/etc
   1.129  	cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
   1.130  	sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
   1.131  		-i $DESTDIR/etc/php.ini
   1.132 +
   1.133 +	install -Dm755 $src/sapi/cgi/php-cgi    $install/usr/bin/php-cgi
   1.134 +
   1.135 +	install -Dm644 $stuff/phpinfo/index.php $install/usr/share/phpinfo/index.php
   1.136 +	install -Dm644 $stuff/php.desktop       $install/usr/share/applications/php.desktop
   1.137 +	install -Dm644 $stuff/php.png           $install/usr/share/pixmaps/php.png
   1.138  }
   1.139  
   1.140 -# Rules to gen a SliTaz package suitable for Tazpkg.
   1.141 -genpkg_rules()
   1.142 -{
   1.143 +genpkg_rules() {
   1.144  	case $PACKAGE in
   1.145 -	php)
   1.146 -		PROVIDE="php:lighttpd"
   1.147 -		DEPENDS="php-common lighttpd zlib libxml2 sqlite3 openssl"
   1.148 -		mkdir -p $fs/usr/bin $fs/usr/share/php
   1.149 -		cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
   1.150 -		;;
   1.151 -	php-apache)
   1.152 -		CAT="development|PHP module for apache."
   1.153 -		PROVIDE="php:apache"
   1.154 -		DEPENDS="php-common apache libxml2 zlib"
   1.155 -		mkdir -p $fs/usr/share
   1.156 -		cp -a $install/usr/share/apache $fs/usr/share
   1.157 -		;;
   1.158 -	php-cherokee)
   1.159 -		CAT="development|PHP module for cherokee."
   1.160 -		PROVIDE="php:cherokee"
   1.161 -		DEPENDS="php-common cherokee libxml2 zlib"
   1.162 -		mkdir -p $fs/usr/bin $fs/usr/share/php
   1.163 -		cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
   1.164 -		;;
   1.165 -	php-cli)
   1.166 -		CAT="development|PHP web programming language command line interpreter."
   1.167 -		DEPENDS="php-common"
   1.168 -		mkdir -p $fs/usr/bin
   1.169 -		cp -a $install/usr/bin/php $fs/usr/bin
   1.170 -		;;
   1.171 -	php-common)
   1.172 -		CAT="development|Common files for PHP modules."
   1.173 -		CONFIG_FILES="/etc/php.ini"
   1.174 -		mkdir -p $fs/etc \
   1.175 -			$fs/usr/share/applications \
   1.176 -			$fs/usr/share/pixmaps
   1.177 -		cp -a $stuff/phpinfo $fs/usr/share
   1.178 -		cp $stuff/php.desktop $fs/usr/share/applications 
   1.179 -		cp $stuff/php.png $fs/usr/share/pixmaps 
   1.180 -		cp $install/etc/php.ini $fs/etc
   1.181 -		;;
   1.182 -	php-curl)
   1.183 -		CAT="development|curl module for PHP web programming language."
   1.184 -		DEPENDS="curl php"
   1.185 -		mkdir -p $fs/usr/share/php
   1.186 -		cp $(find $install | grep curl.so) $fs/usr/share/php/
   1.187 -		;;
   1.188 -	php-dba)
   1.189 -		CAT="development|dba module for PHP web programming language."
   1.190 -		mkdir -p $fs/usr/share/php
   1.191 -		cp $(find $install | grep dba.so) $fs/usr/share/php/
   1.192 -		;;
   1.193 -	php-dev)
   1.194 -		CAT="development|PHP web programming language development files."
   1.195 -		DEPENDS="php cyrus-sasl libldap libmysqlclient libpng16 \
   1.196 +		php)
   1.197 +			copy usr/bin/php-cgi
   1.198 +			DEPENDS="php-common lighttpd zlib libxml2 sqlite3 openssl"
   1.199 +			PROVIDE="php:lighttpd"
   1.200 +			;;
   1.201 +		php-apache)
   1.202 +			copy usr/share/apache/
   1.203 +			CAT="development|module for apache"
   1.204 +			DEPENDS="php-common apache libxml2 zlib"
   1.205 +			PROVIDE="php:apache"
   1.206 +			;;
   1.207 +		php-cherokee)
   1.208 +			copy usr/bin/php-cgi # FIXME! the same file in "php" package
   1.209 +			CAT="development|module for cherokee"
   1.210 +			DEPENDS="php-common cherokee libxml2 zlib"
   1.211 +			PROVIDE="php:cherokee"
   1.212 +			;;
   1.213 +		php-cli)
   1.214 +			copy usr/bin/php
   1.215 +			CAT="development|command line interpreter"
   1.216 +			DEPENDS="php-common"
   1.217 +			;;
   1.218 +		php-common)
   1.219 +			copy phpinfo/ php.desktop php.png php.ini
   1.220 +			CAT="development|common files for PHP modules"
   1.221 +			DEPENDS=" "
   1.222 +			CONFIG_FILES="/etc/php.ini"
   1.223 +			;;
   1.224 +		php-curl)
   1.225 +			copy curl.so
   1.226 +			CAT="development|curl module"
   1.227 +			DEPENDS="curl php"
   1.228 +			;;
   1.229 +		php-dba)
   1.230 +			copy dba.so
   1.231 +			CAT="development|dba module"
   1.232 +			DEPENDS=" "
   1.233 +			;;
   1.234 +		php-dev)
   1.235 +			copy @dev
   1.236 +			DEPENDS="php cyrus-sasl libldap libmysqlclient libpng16 \
   1.237  			libpostgresqlclient libunixODBC mhash openssl jpeg \
   1.238  			libmcrypt libtool libkrb5 libcomerr3 net-snmp"
   1.239 -		mkdir -p $fs/usr/lib/php $fs/usr/bin
   1.240 -		cp -a $install/usr/lib/php/extensions $fs/usr/lib/php
   1.241 -		rm -f $fs/usr/lib/php/*so
   1.242 -		cp -a $install/usr/lib/php/build $fs/usr/lib/php
   1.243 -		cp -a $install/usr/include $fs/usr
   1.244 -		cp -a $install/usr/bin/php-config $install/usr/bin/phpize $fs/usr/bin
   1.245 -		;;
   1.246 -	php-gd)
   1.247 -		CAT="development|gd module for PHP web programming language."
   1.248 -		DEPENDS="libpng16 php jpeg libvpx"
   1.249 -		mkdir -p $fs/usr/share/php
   1.250 -		cp $(find $install | grep gd.so) $fs/usr/share/php/
   1.251 -		;;
   1.252 -	php-imap)
   1.253 -		CAT="development|imap module for PHP web programming language."
   1.254 -		DEPENDS="php openssl"
   1.255 -		mkdir -p $fs/usr/share/php
   1.256 -		cp $(find $install | grep imap.so) $fs/usr/share/php/
   1.257 -		;;
   1.258 -	php-ldap)
   1.259 -		CAT="development|ldap module for PHP web programming language."
   1.260 -		DEPENDS="libldap php openssl cyrus-sasl libkrb5 libcomerr3"
   1.261 -		mkdir -p $fs/usr/share/php
   1.262 -		cp $(find $install | grep ldap.so) $fs/usr/share/php/
   1.263 -		;;
   1.264 -	php-mcrypt)
   1.265 -		CAT="development|mcrypt module for PHP web programming language."
   1.266 -		DEPENDS="libmcrypt php libtool"
   1.267 -		mkdir -p $fs/usr/share/php
   1.268 -		cp $(find $install | grep mcrypt.so) $fs/usr/share/php/
   1.269 -		;;
   1.270 -	php-mysqli)
   1.271 -		CAT="development|mysqli module for PHP web programming language."
   1.272 -		DEPENDS="libmysqlclient php"
   1.273 -		mkdir -p $fs/usr/share/php
   1.274 -		cp $(find $install | grep mysqli.so) $fs/usr/share/php/
   1.275 -		;;
   1.276 -	php-mysql)
   1.277 -		CAT="development|mysql module for PHP web programming language."
   1.278 -		DEPENDS="libmysqlclient php"
   1.279 -		mkdir -p $fs/usr/share/php
   1.280 -		cp $(find $install | grep mysql.so) $fs/usr/share/php/
   1.281 -		;;
   1.282 -	php-odbc)
   1.283 -		CAT="development|ODBC module for PHP web programming language."
   1.284 -		DEPENDS="unixODBC php"
   1.285 -		mkdir -p $fs/usr/share/php
   1.286 -		cp $(find $install | grep odbc.so) $fs/usr/share/php/
   1.287 -		;;
   1.288 -	php-openssl)
   1.289 -		CAT="development|Openssl module for PHP web programming language."
   1.290 -		DEPENDS="php openssl"
   1.291 -		mkdir -p $fs/usr/share/php
   1.292 -		cp $(find $install | grep openssl.so) $fs/usr/share/php/
   1.293 -		;;
   1.294 -	php-pdo-mysql)
   1.295 -		CAT="development|PDO MySQL module for PHP web programming language."
   1.296 -		DEPENDS="php php-mysql"
   1.297 -		mkdir -p $fs/usr/share/php
   1.298 -		cp $(find $install | grep pdo_mysql.so) $fs/usr/share/php/
   1.299 -		;;
   1.300 -	php-pdo-pgsql)
   1.301 -		CAT="development|PDO PgSQL module for PHP web programming language."
   1.302 -		DEPENDS="php php-mysql libpostgresqlclient"
   1.303 -		mkdir -p $fs/usr/share/php
   1.304 -		cp $(find $install | grep pdo_pgsql.so) $fs/usr/share/php/
   1.305 -		;;
   1.306 -	php-pear)
   1.307 -		CAT="development|PHP web programming language pear libs."
   1.308 -		DEPENDS="php-cli"
   1.309 -	        mkdir -p $fs/usr/share $fs/usr/bin $fs/etc
   1.310 -		cp -a $install/usr/share/php $fs/usr/share
   1.311 -		cp -a $install/etc/pear.conf $fs/etc
   1.312 -		cp -a $install/usr/bin/pe* $fs/usr/bin
   1.313 -		;;
   1.314 -	php-pgsql)
   1.315 -		CAT="development|postgresql module for PHP web programming language."
   1.316 -		DEPENDS="postgresql php"
   1.317 -		mkdir -p $fs/usr/share/php
   1.318 -		cp $(find $install | grep pgsql.so) $fs/usr/share/php/
   1.319 -		;;
   1.320 -	php-snmp)
   1.321 -		CAT="development|snmp module for PHP web programming language."
   1.322 -		DEPENDS="net-snmp php openssl"
   1.323 -		mkdir -p $fs/usr/share/php
   1.324 -		cp $(find $install | grep snmp.so) $fs/usr/share/php/
   1.325 -		;;
   1.326 -	php-soap)
   1.327 -		CAT="development|soap module for PHP web programming language."
   1.328 -		DEPENDS="php libxml2"
   1.329 -		mkdir -p $fs/usr/share/php
   1.330 -		cp $(find $install | grep soap.so) $fs/usr/share/php/
   1.331 -		;;
   1.332 -	php-sqlite)
   1.333 -		CAT="development|sqlite module for PHP web programming language."
   1.334 -		DEPENDS="php sqlite3"
   1.335 -		mkdir -p $fs/usr/share/php
   1.336 -		cp $(find $install | grep sqlite.so) $fs/usr/share/php/
   1.337 -		cp $(find $install | grep sqlite3.so) $fs/usr/share/php/
   1.338 -		cp $(find $install | grep pdo_sqlite.so) $fs/usr/share/php/
   1.339 -		;;
   1.340 +			;;
   1.341 +		php-gd)
   1.342 +			copy gd.so
   1.343 +			CAT="development|gd module"
   1.344 +			DEPENDS="libpng16 php jpeg libvpx"
   1.345 +			;;
   1.346 +		php-imap)
   1.347 +			copy imap.so
   1.348 +			CAT="development|imap module"
   1.349 +			DEPENDS="php openssl"
   1.350 +			;;
   1.351 +		php-ldap)
   1.352 +			copy ldap.so
   1.353 +			CAT="development|ldap module"
   1.354 +			DEPENDS="libldap php openssl cyrus-sasl libkrb5 libcomerr3"
   1.355 +			;;
   1.356 +		php-mcrypt)
   1.357 +			copy mcrypt.so
   1.358 +			CAT="development|mcrypt module"
   1.359 +			DEPENDS="libmcrypt php libtool"
   1.360 +			;;
   1.361 +		php-mysqli)
   1.362 +			copy mysqli.so
   1.363 +			CAT="development|mysqli module"
   1.364 +			DEPENDS="libmysqlclient php"
   1.365 +			;;
   1.366 +		php-mysql)
   1.367 +			copy mysql.so
   1.368 +			CAT="development|mysql module"
   1.369 +			DEPENDS="libmysqlclient php"
   1.370 +			;;
   1.371 +		php-odbc)
   1.372 +			copy odbc.so
   1.373 +			CAT="development|ODBC module"
   1.374 +			DEPENDS="unixODBC php"
   1.375 +			;;
   1.376 +		php-openssl)
   1.377 +			copy openssl.so
   1.378 +			CAT="development|OpenSSL module"
   1.379 +			DEPENDS="php openssl"
   1.380 +			;;
   1.381 +		php-pdo-mysql)
   1.382 +			copy pdo_mysql.so
   1.383 +			CAT="development|PDO MySQL module"
   1.384 +			DEPENDS="php php-mysql"
   1.385 +			;;
   1.386 +		php-pdo-pgsql)
   1.387 +			copy pdo_pgsql.so
   1.388 +			CAT="development|PDO PgSQL module"
   1.389 +			DEPENDS="php php-mysql libpostgresqlclient"
   1.390 +			;;
   1.391 +		php-pear)
   1.392 +			copy etc/pear.conf usr/bin/pe* usr/share/php/
   1.393 +			CAT="development|PEAR libs"
   1.394 +			DEPENDS="php-cli"
   1.395 +			;;
   1.396 +		php-pgsql)
   1.397 +			copy pgsql.so
   1.398 +			CAT="development|postgresql module"
   1.399 +			DEPENDS="postgresql php"
   1.400 +			;;
   1.401 +		php-snmp)
   1.402 +			copy snmp.so
   1.403 +			CAT="development|snmp module"
   1.404 +			DEPENDS="net-snmp php openssl"
   1.405 +			;;
   1.406 +		php-soap)
   1.407 +			copy soap.so
   1.408 +			CAT="development|soap module"
   1.409 +			DEPENDS="php libxml2"
   1.410 +			;;
   1.411 +		php-sqlite)
   1.412 +			copy sqlite.so sqlite3.so pdo_sqlite.so
   1.413 +			CAT="development|sqlite module"
   1.414 +			DEPENDS="php sqlite3"
   1.415 +			;;
   1.416  	esac
   1.417  }
   1.418  
   1.419 -# Post and pre install commands to stop
   1.420 -# and restart Web server if needed.
   1.421 -pre_install_php()
   1.422 -{
   1.423 +# -----------------------------------------------------------------------------
   1.424 +pre_install_php() {
   1.425  	if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
   1.426  		/etc/init.d/lighttpd stop
   1.427  	fi
   1.428  }
   1.429  
   1.430 -post_install_php()
   1.431 -{
   1.432 +post_install_php() {
   1.433  	# Enable php
   1.434  	if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
   1.435 -	  [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] || \
   1.436 -	  	tazpkg get-install lighttpd-modules --root="$1/"
   1.437 -	  sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
   1.438 -	    -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
   1.439 -	    -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n  )))|' \
   1.440 -	    -i "$1/etc/lighttpd/lighttpd.conf"
   1.441 -	  grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" || \
   1.442 -	  	sed -e 's|server.modules = (|server.modules = (\n  "mod_fastcgi",|' \
   1.443 -	  	    -i "$1/etc/lighttpd/lighttpd.conf"
   1.444 -	  grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
   1.445 -	  	sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
   1.446 -	  	    -i "$1/etc/lighttpd/lighttpd.conf"
   1.447 +
   1.448 +		[ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] ||
   1.449 +		tazpkg get-install lighttpd-modules --root="$1/"
   1.450 +
   1.451 +		sed \
   1.452 +			-e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
   1.453 +			-e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
   1.454 +			-e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n  )))|' \
   1.455 +			-i "$1/etc/lighttpd/lighttpd.conf"
   1.456 +
   1.457 +		grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" ||
   1.458 +		sed \
   1.459 +			-e 's|server.modules = (|server.modules = (\n  "mod_fastcgi",|' \
   1.460 +			-i "$1/etc/lighttpd/lighttpd.conf"
   1.461 +
   1.462 +		grep -q php3 "$1/etc/lighttpd/lighttpd.conf" ||
   1.463 +		sed \
   1.464 +			-e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
   1.465 +			-i "$1/etc/lighttpd/lighttpd.conf"
   1.466 +
   1.467  	fi
   1.468 +
   1.469  	# Start Web server.
   1.470 -	if [ -z "$1" -a ! -f /var/run/lighttpd.pid \
   1.471 -		     -a -f /etc/init.d/lighttpd ]; then
   1.472 +	if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]; then
   1.473  		/etc/init.d/lighttpd start
   1.474  	fi
   1.475  }
   1.476  
   1.477 -# Post and pre install commans to stop
   1.478 -# and restart Web server if needed.
   1.479 -pre_installi_php_apache()
   1.480 -{
   1.481 +# -----------------------------------------------------------------------------
   1.482 +pre_installi_php_apache() {
   1.483  	if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
   1.484  		/etc/init.d/apache stop
   1.485  	fi
   1.486  }
   1.487  
   1.488 -post_install_php_apache()
   1.489 -{
   1.490 -	grep -q php5_module "$1/etc/apache/httpd.conf" || {
   1.491 -	    sed -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php5_module share/apache/modules/libphp5.so|' \
   1.492 -	    	-e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \
   1.493 -		-e 's|mime.types|mime.types\n    AddType application/x-httpd-php .php .php3 .php4 .php5\n    AddType application/x-httpd-php-source .phps|' \
   1.494 -	        -i "$1/etc/apache/httpd.conf"
   1.495 +post_install_php_apache() {
   1.496 +	grep -q php5_module "$1/etc/apache/httpd.conf" ||
   1.497 +	{
   1.498 +		sed \
   1.499 +			-e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php5_module share/apache/modules/libphp5.so|' \
   1.500 +			-e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \
   1.501 +			-e 's|mime.types|mime.types\n    AddType application/x-httpd-php .php .php3 .php4 .php5\n    AddType application/x-httpd-php-source .phps|' \
   1.502 +			-i "$1/etc/apache/httpd.conf"
   1.503  	}
   1.504 -	[ -f "$1/etc/apache/conf.d/phpinfo" ] || \
   1.505 +
   1.506 +	[ -f "$1/etc/apache/conf.d/phpinfo" ] ||
   1.507  		cat > "$1/etc/apache/conf.d/phpinfo" <<EOT
   1.508  <IfModule mod_alias.c>
   1.509      Alias /phpinfo /usr/share/phpinfo
   1.510 @@ -333,6 +313,7 @@
   1.511      Allow from all
   1.512  </DirectoryMatch>
   1.513  EOT
   1.514 +
   1.515  	# Restart Web server.
   1.516  	if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
   1.517  		/etc/init.d/apache stop
   1.518 @@ -343,17 +324,14 @@
   1.519  	fi
   1.520  }
   1.521  
   1.522 -# Post and pre install commands to stop
   1.523 -# and restart Web server if needed.
   1.524 -pre_install_php_cherokee()
   1.525 -{
   1.526 +# -----------------------------------------------------------------------------
   1.527 +pre_install_php_cherokee() {
   1.528  	if [ -z "$1" -a ! -f "/var/run/cherokee.pid" ]; then
   1.529  		/etc/init.d/cherokee stop
   1.530  	fi
   1.531  }
   1.532  
   1.533 -post_install_php_cherokee()
   1.534 -{
   1.535 +post_install_php_cherokee() {
   1.536  	# Enable php
   1.537  #	if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
   1.538  #	  [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] || \
   1.539 @@ -370,52 +348,43 @@
   1.540  #	  	    -i "$1/etc/lighttpd/lighttpd.conf"
   1.541  #	fi
   1.542  
   1.543 -
   1.544  	# Start Web server.
   1.545 -	if [ -z "$1" -a ! -f /var/run/cherokee.pid \
   1.546 -		     -a -f /etc/init.d/cherokee ]; then
   1.547 +	if [ -z "$1" -a ! -f /var/run/cherokee.pid -a -f /etc/init.d/cherokee ]; then
   1.548  		/etc/init.d/cherokee start
   1.549  	fi
   1.550  }
   1.551  
   1.552 -# Post and pre install commands
   1.553 -pre_install_php_common()
   1.554 -{
   1.555 +# -----------------------------------------------------------------------------
   1.556 +pre_install_php_common() {
   1.557  	# Backup existing php.ini
   1.558  	if [ -f "$1/etc/php.ini" ]; then
   1.559 -		echo -n "Creating php.ini backup..."
   1.560  		cp "$1/etc/php.ini" "$1/etc/php.ini.bak"
   1.561 -		status
   1.562 -	fi
   1.563 -}
   1.564 -post_install_php_common()
   1.565 -{
   1.566 -	# Restore original php.ini
   1.567 -	if [ -f "$1/etc/php.ini.bak" ]; then
   1.568 -		echo -n "Restoring php.ini backup..."
   1.569 -		mv -f "$1/etc/php.ini.bak" "$1/etc/php.ini"
   1.570 -		status
   1.571  	fi
   1.572  }
   1.573  
   1.574 -# Post and pre install commans to stop
   1.575 -# and restart Web server if needed.
   1.576 -pre_install_php_curl()
   1.577 -{
   1.578 +post_install_php_common() {
   1.579 +	# Restore original php.ini
   1.580 +	if [ -f "$1/etc/php.ini.bak" ]; then
   1.581 +		mv -f "$1/etc/php.ini.bak" "$1/etc/php.ini"
   1.582 +	fi
   1.583 +}
   1.584 +
   1.585 +# -----------------------------------------------------------------------------
   1.586 +pre_install_php_curl() {
   1.587  	while read daemon file; do
   1.588  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.589  			/etc/init.d/$daemon stop
   1.590  		fi
   1.591  	done <<EOT
   1.592 -apache apache/httpd.pid
   1.593 +apache   apache/httpd.pid
   1.594  lighttpd lighttpd.pid
   1.595  EOT
   1.596  }
   1.597  
   1.598 -post_install_php_curl()
   1.599 -{
   1.600 -	grep -q ^extension=curl.so "$1/etc/php.ini" || \
   1.601 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=curl.so|' -i "$1/etc/php.ini"
   1.602 +post_install_php_curl() {
   1.603 +	grep -q ^extension=curl.so "$1/etc/php.ini" ||
   1.604 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=curl.so|' -i "$1/etc/php.ini"
   1.605 +
   1.606  	# Start Web server.
   1.607  	while read daemon file; do
   1.608  		[ -z "$1" ] || continue
   1.609 @@ -427,14 +396,12 @@
   1.610  			/etc/init.d/$daemon start
   1.611  		fi
   1.612  	done <<EOT
   1.613 -apache apache/httpd.pid
   1.614 +apache   apache/httpd.pid
   1.615  lighttpd lighttpd.pid
   1.616  EOT
   1.617  }
   1.618  
   1.619 -# Pre and post remove commands for Tazpkg.
   1.620 -pre_remove_php_curl()
   1.621 -{
   1.622 +pre_remove_php_curl() {
   1.623  	sed -i '/.*=curl.so.*/d' /etc/php.ini
   1.624  
   1.625  	# Start Web server.
   1.626 @@ -448,29 +415,27 @@
   1.627  			/etc/init.d/$daemon start
   1.628  		fi
   1.629  	done <<EOT
   1.630 -apache apache/httpd.pid
   1.631 +apache   apache/httpd.pid
   1.632  lighttpd lighttpd.pid
   1.633  EOT
   1.634  }
   1.635  
   1.636 -# Post and pre install commans to stop
   1.637 -# and restart Web server if needed.
   1.638 -pre_install_php_dba()
   1.639 -{
   1.640 +# -----------------------------------------------------------------------------
   1.641 +pre_install_php_dba() {
   1.642  	while read daemon file; do
   1.643  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.644  			/etc/init.d/$daemon stop
   1.645  		fi
   1.646  	done <<EOT
   1.647 -apache apache/httpd.pid
   1.648 +apache   apache/httpd.pid
   1.649  lighttpd lighttpd.pid
   1.650  EOT
   1.651  }
   1.652  
   1.653 -post_install_php_dba()
   1.654 -{
   1.655 -	grep -q ^extension=dba.so "$1/etc/php.ini" || \
   1.656 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=dba.so|' -i "$1/etc/php.ini"
   1.657 +post_install_php_dba() {
   1.658 +	grep -q ^extension=dba.so "$1/etc/php.ini" ||
   1.659 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=dba.so|' -i "$1/etc/php.ini"
   1.660 +
   1.661  	# Start Web server.
   1.662  	while read daemon file; do
   1.663  		[ -z "$1" ] || continue
   1.664 @@ -482,14 +447,12 @@
   1.665  			/etc/init.d/$daemon start
   1.666  		fi
   1.667  	done <<EOT
   1.668 -apache apache/httpd.pid
   1.669 +apache   apache/httpd.pid
   1.670  lighttpd lighttpd.pid
   1.671  EOT
   1.672  }
   1.673  
   1.674 -# Pre and post remove commands for Tazpkg.
   1.675 -pre_remove_php_dba()
   1.676 -{
   1.677 +pre_remove_php_dba() {
   1.678  	sed -i '/.*=dba.so.*/d' /etc/php.ini
   1.679  
   1.680  	# Start Web server.
   1.681 @@ -503,29 +466,27 @@
   1.682  			/etc/init.d/$daemon start
   1.683  		fi
   1.684  	done <<EOT
   1.685 -apache apache/httpd.pid
   1.686 +apache   apache/httpd.pid
   1.687  lighttpd lighttpd.pid
   1.688  EOT
   1.689  }
   1.690  
   1.691 -# Post and pre install commans to stop
   1.692 -# and restart Web server if needed.
   1.693 -pre_install_php_gd()
   1.694 -{
   1.695 +# -----------------------------------------------------------------------------
   1.696 +pre_install_php_gd() {
   1.697  	while read daemon file; do
   1.698  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.699  			/etc/init.d/$daemon stop
   1.700  		fi
   1.701  	done <<EOT
   1.702 -apache apache/httpd.pid
   1.703 +apache   apache/httpd.pid
   1.704  lighttpd lighttpd.pid
   1.705  EOT
   1.706  }
   1.707  
   1.708 -post_install_php_gd()
   1.709 -{
   1.710 -	grep -q ^extension=gd.so "$1/etc/php.ini" || \
   1.711 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=gd.so|' -i "$1/etc/php.ini"
   1.712 +post_install_php_gd() {
   1.713 +	grep -q ^extension=gd.so "$1/etc/php.ini" ||
   1.714 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=gd.so|' -i "$1/etc/php.ini"
   1.715 +
   1.716  	# Start Web server.
   1.717  	while read daemon file; do
   1.718  		[ -z "$1" ] || continue
   1.719 @@ -537,14 +498,12 @@
   1.720  			/etc/init.d/$daemon start
   1.721  		fi
   1.722  	done <<EOT
   1.723 -apache apache/httpd.pid
   1.724 +apache   apache/httpd.pid
   1.725  lighttpd lighttpd.pid
   1.726  EOT
   1.727  }
   1.728  
   1.729 -# Pre and post remove commands for Tazpkg.
   1.730 -pre_remove_php_gd()
   1.731 -{
   1.732 +pre_remove_php_gd() {
   1.733  	sed -i '/.*=gd.so.*/d' "$1/etc/php.ini"
   1.734  
   1.735  	# Start Web server.
   1.736 @@ -560,29 +519,27 @@
   1.737  			fi
   1.738  		fi
   1.739  	done <<EOT
   1.740 -apache apache/httpd.pid
   1.741 +apache   apache/httpd.pid
   1.742  lighttpd lighttpd.pid
   1.743  EOT
   1.744  }
   1.745  
   1.746 -# Post and pre install commans to stop
   1.747 -# and restart Web server if needed.
   1.748 -pre_install_php_imap()
   1.749 -{
   1.750 +# -----------------------------------------------------------------------------
   1.751 +pre_install_php_imap() {
   1.752  	while read daemon file; do
   1.753  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.754  			/etc/init.d/$daemon stop
   1.755  		fi
   1.756  	done <<EOT
   1.757 -apache apache/httpd.pid
   1.758 +apache   apache/httpd.pid
   1.759  lighttpd lighttpd.pid
   1.760  EOT
   1.761  }
   1.762  
   1.763 -post_install_php_imap()
   1.764 -{
   1.765 -	grep -q ^extension=imap.so "$1/etc/php.ini" || \
   1.766 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=imap.so|' -i "$1/etc/php.ini"
   1.767 +post_install_php_imap() {
   1.768 +	grep -q ^extension=imap.so "$1/etc/php.ini" ||
   1.769 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=imap.so|' -i "$1/etc/php.ini"
   1.770 +
   1.771  	# Start Web server.
   1.772  	while read daemon file; do
   1.773  		[ -z "$1" ] || continue
   1.774 @@ -594,14 +551,12 @@
   1.775  			/etc/init.d/$daemon start
   1.776  		fi
   1.777  	done <<EOT
   1.778 -apache apache/httpd.pid
   1.779 +apache   apache/httpd.pid
   1.780  lighttpd lighttpd.pid
   1.781  EOT
   1.782  }
   1.783  
   1.784 -# Pre and post remove commands for Tazpkg.
   1.785 -pre_remove_php_imap()
   1.786 -{
   1.787 +pre_remove_php_imap() {
   1.788  	sed -i '/.*=imap.so.*/d' /etc/php.ini
   1.789  
   1.790  	# Start Web server.
   1.791 @@ -615,29 +570,27 @@
   1.792  			/etc/init.d/$daemon start
   1.793  		fi
   1.794  	done <<EOT
   1.795 -apache apache/httpd.pid
   1.796 +apache   apache/httpd.pid
   1.797  lighttpd lighttpd.pid
   1.798  EOT
   1.799  }
   1.800  
   1.801 -# Post and pre install commans to stop
   1.802 -# and restart Web server if needed.
   1.803 -pre_install_php_ldap()
   1.804 -{
   1.805 +# -----------------------------------------------------------------------------
   1.806 +pre_install_php_ldap() {
   1.807  	while read daemon file; do
   1.808  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.809  			/etc/init.d/$daemon stop
   1.810  		fi
   1.811  	done <<EOT
   1.812 -apache apache/httpd.pid
   1.813 +apache   apache/httpd.pid
   1.814  lighttpd lighttpd.pid
   1.815  EOT
   1.816  }
   1.817  
   1.818 -post_install_php_ldap()
   1.819 -{
   1.820 -	grep -q ^extension=ldap.so "$1/etc/php.ini" || \
   1.821 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=ldap.so|' -i "$1/etc/php.ini"
   1.822 +post_install_php_ldap() {
   1.823 +	grep -q ^extension=ldap.so "$1/etc/php.ini" ||
   1.824 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=ldap.so|' -i "$1/etc/php.ini"
   1.825 +
   1.826  	# Start Web server.
   1.827  	while read daemon file; do
   1.828  		[ -z "$1" ] || continue
   1.829 @@ -649,14 +602,12 @@
   1.830  			/etc/init.d/$daemon start
   1.831  		fi
   1.832  	done <<EOT
   1.833 -apache apache/httpd.pid
   1.834 +apache   apache/httpd.pid
   1.835  lighttpd lighttpd.pid
   1.836  EOT
   1.837  }
   1.838  
   1.839 -# Pre and post remove commands for Tazpkg.
   1.840 -pre_remove_php_ldap()
   1.841 -{
   1.842 +pre_remove_php_ldap() {
   1.843  	sed -i '/.*=ldap.so.*/d' /etc/php.ini
   1.844  
   1.845  	# Start Web server.
   1.846 @@ -670,29 +621,27 @@
   1.847  			/etc/init.d/$daemon start
   1.848  		fi
   1.849  	done <<EOT
   1.850 -apache apache/httpd.pid
   1.851 +apache   apache/httpd.pid
   1.852  lighttpd lighttpd.pid
   1.853  EOT
   1.854  }
   1.855  
   1.856 -# Post and pre install commans to stop
   1.857 -# and restart Web server if needed.
   1.858 -pre_install_php_mcrypt()
   1.859 -{
   1.860 +# -----------------------------------------------------------------------------
   1.861 +pre_install_php_mcrypt() {
   1.862  	while read daemon file; do
   1.863  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.864  			/etc/init.d/$daemon stop
   1.865  		fi
   1.866  	done <<EOT
   1.867 -apache apache/httpd.pid
   1.868 +apache   apache/httpd.pid
   1.869  lighttpd lighttpd.pid
   1.870  EOT
   1.871  }
   1.872  
   1.873 -post_install_php_mcrypt()
   1.874 -{
   1.875 -	grep -q ^extension=mcrypt.so "$1/etc/php.ini" || \
   1.876 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=mcrypt.so|' -i "$1/etc/php.ini"
   1.877 +post_install_php_mcrypt() {
   1.878 +	grep -q ^extension=mcrypt.so "$1/etc/php.ini" ||
   1.879 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=mcrypt.so|' -i "$1/etc/php.ini"
   1.880 +
   1.881  	# Start Web server.
   1.882  	while read daemon file; do
   1.883  		[ -z "$1" ] || continue
   1.884 @@ -704,14 +653,12 @@
   1.885  			/etc/init.d/$daemon start
   1.886  		fi
   1.887  	done <<EOT
   1.888 -apache apache/httpd.pid
   1.889 +apache   apache/httpd.pid
   1.890  lighttpd lighttpd.pid
   1.891  EOT
   1.892  }
   1.893  
   1.894 -# Pre and post remove commands for Tazpkg.
   1.895 -pre_remove_php_mcrypt()
   1.896 -{
   1.897 +pre_remove_php_mcrypt() {
   1.898  	sed -i '/.*=mcrypt.so.*/d' /etc/php.ini
   1.899  
   1.900  	# Start Web server.
   1.901 @@ -725,29 +672,27 @@
   1.902  			/etc/init.d/$daemon start
   1.903  		fi
   1.904  	done <<EOT
   1.905 -apache apache/httpd.pid
   1.906 +apache   apache/httpd.pid
   1.907  lighttpd lighttpd.pid
   1.908  EOT
   1.909  }
   1.910  
   1.911 -# Post and pre install commans to stop
   1.912 -# and restart Web server if needed.
   1.913 -pre_install_php_mysqli()
   1.914 -{
   1.915 +# -----------------------------------------------------------------------------
   1.916 +pre_install_php_mysqli() {
   1.917  	while read daemon file; do
   1.918  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.919  			/etc/init.d/$daemon stop
   1.920  		fi
   1.921  	done <<EOT
   1.922 -apache apache/httpd.pid
   1.923 +apache   apache/httpd.pid
   1.924  lighttpd lighttpd.pid
   1.925  EOT
   1.926  }
   1.927  
   1.928 -post_install_php_mysqli()
   1.929 -{
   1.930 -	grep -q ^extension=mysqli.so "$1/etc/php.ini" || \
   1.931 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=mysqli.so|' -i "$1/etc/php.ini"
   1.932 +post_install_php_mysqli() {
   1.933 +	grep -q ^extension=mysqli.so "$1/etc/php.ini" ||
   1.934 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=mysqli.so|' -i "$1/etc/php.ini"
   1.935 +
   1.936  	# Start Web server.
   1.937  	while read daemon file; do
   1.938  		[ -z "$1" ] || continue
   1.939 @@ -759,14 +704,12 @@
   1.940  			/etc/init.d/$daemon start
   1.941  		fi
   1.942  	done <<EOT
   1.943 -apache apache/httpd.pid
   1.944 +apache   apache/httpd.pid
   1.945  lighttpd lighttpd.pid
   1.946  EOT
   1.947  }
   1.948  
   1.949 -# Pre and post remove commands for Tazpkg.
   1.950 -pre_remove_php_mysqli()
   1.951 -{
   1.952 +pre_remove_php_mysqli() {
   1.953  	sed -i '/.*=mysqli.so.*/d' /etc/php.ini
   1.954  
   1.955  	# Start Web server.
   1.956 @@ -780,29 +723,27 @@
   1.957  			/etc/init.d/$daemon start
   1.958  		fi
   1.959  	done <<EOT
   1.960 -apache apache/httpd.pid
   1.961 +apache   apache/httpd.pid
   1.962  lighttpd lighttpd.pid
   1.963  EOT
   1.964  }
   1.965  
   1.966 -# Post and pre install commans to stop
   1.967 -# and restart Web server if needed.
   1.968 -pre_install_php_mysql()
   1.969 -{
   1.970 +# -----------------------------------------------------------------------------
   1.971 +pre_install_php_mysql() {
   1.972  	while read daemon file; do
   1.973  		if [ -z "$1" -a -f "/var/run/$file" ]; then
   1.974  			/etc/init.d/$daemon stop
   1.975  		fi
   1.976  	done <<EOT
   1.977 -apache apache/httpd.pid
   1.978 +apache   apache/httpd.pid
   1.979  lighttpd lighttpd.pid
   1.980  EOT
   1.981  }
   1.982  
   1.983 -post_install_php_mysql()
   1.984 -{
   1.985 -	grep -q ^extension=mysql.so "$1/etc/php.ini" || \
   1.986 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=mysql.so|' -i "$1/etc/php.ini"
   1.987 +post_install_php_mysql() {
   1.988 +	grep -q ^extension=mysql.so "$1/etc/php.ini" ||
   1.989 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=mysql.so|' -i "$1/etc/php.ini"
   1.990 +
   1.991  	# Start Web server.
   1.992  	while read daemon file; do
   1.993  		[ -z "$1" ] || continue
   1.994 @@ -814,14 +755,12 @@
   1.995  			/etc/init.d/$daemon start
   1.996  		fi
   1.997  	done <<EOT
   1.998 -apache apache/httpd.pid
   1.999 +apache   apache/httpd.pid
  1.1000  lighttpd lighttpd.pid
  1.1001  EOT
  1.1002  }
  1.1003  
  1.1004 -# Pre and post remove commands for Tazpkg.
  1.1005 -pre_remove_php_mysql()
  1.1006 -{
  1.1007 +pre_remove_php_mysql() {
  1.1008  	sed -i '/.*=mysql.so.*/d' /etc/php.ini
  1.1009  
  1.1010  	# Start Web server.
  1.1011 @@ -835,29 +774,27 @@
  1.1012  			/etc/init.d/$daemon start
  1.1013  		fi
  1.1014  	done <<EOT
  1.1015 -apache apache/httpd.pid
  1.1016 +apache   apache/httpd.pid
  1.1017  lighttpd lighttpd.pid
  1.1018  EOT
  1.1019  }
  1.1020  
  1.1021 -# Post and pre install commans to stop
  1.1022 -# and restart Web server if needed.
  1.1023 -pre_install_php_odbc()
  1.1024 -{
  1.1025 +# -----------------------------------------------------------------------------
  1.1026 +pre_install_php_odbc() {
  1.1027  	while read daemon file; do
  1.1028  		if [ -z "$1" -a -f "/var/run/$file" ]; then
  1.1029  			/etc/init.d/$daemon stop
  1.1030  		fi
  1.1031  	done <<EOT
  1.1032 -apache apache/httpd.pid
  1.1033 +apache   apache/httpd.pid
  1.1034  lighttpd lighttpd.pid
  1.1035  EOT
  1.1036  }
  1.1037  
  1.1038 -post_install_php_odbc()
  1.1039 -{
  1.1040 -	grep -q ^extension=odbc.so "$1/etc/php.ini" || \
  1.1041 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=odbc.so|' -i "$1/etc/php.ini"
  1.1042 +post_install_php_odbc() {
  1.1043 +	grep -q ^extension=odbc.so "$1/etc/php.ini" ||
  1.1044 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=odbc.so|' -i "$1/etc/php.ini"
  1.1045 +
  1.1046  	# Start Web server.
  1.1047  	while read daemon file; do
  1.1048  		[ -z "$1" ] || continue
  1.1049 @@ -869,14 +806,12 @@
  1.1050  			/etc/init.d/$daemon start
  1.1051  		fi
  1.1052  	done <<EOT
  1.1053 -apache apache/httpd.pid
  1.1054 +apache   apache/httpd.pid
  1.1055  lighttpd lighttpd.pid
  1.1056  EOT
  1.1057  }
  1.1058  
  1.1059 -# Pre and post remove commands for Tazpkg.
  1.1060 -pre_remove_php_odbc()
  1.1061 -{
  1.1062 +pre_remove_php_odbc() {
  1.1063  	sed -i '/.*=odbc.so.*/d' /etc/php.ini
  1.1064  
  1.1065  	# Start Web server.
  1.1066 @@ -890,29 +825,27 @@
  1.1067  			/etc/init.d/$daemon start
  1.1068  		fi
  1.1069  	done <<EOT
  1.1070 -apache apache/httpd.pid
  1.1071 +apache   apache/httpd.pid
  1.1072  lighttpd lighttpd.pid
  1.1073  EOT
  1.1074  }
  1.1075  
  1.1076 -# Post and pre install commans to stop
  1.1077 -# and restart Web server if needed.
  1.1078 -pre_install_php_openssl()
  1.1079 -{
  1.1080 +# -----------------------------------------------------------------------------
  1.1081 +pre_install_php_openssl() {
  1.1082  	while read daemon file; do
  1.1083  		if [ -z "$1" -a -f "/var/run/$file" ]; then
  1.1084  			/etc/init.d/$daemon stop
  1.1085  		fi
  1.1086  	done <<EOT
  1.1087 -apache apache/httpd.pid
  1.1088 +apache   apache/httpd.pid
  1.1089  lighttpd lighttpd.pid
  1.1090  EOT
  1.1091  }
  1.1092  
  1.1093 -post_install_php_openssl()
  1.1094 -{
  1.1095 -	grep -q ^extension=openssl.so "$1/etc/php.ini" || \
  1.1096 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=openssl.so|' -i "$1/etc/php.ini"
  1.1097 +post_install_php_openssl() {
  1.1098 +	grep -q ^extension=openssl.so "$1/etc/php.ini" ||
  1.1099 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=openssl.so|' -i "$1/etc/php.ini"
  1.1100 +
  1.1101  	# Start Web server.
  1.1102  	while read daemon file; do
  1.1103  		[ -z "$1" ] || continue
  1.1104 @@ -924,14 +857,12 @@
  1.1105  			/etc/init.d/$daemon start
  1.1106  		fi
  1.1107  	done <<EOT
  1.1108 -apache apache/httpd.pid
  1.1109 +apache   apache/httpd.pid
  1.1110  lighttpd lighttpd.pid
  1.1111  EOT
  1.1112  }
  1.1113  
  1.1114 -# Pre and post remove commands for Tazpkg.
  1.1115 -pre_remove_php_openssl()
  1.1116 -{
  1.1117 +pre_remove_php_openssl() {
  1.1118  	sed -i '/.*=openssl.so.*/d' /etc/php.ini
  1.1119  
  1.1120  	# Start Web server.
  1.1121 @@ -945,29 +876,27 @@
  1.1122  			/etc/init.d/$daemon start
  1.1123  		fi
  1.1124  	done <<EOT
  1.1125 -apache apache/httpd.pid
  1.1126 +apache   apache/httpd.pid
  1.1127  lighttpd lighttpd.pid
  1.1128  EOT
  1.1129  }
  1.1130  
  1.1131 -# Post and pre install commans to stop
  1.1132 -# and restart Web server if needed.
  1.1133 -pre_install_pdo_mysql()
  1.1134 -{
  1.1135 +# -----------------------------------------------------------------------------
  1.1136 +pre_install_pdo_mysql() {
  1.1137  	while read daemon file; do
  1.1138  		if [ -z "$1" -a -f "/var/run/$file" ]; then
  1.1139  			/etc/init.d/$daemon stop
  1.1140  		fi
  1.1141  	done <<EOT
  1.1142 -apache apache/httpd.pid
  1.1143 +apache   apache/httpd.pid
  1.1144  lighttpd lighttpd.pid
  1.1145  EOT
  1.1146  }
  1.1147  
  1.1148 -post_install_pdo_mysql()
  1.1149 -{
  1.1150 -	grep -q ^extension=pdo_mysql.so "$1/etc/php.ini" || \
  1.1151 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_mysql.so|' -i "$1/etc/php.ini"
  1.1152 +post_install_pdo_mysql() {
  1.1153 +	grep -q ^extension=pdo_mysql.so "$1/etc/php.ini" ||
  1.1154 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_mysql.so|' -i "$1/etc/php.ini"
  1.1155 +
  1.1156  	# Start Web server.
  1.1157  	while read daemon file; do
  1.1158  		[ -z "$1" ] || continue
  1.1159 @@ -979,14 +908,12 @@
  1.1160  			/etc/init.d/$daemon start
  1.1161  		fi
  1.1162  	done <<EOT
  1.1163 -apache apache/httpd.pid
  1.1164 +apache   apache/httpd.pid
  1.1165  lighttpd lighttpd.pid
  1.1166  EOT
  1.1167  }
  1.1168  
  1.1169 -# Pre and post remove commands for Tazpkg.
  1.1170 -pre_remove_pdo_mysql()
  1.1171 -{
  1.1172 +pre_remove_pdo_mysql() {
  1.1173  	sed -i '/.*=pdo_mysql.so.*/d' /etc/php.ini
  1.1174  
  1.1175  	# Start Web server.
  1.1176 @@ -1000,29 +927,27 @@
  1.1177  			/etc/init.d/$daemon start
  1.1178  		fi
  1.1179  	done <<EOT
  1.1180 -apache apache/httpd.pid
  1.1181 +apache   apache/httpd.pid
  1.1182  lighttpd lighttpd.pid
  1.1183  EOT
  1.1184  }
  1.1185  
  1.1186 -# Post and pre install commans to stop
  1.1187 -# and restart Web server if needed.
  1.1188 -pre_install_pdo_pgsql()
  1.1189 -{
  1.1190 +# -----------------------------------------------------------------------------
  1.1191 +pre_install_pdo_pgsql() {
  1.1192  	while read daemon file; do
  1.1193  		if [ -z "$1" -a -f "/var/run/$file" ]; then
  1.1194  			/etc/init.d/$daemon stop
  1.1195  		fi
  1.1196  	done <<EOT
  1.1197 -apache apache/httpd.pid
  1.1198 +apache   apache/httpd.pid
  1.1199  lighttpd lighttpd.pid
  1.1200  EOT
  1.1201  }
  1.1202  
  1.1203 -post_install_pdo_pgsql()
  1.1204 -{
  1.1205 -	grep -q ^extension=pdo_pgsql.so "$1/etc/php.ini" || \
  1.1206 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_pgsql.so|' -i "$1/etc/php.ini"
  1.1207 +post_install_pdo_pgsql() {
  1.1208 +	grep -q ^extension=pdo_pgsql.so "$1/etc/php.ini" ||
  1.1209 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_pgsql.so|' -i "$1/etc/php.ini"
  1.1210 +
  1.1211  	# Start Web server.
  1.1212  	while read daemon file; do
  1.1213  		[ -z "$1" ] || continue
  1.1214 @@ -1034,14 +959,12 @@
  1.1215  			/etc/init.d/$daemon start
  1.1216  		fi
  1.1217  	done <<EOT
  1.1218 -apache apache/httpd.pid
  1.1219 +apache   apache/httpd.pid
  1.1220  lighttpd lighttpd.pid
  1.1221  EOT
  1.1222  }
  1.1223  
  1.1224 -# Pre and post remove commands for Tazpkg.
  1.1225 -pre_remove_pdo_pgsql()
  1.1226 -{
  1.1227 +pre_remove_pdo_pgsql() {
  1.1228  	sed -i '/.*=pdo_pgsql.so.*/d' /etc/php.ini
  1.1229  
  1.1230  	# Start Web server.
  1.1231 @@ -1055,26 +978,24 @@
  1.1232  			/etc/init.d/$daemon start
  1.1233  		fi
  1.1234  	done <<EOT
  1.1235 -apache apache/httpd.pid
  1.1236 +apache   apache/httpd.pid
  1.1237  lighttpd lighttpd.pid
  1.1238  EOT
  1.1239  }
  1.1240  
  1.1241 -# Pre and post install commands for Tazpkg.
  1.1242 -pre_install_php_pear()
  1.1243 -{
  1.1244 +# -----------------------------------------------------------------------------
  1.1245 +pre_install_php_pear() {
  1.1246  	while read daemon file; do
  1.1247  		if [ -z "$1" -a -f "/var/run/$file" ]; then
  1.1248  			/etc/init.d/$daemon stop
  1.1249  		fi
  1.1250  	done <<EOT
  1.1251 -apache apache/httpd.pid
  1.1252 +apache   apache/httpd.pid
  1.1253  lighttpd lighttpd.pid
  1.1254  EOT
  1.1255  }
  1.1256  
  1.1257 -post_install_php_pear()
  1.1258 -{
  1.1259 +post_install_php_pear() {
  1.1260  	grep ^include_path "$1/etc/php.ini"
  1.1261  	sed -i 's|/php/includes"|/php/includes"\ninclude_path = ".:/usr/share/php"|' "$1/etc/php.ini"
  1.1262  	# Restart Web server.
  1.1263 @@ -1088,29 +1009,27 @@
  1.1264  			/etc/init.d/$daemon start
  1.1265  		fi
  1.1266  	done <<EOT
  1.1267 -apache apache/httpd.pid
  1.1268 +apache   apache/httpd.pid
  1.1269  lighttpd lighttpd.pid
  1.1270  EOT
  1.1271  }
  1.1272  
  1.1273 -# Post and pre install commans to stop
  1.1274 -# and restart Web server if needed.
  1.1275 -pre_install_php_pgsql()
  1.1276 -{
  1.1277 +# -----------------------------------------------------------------------------
  1.1278 +pre_install_php_pgsql() {
  1.1279  	while read daemon file; do
  1.1280  		if [ -z "$1" -a -f "/var/run/$file" ]; then
  1.1281  			/etc/init.d/$daemon stop
  1.1282  		fi
  1.1283  	done <<EOT
  1.1284 -apache apache/httpd.pid
  1.1285 +apache   apache/httpd.pid
  1.1286  lighttpd lighttpd.pid
  1.1287  EOT
  1.1288  }
  1.1289  
  1.1290 -post_install_php_pgsql()
  1.1291 -{
  1.1292 -	grep -q ^extension=pgsql.so "$1/etc/php.ini" || \
  1.1293 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=pgsql.so|' -i "$1/etc/php.ini"
  1.1294 +post_install_php_pgsql() {
  1.1295 +	grep -q ^extension=pgsql.so "$1/etc/php.ini" ||
  1.1296 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=pgsql.so|' -i "$1/etc/php.ini"
  1.1297 +
  1.1298  	# Start Web server.
  1.1299  	while read daemon file; do
  1.1300  		[ -z "$1" ] || continue
  1.1301 @@ -1122,14 +1041,12 @@
  1.1302  			/etc/init.d/$daemon start
  1.1303  		fi
  1.1304  	done <<EOT
  1.1305 -apache apache/httpd.pid
  1.1306 +apache   apache/httpd.pid
  1.1307  lighttpd lighttpd.pid
  1.1308  EOT
  1.1309  }
  1.1310  
  1.1311 -# Pre and post remove commands for Tazpkg.
  1.1312 -pre_remove_php_pgsql()
  1.1313 -{
  1.1314 +pre_remove_php_pgsql() {
  1.1315  	sed -i '/.*=pgsql.so.*/d' /etc/php.ini
  1.1316  
  1.1317  	# Start Web server.
  1.1318 @@ -1143,29 +1060,27 @@
  1.1319  			/etc/init.d/$daemon start
  1.1320  		fi
  1.1321  	done <<EOT
  1.1322 -apache apache/httpd.pid
  1.1323 +apache   apache/httpd.pid
  1.1324  lighttpd lighttpd.pid
  1.1325  EOT
  1.1326  }
  1.1327  
  1.1328 -# Post and pre install commans to stop
  1.1329 -# and restart Web server if needed.
  1.1330 -pre_install_php_snmp()
  1.1331 -{
  1.1332 +# -----------------------------------------------------------------------------
  1.1333 +pre_install_php_snmp() {
  1.1334  	while read daemon file; do
  1.1335  		if [ -z "$1" -a -f "/var/run/$file" ]; then
  1.1336  			/etc/init.d/$daemon stop
  1.1337  		fi
  1.1338  	done <<EOT
  1.1339 -apache apache/httpd.pid
  1.1340 +apache   apache/httpd.pid
  1.1341  lighttpd lighttpd.pid
  1.1342  EOT
  1.1343  }
  1.1344  
  1.1345 -post_install_php_snmp()
  1.1346 -{
  1.1347 -	grep -q ^extension=snmp.so "$1/etc/php.ini" || \
  1.1348 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=snmp.so|' -i "$1/etc/php.ini"
  1.1349 +post_install_php_snmp() {
  1.1350 +	grep -q ^extension=snmp.so "$1/etc/php.ini" ||
  1.1351 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=snmp.so|' -i "$1/etc/php.ini"
  1.1352 +
  1.1353  	# Start Web server.
  1.1354  	while read daemon file; do
  1.1355  		[ -z "$1" ] || continue
  1.1356 @@ -1177,14 +1092,12 @@
  1.1357  			/etc/init.d/$daemon start
  1.1358  		fi
  1.1359  	done <<EOT
  1.1360 -apache apache/httpd.pid
  1.1361 +apache   apache/httpd.pid
  1.1362  lighttpd lighttpd.pid
  1.1363  EOT
  1.1364  }
  1.1365  
  1.1366 -# Pre and post remove commands for Tazpkg.
  1.1367 -pre_remove_php_snmp()
  1.1368 -{
  1.1369 +pre_remove_php_snmp() {
  1.1370  	sed -i '/.*=snmp.so.*/d' /etc/php.ini
  1.1371  
  1.1372  	# Start Web server.
  1.1373 @@ -1198,29 +1111,27 @@
  1.1374  			/etc/init.d/$daemon start
  1.1375  		fi
  1.1376  	done <<EOT
  1.1377 -apache apache/httpd.pid
  1.1378 +apache   apache/httpd.pid
  1.1379  lighttpd lighttpd.pid
  1.1380  EOT
  1.1381  }
  1.1382  
  1.1383 -# Post and pre install commans to stop
  1.1384 -# and restart Web server if needed.
  1.1385 -pre_install_php_soap()
  1.1386 -{
  1.1387 +# -----------------------------------------------------------------------------
  1.1388 +pre_install_php_soap() {
  1.1389  	while read daemon file; do
  1.1390  		if [ -z "$1" -a -f "/var/run/$file" ]; then
  1.1391  			/etc/init.d/$daemon stop
  1.1392  		fi
  1.1393  	done <<EOT
  1.1394 -apache apache/httpd.pid
  1.1395 +apache   apache/httpd.pid
  1.1396  lighttpd lighttpd.pid
  1.1397  EOT
  1.1398  }
  1.1399  
  1.1400 -post_install_php_soap()
  1.1401 -{
  1.1402 -	grep -q ^extension=soap.so "$1/etc/php.ini" || \
  1.1403 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=soap.so|' -i "$1/etc/php.ini"
  1.1404 +post_install_php_soap() {
  1.1405 +	grep -q ^extension=soap.so "$1/etc/php.ini" ||
  1.1406 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=soap.so|' -i "$1/etc/php.ini"
  1.1407 +
  1.1408  	# Start Web server.
  1.1409  	while read daemon file; do
  1.1410  		[ -z "$1" ] || continue
  1.1411 @@ -1232,14 +1143,12 @@
  1.1412  			/etc/init.d/$daemon start
  1.1413  		fi
  1.1414  	done <<EOT
  1.1415 -apache apache/httpd.pid
  1.1416 +apache   apache/httpd.pid
  1.1417  lighttpd lighttpd.pid
  1.1418  EOT
  1.1419  }
  1.1420  
  1.1421 -# Pre and post remove commands for Tazpkg.
  1.1422 -pre_remove_php_soap()
  1.1423 -{
  1.1424 +pre_remove_php_soap() {
  1.1425  	sed -i '/.*=soap.so.*/d' /etc/php.ini
  1.1426  
  1.1427  	# Start Web server.
  1.1428 @@ -1253,15 +1162,16 @@
  1.1429  			/etc/init.d/$daemon start
  1.1430  		fi
  1.1431  	done <<EOT
  1.1432 -apache apache/httpd.pid
  1.1433 +apache   apache/httpd.pid
  1.1434  lighttpd lighttpd.pid
  1.1435  EOT
  1.1436  }
  1.1437  
  1.1438 -post_install_php_sqlite()
  1.1439 -{
  1.1440 -	grep -q ^extension=sqlite3.so "$1/etc/php.ini" || \
  1.1441 -	    sed -e 's|extension=msql.so|extension=msql.so\nextension=sqlite3.so|' -i "$1/etc/php.ini"
  1.1442 +# -----------------------------------------------------------------------------
  1.1443 +post_install_php_sqlite() {
  1.1444 +	grep -q ^extension=sqlite3.so "$1/etc/php.ini" ||
  1.1445 +	sed -e 's|extension=msql.so|extension=msql.so\nextension=sqlite3.so|' -i "$1/etc/php.ini"
  1.1446 +
  1.1447  	# Start Web server.
  1.1448  	while read daemon file; do
  1.1449  		[ -z "$1" ] || continue
  1.1450 @@ -1273,14 +1183,12 @@
  1.1451  			/etc/init.d/$daemon start
  1.1452  		fi
  1.1453  	done <<EOT
  1.1454 -apache apache/httpd.pid
  1.1455 +apache   apache/httpd.pid
  1.1456  lighttpd lighttpd.pid
  1.1457  EOT
  1.1458  }
  1.1459  
  1.1460 -# Pre and post remove commands for Tazpkg.
  1.1461 -pre_remove_php_sqlite()
  1.1462 -{
  1.1463 +pre_remove_php_sqlite() {
  1.1464  	sed -i '/.*=sqlite3.so.*/d' /etc/php.ini
  1.1465  
  1.1466  	# Start Web server.
  1.1467 @@ -1294,7 +1202,7 @@
  1.1468  			/etc/init.d/$daemon start
  1.1469  		fi
  1.1470  	done <<EOT
  1.1471 -apache apache/httpd.pid
  1.1472 +apache   apache/httpd.pid
  1.1473  lighttpd lighttpd.pid
  1.1474  EOT
  1.1475  }