wok-6.x view ajaxterm/receipt @ rev 2702

Up: locale-* (1.1) - Include more apps and use the last glibc
author Christophe Lincoln <pankso@slitaz.org>
date Wed Apr 22 18:26:22 2009 +0200 (2009-04-22)
parents a18388f52400
children 2bbc0ef3f1d2
line source
1 # SliTaz package receipt.
3 PACKAGE="ajaxterm"
4 VERSION="0.10"
5 CATEGORY="network"
6 SHORT_DESC="Login terminal for the web."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 SOURCE="Ajaxterm"
9 TARBALL="$SOURCE-$VERSION.tar.gz"
10 WEB_SITE="http://antony.lesuisse.org/software/$PACKAGE/"
11 WGET_URL="${WEB_SITE}files/$TARBALL"
12 DEPENDS="python"
13 SUGGESTED="apache lighttpd-ssl lighttpd-modules"
15 # Rules to gen a SliTaz package suitable for Tazpkg.
16 genpkg_rules()
17 {
18 mkdir -p $fs/usr/share/ajaxterm
19 cp -a $src/*.py $src/*.js $src/*.css $src/*.html $fs/usr/share/ajaxterm
20 cp -a stuff/* $fs/
21 }
23 post_install()
24 {
25 grep ^RUN_DAEMONS $1/etc/rcS.conf | grep -q "ajaxterm" || sed -i \
26 's/RUN_DAEMONS="/RUN_DAEMONS="ajaxterm /' $1/etc/rcS.conf
27 # Configure lighttpd server
28 if [ -f $1/usr/lib/lighttpd/mod_proxy.so ]; then
29 #https://www.dupnet.org/dotclear/index.php/2007/10/07/11-ajaxterm-et-lighttpd
30 #http://www.lighttpd.net
31 grep -q mod_proxy $1/etc/lighttpd/lighttpd.conf ||
32 cat >> $1/etc/lighttpd/lighttpd.conf <<EOT
33 server.modules += ( "mod_proxy" )
34 EOT
35 grep -q ajaxterm $1/etc/lighttpd/lighttpd.conf ||
36 cat >> $1/etc/lighttpd/lighttpd.conf <<EOT
37 proxy.server = ( "/ajaxterm/" =>
38 ( ( "host" => "127.0.0.1", "port" => 8022 ) )
39 )
40 EOT
41 grep -q mod_redirect $1/etc/lighttpd/lighttpd.conf ||
42 cat >> $1/etc/lighttpd/lighttpd.conf <<EOT
43 server.modules += ( "mod_redirect" )
44 EOT
45 grep -q https:// $1/etc/lighttpd/lighttpd.conf &&
46 cat >> $1/etc/lighttpd/lighttpd.conf <<EOT
47 \$SERVER["socket"] == ":80" {
48 \$HTTP["host"] =~ "(.*)" {
49 url.redirect = ( "^/ajaxterm" => "https://%1/ajaxterm/" )
50 }
51 }
52 EOT
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 # Configure apache server
60 if [ -f $1/etc/apache/httpd.conf ]; then
61 #http://smhteam.info/wiki/index.linux.php5?wiki=AjaxTerm
62 if [ ! -f $1/etc/apache/conf.d/ajaxterm ]; then
63 cat > $1/etc/apache/conf.d/ajaxterm <<EOT
64 <IfModule mod_proxy.c>
65 ProxyRequests Off
66 <Proxy *>
67 Order deny,allow
68 Allow from all
69 </Proxy>
70 ProxyPass /ajaxterm/ http://localhost:8022/
71 ProxyPassReverse /ajaxterm/ http://localhost:8022/
72 </IfModule>
74 <IfModule mod_rewrite.c>
75 RewriteEngine On
76 RewriteCond %{SERVER_PORT} !^443$
77 RewriteRule ^/ajaxterm https://%{SERVER_NAME}/ajaxterm/ [L,R=303]
78 </IfModule>
79 EOT
80 if [ -z "$1" ]; then
81 # Start Web server.
82 /etc/init.d/apache stop
83 sleep 2
84 /etc/init.d/apache start
85 fi
86 fi
87 fi
88 [ -z "$1" ] && /etc/init.d/ajaxterm start
89 [ ! -f $1/usr/lib/lighttpd/mod_proxy.so -a \
90 ! -f $1/etc/apache/httpd.conf ] && cat <<EOT
91 --------
92 You should install either lighttpd
93 # tazpkg get-install lighttpd-ssl ; tazpkg get-install lighttpd-modules
94 or apache
95 # tazpkg get-install apache
96 and reconfigure
97 # tazpkg reconfigure ajaxterm
98 --------
99 EOT
100 }