SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "smbwebclient"

# SliTaz package receipt.

PACKAGE="smbwebclient"
VERSION="2.9.1"
CATEGORY="network"
SHORT_DESC="Samba client over the Web."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL2"
WEB_SITE="https://sourceforge.net/projects/smbwebclient/"

TARBALL="$PACKAGE-$VERSION.php.gz"
WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"

DEPENDS="php smbclient"

CONFIG_FILES="/etc/samba/smbwebclient.conf"

HOST_ARCH="any"

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

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    if [ ! -d $src ]; then
        mkdir -p $src
        cp $SOURCES_REPOSITORY/$TARBALL $src
        gunzip $src/$TARBALL
    fi

    mkdir -p $fs/usr/share/samba $fs/etc/samba
    cp -a $src/. $fs/usr/share/samba
    cp -a $stuff/* $fs
}

post_install()
{
    if [ -f "$1/etc/locale.conf" ]; then
        lang=$(. "$1/etc/locale.conf"; echo ${LANG%_*})
        sed -i "s/DefaultLanguage = 'us'/DefaultLanguage = '$lang'/" \
            "$1/etc/samba/smbwebclient.conf"
    fi
    
    if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
        if ! grep -q /usr/share/samba/ "$1/etc/lighttpd/lighttpd.conf"; then
                sed -e 's|.*"/examples/" => "/usr/share/examples/",|    "/examples/" => "/usr/share/examples/",\n    "/smbwebclient/" => "/usr/share/samba/",|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/smbwebclient" ]; then
            cat > "$1/etc/apache/conf.d/smbwebclient" <<EOT
<IfModule mod_alias.c>
    Alias /smbwebclient /usr/share/samba
</IfModule>
<DirectoryMatch /usr/share/samba/>
    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 restart
            fi
        fi
    fi
    cat <<EOF
---
Check \$cfgDefaultServer in configuration file /etc/samba/smbwebclient.conf 
---
EOF
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)