SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "shell-detector"

# SliTaz package receipt.

PACKAGE="shell-detector"
VERSION="20140308"
CATEGORY="network"
SHORT_DESC="Web shell detection tool."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="MIT"
WEB_SITE="https://www.emposha.com/security/php-shell-detector-web-shell-detection-tool.html"
TARBALL="$PACKAGE-$VERSION.tar.bz2"
#WGET_URL="https://github.com/emposha/PHP-Shell-Detector/tarball/master"
WGET_URL="git|git://github.com/emposha/PHP-Shell-Detector.git"

DEPENDS="php"
BUILD_DEPENDS="git"

# What is the latest version available today?
current_version()
{
    wget -O - https://github.com/emposha/PHP-Shell-Detector/commits/master 2>/dev/null | \
    sed '/Commits on/!d;s|.*on |"|;s|<.*|"|;q' | xargs date +%Y%m%d -d
}

# Rules to configure and make the package.
compile_rules()
{
    cd $src
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/share/$PACKAGE
    cp -a $src/* $fs/usr/share/$PACKAGE
    ln -s shelldetect.php $fs/usr/share/$PACKAGE/index.php
    chown -R www.www $fs/usr/share/$PACKAGE
}

post_install()
{
    # Configure lighttpd server
    if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
        if ! grep -q /usr/share/phpsysinfo/ "$1/etc/lighttpd/lighttpd.conf"; then
                sed -e "s|.*\"/examples/\" => \"/usr/share/examples/\",|    \"/examples/\" => \"/usr/share/examples/\",\\n    \"/$PACKAGE/\" => \"/usr/share/$PACKAGE/\",|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/$PACKAGE" ]; then
            cat > "$1/etc/apache/conf.d/$PACKAGE" <<EOT
<IfModule mod_alias.c>
    Alias /$PACKAGE /usr/share/$PACKAGE
</IfModule>
<DirectoryMatch /usr/share/$PACKAGE/>
    DirectoryIndex index.php
    Options +FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</DirectoryMatch>
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)