SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "smbwebclient"

# SliTaz package receipt.

PACKAGE="smbwebclient"
VERSION="2.9"
CATEGORY="network"
SHORT_DESC="Samba client over the Web."
MAINTAINER="pascal.bellard@slitaz.org"
TARBALL="$PACKAGE-$VERSION.php.gz"
WEB_SITE="http://$PACKAGE.sourceforge.net/"
DEPENDS="php smbclient"
WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
CONFIG_FILES="/etc/samba/smbwebclient.conf"
COOK_OPT="!unpack !repack_src"

# 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=$(. /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
}
3382 packages and 430813 files in stable database (Mon Mar 4 17:53:49 2019)