wok view ajaxterm/receipt @ rev 25770

dool,fake-hwclock,gtkam,xfce4-*-plugin,xlogo: add current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 06 11:29:23 2024 +0000 (2 months ago)
parents 1be16cc1cd50
children
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 LICENSE="PublicDomain LGPL"
9 WEB_SITE="https://github.com/antonylesuisse/qweb/tree/master/ajaxterm"
10 SOURCE="Ajaxterm"
11 TARBALL="$SOURCE-$VERSION.tar.gz"
12 WGET_URL="http://antony.lesuisse.org/software/ajaxterm/files/$TARBALL"
13 TAGS="web application"
15 DEPENDS="python"
16 SUGGESTED="apache lighttpd-ssl lighttpd-modules"
18 # What is the latest version available today?
19 current_version()
20 {
21 wget -O - https://github.com/antonylesuisse/qweb/commits/master 2>/dev/null | \
22 sed 's|",|&\n|g' | sed '/committedDate/!d;s|.*":"||;s|T.*||;s|-||g;q'
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 cook_pick_manpages $src/ajaxterm.1
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 genpkg_rules()
33 {
34 mkdir -p $fs/usr/share/ajaxterm
35 cp -a $src/*.py $src/*.js $src/*.css $src/*.html $fs/usr/share/ajaxterm
36 cp -a $stuff/* $fs/
37 chown -R root:root $fs
38 find $fs -type f -name '*.py' -exec chmod a+x \{\} \;
39 }
41 post_install()
42 {
43 grep ^RUN_DAEMONS "$1/etc/rcS.conf" | grep -q "ajaxterm" || sed -i \
44 's/RUN_DAEMONS="/RUN_DAEMONS="ajaxterm /' "$1/etc/rcS.conf"
45 # Configure lighttpd server
46 if [ -f "$1/usr/lib/lighttpd/mod_proxy.so" ]; then
47 grep -q mod_proxy "$1/etc/lighttpd/lighttpd.conf" ||
48 cat >> "$1/etc/lighttpd/lighttpd.conf" <<EOT
49 server.modules += ( "mod_proxy" )
50 EOT
51 grep -q ajaxterm "$1/etc/lighttpd/lighttpd.conf" ||
52 cat >> "$1/etc/lighttpd/lighttpd.conf" <<EOT
53 proxy.server = ( "/ajaxterm/" =>
54 ( ( "host" => "127.0.0.1", "port" => 8022 ) )
55 )
56 EOT
57 if [ -z "$1" ]; then
58 # Start Web server.
59 /etc/init.d/lighttpd stop
60 /etc/init.d/lighttpd start
61 fi
62 fi
63 # Configure apache server
64 if [ -f "$1/etc/apache/httpd.conf" ]; then
65 if [ ! -f "$1/etc/apache/conf.d/ajaxterm" ]; then
66 cat > "$1/etc/apache/conf.d/ajaxterm" <<EOT
67 <IfModule mod_proxy.c>
68 ProxyRequests Off
69 <Proxy *>
70 Order deny,allow
71 Allow from all
72 </Proxy>
73 ProxyPass /ajaxterm/ http://localhost:8022/
74 ProxyPassReverse /ajaxterm/ http://localhost:8022/
75 </IfModule>
76 EOT
77 if [ -z "$1" ]; then
78 # Start Web server.
79 /etc/init.d/apache stop
80 sleep 2
81 /etc/init.d/apache start
82 fi
83 fi
84 fi
85 [ -z "$1" ] && /etc/init.d/ajaxterm start
86 [ ! -f "$1/usr/lib/lighttpd/mod_proxy.so" -a \
87 ! -f "$1/etc/apache/httpd.conf" ] &&
88 [ -z "$quiet" ] && cat <<EOT
89 --------
90 You should install either lighttpd
91 # tazpkg get-install lighttpd-ssl ; tazpkg get-install lighttpd-modules
92 or apache
93 # tazpkg get-install apache
94 and reconfigure
95 # tazpkg reconfigure ajaxterm
96 --------
97 EOT
98 }