wok-next view ajaxterm/receipt @ rev 21727

created recipe for vbindiff
author Hans-G?nter Theisgen
date Sat Nov 21 14:32:44 2020 +0100 (2020-11-21)
parents 21ab7a6eb192
children
line source
1 # SliTaz package receipt v2.
3 PACKAGE="ajaxterm"
4 VERSION="0.11"
5 COMMIT="2eaa3e989782d8259a12c8cb7d6204433ae19264"
6 CATEGORY="network"
7 SHORT_DESC="Login terminal for the web"
8 MAINTAINER="pascal.bellard@slitaz.org"
9 LICENSE="PublicDomain LGPL"
10 WEB_SITE="https://github.com/antonylesuisse/qweb/tree/master/ajaxterm"
11 HOST_ARCH="any"
13 TARBALL="ajaxterm-$VERSION-$COMMIT.tar.gz"
14 WGET_URL="https://sources.archlinux.org/other/community/ajaxterm/$TARBALL"
16 DEPENDS_std="python"
17 SUGGESTED_std="apache lighttpd-ssl lighttpd-modules"
18 TAGS_std="web application"
20 compile_rules() {
21 ./configure --prefix=/usr
23 install -Dm755 ajaxterm.bin $install/usr/bin/ajaxterm
25 mkdir -p $install/usr/share/ajaxterm/
26 install -m644 ajaxterm.css ajaxterm.html qweb.py *.js $install/usr/share/ajaxterm/
27 install -m755 ajaxterm.py $install/usr/share/ajaxterm/
29 install -Dm755 $stuff/etc/init.d/ajaxterm $install/etc/init.d/ajaxterm
31 cook_pick_manpages $src/ajaxterm.1
33 cook_pick_docs $stuff/README.md
35 # Note, $stuff/usr/ still contain some rewritten files for the previous
36 # Ajaxterm version. I don't know how they are compatible with this newer
37 # version and don't use them at the moment. It would be much better if
38 # the patch were used...
39 }
41 post_install() {
42 grep ^RUN_DAEMONS "$1/etc/rcS.conf" | grep -q "ajaxterm" ||
43 sed -i '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
64 # Configure apache server
65 if [ -f "$1/etc/apache/httpd.conf" ]; then
66 if [ ! -f "$1/etc/apache/conf.d/ajaxterm" ]; then
67 cat > "$1/etc/apache/conf.d/ajaxterm" <<EOT
68 <IfModule mod_proxy.c>
69 ProxyRequests Off
70 <Proxy *>
71 Order deny,allow
72 Allow from all
73 </Proxy>
74 ProxyPass /ajaxterm/ http://localhost:8022/
75 ProxyPassReverse /ajaxterm/ http://localhost:8022/
76 </IfModule>
77 EOT
78 if [ -z "$1" ]; then
79 # Start Web server.
80 /etc/init.d/apache stop
81 sleep 2
82 /etc/init.d/apache start
83 fi
84 fi
85 fi
87 [ -z "$1" ] && /etc/init.d/ajaxterm start
89 [ ! -f "$1/usr/lib/lighttpd/mod_proxy.so" -a \
90 ! -f "$1/etc/apache/httpd.conf" ] &&
91 [ -z "$quiet" ] && cat <<EOT
93 .-------------------------------------.
94 | You should install either lighttpd: |
95 | # tazpkg -gi lighttpd-ssl |
96 | # tazpkg -gi lighttpd-modules |
97 | |
98 | or apache: |
99 | # tazpkg -gi apache |
100 | |
101 | and reconfigure: |
102 | # tazpkg reconfigure ajaxterm |
103 '-------------------------------------'
104 EOT
105 }