wok-current diff php-dbase/receipt @ rev 7544

Add php-dbase
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 07 20:36:20 2010 +0100 (2010-12-07)
parents
children 79688ff060bd
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/php-dbase/receipt	Tue Dec 07 20:36:20 2010 +0100
     1.3 @@ -0,0 +1,68 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="php-dbase"
     1.7 +VERSION="5.2.14"
     1.8 +CATEGORY="development"
     1.9 +SHORT_DESC="dbase module for PHP web programming language."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +WEB_SITE="http://www.php.net/"
    1.12 +WANTED="php"
    1.13 +
    1.14 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.15 +genpkg_rules()
    1.16 +{
    1.17 +	mkdir -p $fs/usr/share/php
    1.18 +	cp $(find $_pkg | grep dbase.so) $fs/usr/share/php/
    1.19 +}
    1.20 +
    1.21 +# Post and pre install commans to stop
    1.22 +# and restart Web server if needed.
    1.23 +pre_install()
    1.24 +{
    1.25 +	while read daemon file; do
    1.26 +		if [ -z "$1" -a -f "/var/run/$file" ]; then
    1.27 +			/etc/init.d/$daemon stop
    1.28 +		fi
    1.29 +	done <<EOT
    1.30 +apache apache/httpd.pid
    1.31 +lighttpd lighttpd.pid
    1.32 +EOT
    1.33 +}
    1.34 +
    1.35 +post_install()
    1.36 +{
    1.37 +	grep -q ^extension=dbase.so $1/etc/php.ini || \
    1.38 +	    sed -e 's|extension=msql.so|extension=msql.so\nextension=dbase.so|' -i $1/etc/php.ini
    1.39 +	# Start Web server.
    1.40 +	while read daemon file; do
    1.41 +		[ -z "$1" ] || continue
    1.42 +		if [ -f "/var/run/$file" ]; then
    1.43 +			/etc/init.d/$daemon stop
    1.44 +			sleep 2
    1.45 +		fi
    1.46 +		if [ -f /etc/init.d/$daemon ]; then
    1.47 +			/etc/init.d/$daemon start
    1.48 +		fi
    1.49 +	done <<EOT
    1.50 +apache apache/httpd.pid
    1.51 +lighttpd lighttpd.pid
    1.52 +EOT
    1.53 +}
    1.54 +
    1.55 +# Pre and post remove commands for Tazpkg.
    1.56 +pre_remove()
    1.57 +{
    1.58 +	sed -i '/.*=dbase.so.*/d' /etc/php.ini
    1.59 +
    1.60 +	# Start Web server.
    1.61 +	while read daemon file; do
    1.62 +		if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
    1.63 +			/etc/init.d/$daemon stop
    1.64 +			sleep 2
    1.65 +			/etc/init.d/$daemon start
    1.66 +		fi
    1.67 +	done <<EOT
    1.68 +apache apache/httpd.pid
    1.69 +lighttpd lighttpd.pid
    1.70 +EOT
    1.71 +}