wok-6.x view smbwebclient/receipt @ rev 6037

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