wok-4.x annotate ajaxterm/receipt @ rev 3610

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