wok-next annotate smbwebclient/receipt @ rev 7850

busybox/init: reduce subroot= waste
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 28 23:15:27 2010 +0100 (2010-12-28)
parents bd6010223726
children e40d8e48447d
rev   line source
pascal@1247 1 # SliTaz package receipt.
pascal@1247 2
pascal@1247 3 PACKAGE="smbwebclient"
pascal@1247 4 VERSION="2.9"
pascal@1247 5 CATEGORY="network"
pascal@1247 6 SHORT_DESC="Samba client over the Web."
pascal@1247 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@1247 8 WEB_SITE="http://$PACKAGE.sourceforge.net/"
pascal@1247 9 DEPENDS="php smbclient"
pascal@1247 10 CONFIG_FILES="/etc/samba/smbwebclient.conf"
pascal@1247 11
pascal@1247 12 # Rules to configure and make the package.
pascal@1247 13 compile_rules()
pascal@1247 14 {
pascal@5555 15 [ -f $SOURCES_REPOSITORY/$PACKAGE-$VERSION.php.gz ] ||
pascal@5555 16 wget $SF_MIRROR/$PACKAGE/$PACKAGE-$VERSION.php.gz -P $SOURCES_REPOSITORY
pascal@1247 17 if [ ! -d $src ]; then
pascal@1247 18 mkdir -p $src
pascal@5555 19 cp $SOURCES_REPOSITORY/$PACKAGE-$VERSION.php.gz $src
pascal@1247 20 gunzip $src/$PACKAGE-$VERSION.php.gz
pascal@1247 21 fi
pascal@1247 22 }
pascal@1247 23
pascal@1247 24 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1247 25 genpkg_rules()
pascal@1247 26 {
pascal@1247 27 mkdir -p $fs/usr/share/samba $fs/etc/samba
pascal@1247 28 cp -a $src/. $fs/usr/share/samba
pascal@1247 29 cp -a stuff/* $fs
pascal@1247 30 }
pascal@1247 31
pascal@1247 32 post_install()
pascal@1247 33 {
pascal@1247 34 if [ -f $1/etc/locale.conf ]; then
pascal@1247 35 lang=$(. /etc/locale.conf; echo ${LANG%_*})
pascal@1247 36 sed -i "s/DefaultLanguage = 'us'/DefaultLanguage = '$lang'/" \
pascal@1247 37 $1/etc/samba/smbwebclient.conf
pascal@1247 38 fi
pascal@1247 39
pascal@1247 40 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@1247 41 if ! grep -q /usr/share/samba/ $1/etc/lighttpd/lighttpd.conf; then
pascal@1247 42 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/smbwebclient/" => "/usr/share/samba/",|g' -i $1/etc/lighttpd/lighttpd.conf
pascal@1247 43 if [ -z "$1" ]; then
pascal@1247 44 # Start Web server.
pascal@1247 45 /etc/init.d/lighttpd stop
pascal@1247 46 /etc/init.d/lighttpd start
pascal@1247 47 fi
pascal@1247 48 fi
pascal@1247 49 fi
pascal@1427 50 # Configure apache server
pascal@1427 51 if [ -f $1/etc/apache/httpd.conf ]; then
pascal@1427 52 if [ ! -f $1/etc/apache/conf.d/smbwebclient ]; then
pascal@1427 53 cat > $1/etc/apache/conf.d/smbwebclient <<EOT
pascal@1427 54 <IfModule mod_alias.c>
pascal@1427 55 Alias /smbwebclient /usr/share/samba
pascal@1427 56 </IfModule>
pascal@1427 57 <DirectoryMatch /usr/share/samba/>
pascal@1427 58 DirectoryIndex index.php
pascal@1427 59 Options +FollowSymLinks
pascal@1427 60 AllowOverride None
pascal@1427 61 Order allow,deny
pascal@1427 62 Allow from all
pascal@1427 63 </DirectoryMatch>
pascal@1427 64 EOT
pascal@1427 65 if [ -z "$1" ]; then
pascal@1427 66 # Start Web server.
pascal@1427 67 /etc/init.d/apache restart
pascal@1427 68 fi
pascal@1427 69 fi
pascal@1427 70 fi
pascal@1247 71 cat <<EOF
pascal@1247 72 ---
pascal@1247 73 Check \$cfgDefaultServer in configuration file /etc/samba/smbwebclient.conf
pascal@1247 74 ---
pascal@1247 75 EOF
pascal@1247 76 }