wok-current annotate 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
rev   line source
pascal@7544 1 # SliTaz package receipt.
pascal@7544 2
pascal@7544 3 PACKAGE="php-dbase"
pascal@7544 4 VERSION="5.2.14"
pascal@7544 5 CATEGORY="development"
pascal@7544 6 SHORT_DESC="dbase module for PHP web programming language."
pascal@7544 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@7544 8 WEB_SITE="http://www.php.net/"
pascal@7544 9 WANTED="php"
pascal@7544 10
pascal@7544 11 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@7544 12 genpkg_rules()
pascal@7544 13 {
pascal@7544 14 mkdir -p $fs/usr/share/php
pascal@7544 15 cp $(find $_pkg | grep dbase.so) $fs/usr/share/php/
pascal@7544 16 }
pascal@7544 17
pascal@7544 18 # Post and pre install commans to stop
pascal@7544 19 # and restart Web server if needed.
pascal@7544 20 pre_install()
pascal@7544 21 {
pascal@7544 22 while read daemon file; do
pascal@7544 23 if [ -z "$1" -a -f "/var/run/$file" ]; then
pascal@7544 24 /etc/init.d/$daemon stop
pascal@7544 25 fi
pascal@7544 26 done <<EOT
pascal@7544 27 apache apache/httpd.pid
pascal@7544 28 lighttpd lighttpd.pid
pascal@7544 29 EOT
pascal@7544 30 }
pascal@7544 31
pascal@7544 32 post_install()
pascal@7544 33 {
pascal@7544 34 grep -q ^extension=dbase.so $1/etc/php.ini || \
pascal@7544 35 sed -e 's|extension=msql.so|extension=msql.so\nextension=dbase.so|' -i $1/etc/php.ini
pascal@7544 36 # Start Web server.
pascal@7544 37 while read daemon file; do
pascal@7544 38 [ -z "$1" ] || continue
pascal@7544 39 if [ -f "/var/run/$file" ]; then
pascal@7544 40 /etc/init.d/$daemon stop
pascal@7544 41 sleep 2
pascal@7544 42 fi
pascal@7544 43 if [ -f /etc/init.d/$daemon ]; then
pascal@7544 44 /etc/init.d/$daemon start
pascal@7544 45 fi
pascal@7544 46 done <<EOT
pascal@7544 47 apache apache/httpd.pid
pascal@7544 48 lighttpd lighttpd.pid
pascal@7544 49 EOT
pascal@7544 50 }
pascal@7544 51
pascal@7544 52 # Pre and post remove commands for Tazpkg.
pascal@7544 53 pre_remove()
pascal@7544 54 {
pascal@7544 55 sed -i '/.*=dbase.so.*/d' /etc/php.ini
pascal@7544 56
pascal@7544 57 # Start Web server.
pascal@7544 58 while read daemon file; do
pascal@7544 59 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
pascal@7544 60 /etc/init.d/$daemon stop
pascal@7544 61 sleep 2
pascal@7544 62 /etc/init.d/$daemon start
pascal@7544 63 fi
pascal@7544 64 done <<EOT
pascal@7544 65 apache apache/httpd.pid
pascal@7544 66 lighttpd lighttpd.pid
pascal@7544 67 EOT
pascal@7544 68 }