wok-current view ajaxterm/receipt @ rev 14900
Add firmware-mod-kit
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jul 31 11:20:11 2013 +0200 (2013-07-31) |
parents | c6794eb6dd1a |
children | f4c22f009037 |
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 WEB_SITE="http://antony.lesuisse.org/software/ajaxterm/"
9 SOURCE="Ajaxterm"
10 TARBALL="$SOURCE-$VERSION.tar.gz"
11 WGET_URL="${WEB_SITE}files/$TARBALL"
12 TAGS="web application"
14 DEPENDS="python"
15 SUGGESTED="apache lighttpd-ssl lighttpd-modules"
17 # Rules to gen a SliTaz package suitable for Tazpkg.
18 genpkg_rules()
19 {
20 mkdir -p $fs/usr/share/ajaxterm
21 cp -a $src/*.py $src/*.js $src/*.css $src/*.html $fs/usr/share/ajaxterm
22 cp -a $stuff/* $fs/
23 chown -R root:root $fs
24 find $fs -type f -name '*.py' -exec chmod a+x \{\} \;
25 }
27 post_install()
28 {
29 grep ^RUN_DAEMONS $1/etc/rcS.conf | grep -q "ajaxterm" || sed -i \
30 's/RUN_DAEMONS="/RUN_DAEMONS="ajaxterm /' $1/etc/rcS.conf
31 # Configure lighttpd server
32 if [ -f $1/usr/lib/lighttpd/mod_proxy.so ]; then
33 grep -q mod_proxy $1/etc/lighttpd/lighttpd.conf ||
34 cat >> $1/etc/lighttpd/lighttpd.conf <<EOT
35 server.modules += ( "mod_proxy" )
36 EOT
37 grep -q ajaxterm $1/etc/lighttpd/lighttpd.conf ||
38 cat >> $1/etc/lighttpd/lighttpd.conf <<EOT
39 proxy.server = ( "/ajaxterm/" =>
40 ( ( "host" => "127.0.0.1", "port" => 8022 ) )
41 )
42 EOT
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 # Configure apache server
50 if [ -f $1/etc/apache/httpd.conf ]; then
51 if [ ! -f $1/etc/apache/conf.d/ajaxterm ]; then
52 cat > $1/etc/apache/conf.d/ajaxterm <<EOT
53 <IfModule mod_proxy.c>
54 ProxyRequests Off
55 <Proxy *>
56 Order deny,allow
57 Allow from all
58 </Proxy>
59 ProxyPass /ajaxterm/ http://localhost:8022/
60 ProxyPassReverse /ajaxterm/ http://localhost:8022/
61 </IfModule>
62 EOT
63 if [ -z "$1" ]; then
64 # Start Web server.
65 /etc/init.d/apache stop
66 sleep 2
67 /etc/init.d/apache start
68 fi
69 fi
70 fi
71 [ -z "$1" ] && /etc/init.d/ajaxterm start
72 [ ! -f $1/usr/lib/lighttpd/mod_proxy.so -a \
73 ! -f $1/etc/apache/httpd.conf ] && cat <<EOT
74 --------
75 You should install either lighttpd
76 # tazpkg get-install lighttpd-ssl ; tazpkg get-install lighttpd-modules
77 or apache
78 # tazpkg get-install apache
79 and reconfigure
80 # tazpkg reconfigure ajaxterm
81 --------
82 EOT
83 }