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