SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "php-odbc"

# SliTaz package receipt.

PACKAGE="php-odbc"
VERSION="5.2.17"
CATEGORY="development"
SHORT_DESC="ODBC module for PHP web programming language."
MAINTAINER="pascal.bellard@slitaz.org"
DEPENDS="unixODBC php"
WEB_SITE="http://www.php.net/"
WANTED="php"

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/share/php
    cp $(find $_pkg | grep odbc.so) $fs/usr/share/php/
}

# Post and pre install commans to stop
# and restart Web server if needed.
pre_install()
{
    while read daemon file; do
        if [ -z "$1" -a -f "/var/run/$file" ]; then
            /etc/init.d/$daemon stop
        fi
    done <<EOT
apache apache/httpd.pid
lighttpd lighttpd.pid
EOT
}

post_install()
{
    grep -q ^extension=odbc.so $1/etc/php.ini || \
        sed -e 's|extension=msql.so|extension=msql.so\nextension=odbc.so|' -i $1/etc/php.ini
    # Start Web server.
    while read daemon file; do
        [ -z "$1" ] || continue
        if [ -f "/var/run/$file" ]; then
            /etc/init.d/$daemon stop
            sleep 2
        fi
        if [ -f /etc/init.d/$daemon ]; then
            /etc/init.d/$daemon start
        fi
    done <<EOT
apache apache/httpd.pid
lighttpd lighttpd.pid
EOT
}

# Pre and post remove commands for Tazpkg.
pre_remove()
{
    sed -i '/.*=odbc.so.*/d' /etc/php.ini

    # Start Web server.
    while read daemon file; do
        if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
            /etc/init.d/$daemon stop
            sleep 2
            /etc/init.d/$daemon start
        fi
    done <<EOT
apache apache/httpd.pid
lighttpd lighttpd.pid
EOT
}
3382 packages and 430813 files in stable database (Mon Mar 4 17:53:49 2019)