SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "phproxy"

# SliTaz package receipt.

PACKAGE="phproxy"
SOURCE="PHProxy"
VERSION="0.5b2"
CATEGORY="network"
SHORT_DESC="A proxy HTTP."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL2"
WEB_SITE="https://sebsauvage.net/wiki/doku.php?id=phproxy"
TARBALL="$SOURCE%20$VERSION%20mod%20SSE+ARKA%2020100825.7z"
WGET_URL="https://sebsauvage.net/temp/$TARBALL"
#HOST_ARCH="any"

DEPENDS="php"
BUILD_DEPENDS="p7zip"

current_version()
{
    wget -O - "$WEB_SITE" 2>/dev/null | \
    sed '/PHProxy/!d;s|.*PHProxy ||;s| .*||;q'
}

# Rules to configure and make the package.
compile_rules()
{
    dos2unix *
    mkdir -p $DESTDIR/usr/share/$PACKAGE
    cp *.php *.css $DESTDIR/usr/share/$PACKAGE
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    cp -a $install/* $fs
}

post_install()
{
    # Configure lighttpd server
    if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
        if ! grep -q /usr/share/phproxy/ "$1/etc/lighttpd/lighttpd.conf"; then
                sed -e 's|.*"/examples/" => "/usr/share/examples/",|    "/examples/" => "/usr/share/examples/",\n    "/phproxy/" => "/usr/share/phproxy/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
            if [ -z "$1" ]; then
                # Start Web server.
                /etc/init.d/lighttpd stop
                /etc/init.d/lighttpd start
            fi
        fi
    fi
    # Configure apache server
    if [ -f "$1/etc/apache/httpd.conf" ]; then
        if [ ! -f "$1/etc/apache/conf.d/phproxy" ]; then
            cat > "$1/etc/apache/conf.d/phproxy" <<EOT
<IfModule mod_alias.c>
    Alias /phproxy /usr/share/phproxy
</IfModule>
<Directory /usr/share/phproxy/>
    DirectoryIndex index.php
    Options +FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
EOT
            if [ -z "$1" ]; then
                # Start Web server.
                /etc/init.d/apache stop
                /etc/init.d/apache start
            fi
        fi
    fi
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)