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