wok-current view smbwebclient/receipt @ rev 25383
updated units (2.19 -> 2.21)
author | Hans-G?nter Theisgen |
---|---|
date | Sat Jul 30 17:22:12 2022 +0100 (2022-07-30) |
parents | 70a88c677f40 |
children | ad0bc3efbf37 |
line source
1 # SliTaz package receipt.
3 PACKAGE="smbwebclient"
4 VERSION="2.9.1"
5 CATEGORY="network"
6 SHORT_DESC="Samba client over the Web."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://sourceforge.net/projects/smbwebclient/"
11 TARBALL="$PACKAGE-$VERSION.php.gz"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
14 DEPENDS="php smbclient"
16 CONFIG_FILES="/etc/samba/smbwebclient.conf"
18 HOST_ARCH="any"
20 # What is the latest version available today?
21 current_version()
22 {
23 wget -O - https://sourceforge.net/projects/$PACKAGE/files/ 2>/dev/null | \
24 sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
25 sed "/$PACKAGE-/!d;s|.*$PACKAGE-||;s|.php.*||;s|_|.|g;q"
26 }
28 # Rules to gen a SliTaz package suitable for Tazpkg.
29 genpkg_rules()
30 {
31 if [ ! -d $src ]; then
32 mkdir -p $src
33 cp $SOURCES_REPOSITORY/$TARBALL $src
34 gunzip $src/$TARBALL
35 fi
37 mkdir -p $fs/usr/share/samba $fs/etc/samba
38 cp -a $src/. $fs/usr/share/samba
39 cp -a $stuff/* $fs
40 }
42 post_install()
43 {
44 if [ -f "$1/etc/locale.conf" ]; then
45 lang=$(. "$1/etc/locale.conf"; echo ${LANG%_*})
46 sed -i "s/DefaultLanguage = 'us'/DefaultLanguage = '$lang'/" \
47 "$1/etc/samba/smbwebclient.conf"
48 fi
50 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
51 if ! grep -q /usr/share/samba/ "$1/etc/lighttpd/lighttpd.conf"; then
52 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/smbwebclient/" => "/usr/share/samba/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
53 if [ -z "$1" ]; then
54 # Start Web server.
55 /etc/init.d/lighttpd stop
56 /etc/init.d/lighttpd start
57 fi
58 fi
59 fi
60 # Configure apache server
61 if [ -f "$1/etc/apache/httpd.conf" ]; then
62 if [ ! -f "$1/etc/apache/conf.d/smbwebclient" ]; then
63 cat > "$1/etc/apache/conf.d/smbwebclient" <<EOT
64 <IfModule mod_alias.c>
65 Alias /smbwebclient /usr/share/samba
66 </IfModule>
67 <DirectoryMatch /usr/share/samba/>
68 DirectoryIndex index.php
69 Options +FollowSymLinks
70 AllowOverride None
71 Order allow,deny
72 Allow from all
73 </DirectoryMatch>
74 EOT
75 if [ -z "$1" ]; then
76 # Start Web server.
77 /etc/init.d/apache restart
78 fi
79 fi
80 fi
81 cat <<EOF
82 ---
83 Check \$cfgDefaultServer in configuration file /etc/samba/smbwebclient.conf
84 ---
85 EOF
86 }