wok-6.x annotate smbwebclient/receipt @ rev 1544

smbwebclient: exit on wget error
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Oct 11 14:07:18 2008 +0000 (2008-10-11)
parents 5fe0d4cca0be
children bd6010223726
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@1247 15 if [ ! -d $src ]; then
pascal@1544 16 wget $SF_MIRROR/$PACKAGE/$PACKAGE-$VERSION.php.gz || return 1
pascal@1247 17 mkdir -p $src
pascal@1247 18 mv $PACKAGE-$VERSION.php.gz $src
pascal@1247 19 gunzip $src/$PACKAGE-$VERSION.php.gz
pascal@1247 20 fi
pascal@1247 21 }
pascal@1247 22
pascal@1247 23 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1247 24 genpkg_rules()
pascal@1247 25 {
pascal@1247 26 mkdir -p $fs/usr/share/samba $fs/etc/samba
pascal@1247 27 cp -a $src/. $fs/usr/share/samba
pascal@1247 28 cp -a stuff/* $fs
pascal@1247 29 }
pascal@1247 30
pascal@1247 31 post_install()
pascal@1247 32 {
pascal@1247 33 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
pascal@1247 34 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
pascal@1247 35 etc/samba/smbwebclient.conf
pascal@1247 36 EOT
pascal@1247 37 if [ -f $1/etc/locale.conf ]; then
pascal@1247 38 lang=$(. /etc/locale.conf; echo ${LANG%_*})
pascal@1247 39 sed -i "s/DefaultLanguage = 'us'/DefaultLanguage = '$lang'/" \
pascal@1247 40 $1/etc/samba/smbwebclient.conf
pascal@1247 41 fi
pascal@1247 42
pascal@1247 43 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@1247 44 if ! grep -q /usr/share/samba/ $1/etc/lighttpd/lighttpd.conf; then
pascal@1247 45 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 46 if [ -z "$1" ]; then
pascal@1247 47 # Start Web server.
pascal@1247 48 /etc/init.d/lighttpd stop
pascal@1247 49 /etc/init.d/lighttpd start
pascal@1247 50 fi
pascal@1247 51 fi
pascal@1247 52 fi
pascal@1427 53 # Configure apache server
pascal@1427 54 if [ -f $1/etc/apache/httpd.conf ]; then
pascal@1427 55 if [ ! -f $1/etc/apache/conf.d/smbwebclient ]; then
pascal@1427 56 cat > $1/etc/apache/conf.d/smbwebclient <<EOT
pascal@1427 57 <IfModule mod_alias.c>
pascal@1427 58 Alias /smbwebclient /usr/share/samba
pascal@1427 59 </IfModule>
pascal@1427 60 <DirectoryMatch /usr/share/samba/>
pascal@1427 61 DirectoryIndex index.php
pascal@1427 62 Options +FollowSymLinks
pascal@1427 63 AllowOverride None
pascal@1427 64 Order allow,deny
pascal@1427 65 Allow from all
pascal@1427 66 </DirectoryMatch>
pascal@1427 67 EOT
pascal@1427 68 if [ -z "$1" ]; then
pascal@1427 69 # Start Web server.
pascal@1427 70 /etc/init.d/apache restart
pascal@1427 71 fi
pascal@1427 72 fi
pascal@1427 73 fi
pascal@1247 74 cat <<EOF
pascal@1247 75 ---
pascal@1247 76 Check \$cfgDefaultServer in configuration file /etc/samba/smbwebclient.conf
pascal@1247 77 ---
pascal@1247 78 EOF
pascal@1247 79 }
pascal@1247 80
pascal@1247 81 repack_cleanup()
pascal@1247 82 {
pascal@1247 83 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
pascal@1247 84 }