SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "eaccelerator"

# SliTaz package receipt.

PACKAGE="eaccelerator"
VERSION="0.9.6.1"
CATEGORY="system-tools"
SHORT_DESC="PHP accelerator, optimizer, and dynamic content cache."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL2"
TARBALL="$PACKAGE-$VERSION.tar.bz2"
WEB_SITE="http://eaccelerator.net/"
WGET_URL="https://github.com/downloads/eaccelerator/eaccelerator/$TARBALL"
TAGS="php"

DEPENDS="php m4"
BUILD_DEPENDS="php-dev sed coreutils-conditions"    # gawk re2c

# What is the latest version available today?
current_version()
{
    wget -O - https://sourceforge.net/projects/eaccelerator/files/eaccelerator/ 2>/dev/null | \
    sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
    sed '/scope="row/!d;/tar/!d;/binary/d;s|.*/eAccelerator%20||;s|/.*||;q'
}

# Rules to configure and make the package.
compile_rules()
{
    cd $src
    export PHP_PREFIX="/usr"
    $PHP_PREFIX/bin/phpize
    ./configure --enable-eaccelerator=shared \
        --with-php-config=$PHP_PREFIX/bin/php-config \
        --prefix=/usr --infodir=/usr/share/info \
        --mandir=/usr/share/man $CONFIGURE_ARGS &&
    make &&
    make INSTALL_ROOT=$DESTDIR install
}

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

# Pre and post install commands for Tazpkg.
post_install()
{
    grep -q ^extension=msql.so "$1/etc/php.ini" || \
        sed -e 's|;.*extension=msql.so|;   extension=msql.so\nextension=eaccelerator.so\neaccelerator.shm_size="48"\neaccelerator.cache_dir="/tmp/eaccelerator"\neaccelerator.enable="1"\neaccelerator.optimizer="1"\neaccelerator.check_mtime="1"\neaccelerator.debug="0"\neaccelerator.filter=""\neaccelerator.shm_max="0"\neaccelerator.shm_ttl="0"\neaccelerator.shm_prune_period="0"\neaccelerator.shm_only="0"\neaccelerator.compress="1"\neaccelerator.compress_level="9"|' -i "$1/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 start
        fi
    done <<EOT
apache apache/httpd.pid
lighttpd lighttpd.pid
EOT
}

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

    # Start Web server.
    while read daemon file; do
        if [ -z "$1" -a -f /etc/init.d/$daemon \
                 -a ! -f "/var/run/$file" ]; then
            /etc/init.d/$daemon start
        fi
    done <<EOT
apache apache/httpd.pid
lighttpd lighttpd.pid
EOT
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)