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