wok-next annotate php-pdo-pgsql/receipt @ rev 4801

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