1 |
slords |
1.1 |
%define realname smeserver-ajaxterm |
2 |
|
|
%define version 1.0.5 |
3 |
|
|
Summary: ajaxterm is a web-based terminal |
4 |
|
|
Name: %{realname} |
5 |
|
|
Version: %{version} |
6 |
|
|
Release: 0 |
7 |
|
|
BuildArch: noarch |
8 |
|
|
License: GPL |
9 |
|
|
Group: System Environment/Libraries |
10 |
|
|
Source: %{name}-%{version}.tar.gz |
11 |
|
|
Source1: Ajaxterm-0.10.tar.gz |
12 |
|
|
Packager: Michael Weinberger Michael.Weinberger@nedix.de |
13 |
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot |
14 |
|
|
URL: http://antony.lesuisse.org/qweb/trac/wiki/AjaxTerm |
15 |
|
|
Requires: smeserver-release > 7.1.3 |
16 |
|
|
|
17 |
|
|
%changelog |
18 |
|
|
* Thu Nov 15 2007 Michael Weinberger <mweinber@neddix.de> |
19 |
|
|
Version 1.0.5 |
20 |
|
|
Bug fix: SysV start: do not fall back do user root if user ajaxterm does not exist |
21 |
|
|
added config properties 'width' and 'height' |
22 |
|
|
|
23 |
|
|
* Thu Nov 15 2007 Michael Weinberger <mweinber@neddix.de> |
24 |
|
|
Version 1.0.4 |
25 |
|
|
added config property basicAuthUsers |
26 |
|
|
|
27 |
|
|
* Wed Nov 14 2007 Michael Weinberger <mweinber@neddix.de> |
28 |
|
|
Version 1.0.3 |
29 |
|
|
added config properties allowOnlyLocalhost and servicePort |
30 |
|
|
login with 'su' when localhost, otherwise with ssh |
31 |
|
|
Promtps for SSHPort at ssh login |
32 |
|
|
|
33 |
|
|
%description |
34 |
|
|
see http://wiki.contribs.org/Ajaxterm |
35 |
|
|
|
36 |
|
|
Usage: https://yourdomain.com/ajaxterm/index.html |
37 |
|
|
|
38 |
|
|
Configuration |
39 |
|
|
1) To allow only local login on localhost: |
40 |
|
|
config setprop Ajaxterm allowOnlyLocalhost yes |
41 |
|
|
service ajaxterm restart |
42 |
|
|
|
43 |
|
|
2) To allow ssh login on all hosts: |
44 |
|
|
config setprop Ajaxterm allowOnlyLocalhost no |
45 |
|
|
service ajaxterm restart |
46 |
|
|
|
47 |
|
|
3) Terminal size (default is 80 x 25) |
48 |
|
|
config setprop Ajaxterm width NEWWIDTH |
49 |
|
|
config setprop Ajaxterm height NEWHEIGHT |
50 |
|
|
service ajaxterm restart |
51 |
|
|
|
52 |
|
|
4) Basic Auth Users (Browser login) |
53 |
|
|
config setprop Ajaxterm basicAuthUsers "user [user] ..." |
54 |
|
|
expand-template /etc/httpd/conf/httpd.conf |
55 |
|
|
service httpd-e-smith restart |
56 |
|
|
|
57 |
|
|
5) Web alias (default: ajaxterm) |
58 |
|
|
config setprop Ajaxterm webAlias NEWALIAS |
59 |
|
|
expand-template /etc/httpd/conf/httpd.conf |
60 |
|
|
service httpd-e-smith restart |
61 |
|
|
|
62 |
|
|
6) Changing the ajaxterm service port (default is 8022): |
63 |
|
|
config setprop Ajaxterm servicePort NEWPORT |
64 |
|
|
expand-template /etc/httpd/conf/httpd.conf |
65 |
|
|
service httpd-e-smith restart |
66 |
|
|
service ajaxterm restart |
67 |
|
|
|
68 |
|
|
|
69 |
|
|
%prep |
70 |
|
|
%setup -n %{realname}-%{version} |
71 |
|
|
|
72 |
|
|
|
73 |
|
|
%build |
74 |
|
|
|
75 |
|
|
|
76 |
|
|
%install |
77 |
|
|
rm -rf $RPM_BUILD_ROOT |
78 |
|
|
tar xzvf $RPM_SOURCE_DIR/Ajaxterm-0.10.tar.gz |
79 |
|
|
mv Ajaxterm-0.10/* root/opt/ajaxterm |
80 |
|
|
ls root/opt/ajaxterm |
81 |
|
|
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
82 |
|
|
rm -f %{name}-%{version}-filelist |
83 |
|
|
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
84 |
|
|
--dir /opt/ajaxterm 'attr(0750,ajaxterm,www)' \ |
85 |
|
|
--file /opt/ajaxterm/ 'attr(0640,ajaxterm,www)' \ |
86 |
|
|
--file /opt/ajaxterm/ajaxterm.py 'attr(0550,ajaxterm,www)' \ |
87 |
|
|
--file /opt/ajaxterm/login.pl 'attr(0550,ajaxterm,www)' \ |
88 |
|
|
>> %{name}-%{version}-filelist |
89 |
|
|
find $RPM_BUILD_ROOT -depth -type l -print |\ |
90 |
|
|
sed "s@^$RPM_BUILD_ROOT@@g" >> %{name}-%{version}-filelist |
91 |
|
|
|
92 |
|
|
|
93 |
|
|
%clean |
94 |
|
|
[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT |
95 |
|
|
|
96 |
|
|
%pre |
97 |
|
|
/usr/sbin/useradd ajaxterm &> /dev/null |
98 |
|
|
/sbin/e-smith/config printtype Ajaxterm > /dev/null || /sbin/e-smith/config set Ajaxterm service |
99 |
|
|
exit 0; |
100 |
|
|
|
101 |
|
|
%post |
102 |
|
|
if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then |
103 |
|
|
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
104 |
|
|
/sbin/e-smith/service httpd-e-smith restart |
105 |
|
|
/sbin/e-smith/service ajaxterm restart |
106 |
|
|
fi |
107 |
|
|
exit 0; |
108 |
|
|
|
109 |
|
|
%preun |
110 |
|
|
if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then |
111 |
|
|
if [ $1 = 0 ] ; then # uninstall |
112 |
|
|
/sbin/e-smith/service ajaxterm stop |
113 |
|
|
fi |
114 |
|
|
fi |
115 |
|
|
exit 0; |
116 |
|
|
|
117 |
|
|
%postun |
118 |
|
|
if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then |
119 |
|
|
if [ $1 = 0 ] ; then # uninstall |
120 |
|
|
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
121 |
|
|
/sbin/e-smith/service httpd-e-smith restart |
122 |
|
|
fi |
123 |
|
|
fi |
124 |
|
|
if [ $1 = 0 ] ; then # uninstall |
125 |
|
|
/usr/sbin/userdel -r ajaxterm &> /dev/null |
126 |
|
|
fi |
127 |
|
|
exit 0; |
128 |
|
|
|
129 |
|
|
%files -f %{name}-%{version}-filelist |
130 |
|
|
%defattr(-,root,root) |
131 |
|
|
|