wok-6.x annotate php-pdo-mysql/receipt @ rev 14614

Up: php to 5.4.13.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Jun 01 06:40:14 2013 +0000 (2013-06-01)
parents 855f42b596c0
children 78cb1e930abd
rev   line source
pankso@4428 1 # SliTaz package receipt.
pankso@4428 2
pankso@4428 3 PACKAGE="php-pdo-mysql"
slaxemulator@14614 4 VERSION="5.4.13"
pankso@4428 5 CATEGORY="development"
pankso@4428 6 SHORT_DESC="PDO MySQL 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
slaxemulator@14614 16 cp $(find $install | grep pdo_mysql.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_mysql.so $1/etc/php.ini || \
pascal@4923 36 sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_mysql.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_mysql.so.*/d' /etc/php.ini
pankso@4428 57
pankso@4428 58 # Start Web server.
pankso@4428 59 while read daemon file; do
slaxemulator@14614 60 [ -z "$1" ] || continue
slaxemulator@14614 61 if [ -z "$1" -a -f "/var/run/$file" ]; then
pankso@4428 62 /etc/init.d/$daemon stop
pankso@4428 63 sleep 2
slaxemulator@14614 64 fi
slaxemulator@14614 65 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
pankso@4428 66 /etc/init.d/$daemon start
pankso@4428 67 fi
pankso@4428 68 done <<EOT
pankso@4428 69 apache apache/httpd.pid
pankso@4428 70 lighttpd lighttpd.pid
pankso@4428 71 EOT
pankso@4428 72 }