%define realname smeserver-ajaxterm %define version 1.0.5 Summary: ajaxterm is a web-based terminal Name: %{realname} Version: %{version} Release: 0 BuildArch: noarch License: GPL Group: System Environment/Libraries Source: %{name}-%{version}.tar.gz Source1: Ajaxterm-0.10.tar.gz Packager: Michael Weinberger Michael.Weinberger@nedix.de BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot URL: http://antony.lesuisse.org/qweb/trac/wiki/AjaxTerm Requires: smeserver-release > 7.1.3 %changelog * Thu Nov 15 2007 Michael Weinberger Version 1.0.5 Bug fix: SysV start: do not fall back do user root if user ajaxterm does not exist added config properties 'width' and 'height' * Thu Nov 15 2007 Michael Weinberger Version 1.0.4 added config property basicAuthUsers * Wed Nov 14 2007 Michael Weinberger Version 1.0.3 added config properties allowOnlyLocalhost and servicePort login with 'su' when localhost, otherwise with ssh Promtps for SSHPort at ssh login %description see http://wiki.contribs.org/Ajaxterm Usage: https://yourdomain.com/ajaxterm/index.html Configuration 1) To allow only local login on localhost: config setprop Ajaxterm allowOnlyLocalhost yes service ajaxterm restart 2) To allow ssh login on all hosts: config setprop Ajaxterm allowOnlyLocalhost no service ajaxterm restart 3) Terminal size (default is 80 x 25) config setprop Ajaxterm width NEWWIDTH config setprop Ajaxterm height NEWHEIGHT service ajaxterm restart 4) Basic Auth Users (Browser login) config setprop Ajaxterm basicAuthUsers "user [user] ..." expand-template /etc/httpd/conf/httpd.conf service httpd-e-smith restart 5) Web alias (default: ajaxterm) config setprop Ajaxterm webAlias NEWALIAS expand-template /etc/httpd/conf/httpd.conf service httpd-e-smith restart 6) Changing the ajaxterm service port (default is 8022): config setprop Ajaxterm servicePort NEWPORT expand-template /etc/httpd/conf/httpd.conf service httpd-e-smith restart service ajaxterm restart %prep %setup -n %{realname}-%{version} %build %install rm -rf $RPM_BUILD_ROOT tar xzvf $RPM_SOURCE_DIR/Ajaxterm-0.10.tar.gz mv Ajaxterm-0.10/* root/opt/ajaxterm ls root/opt/ajaxterm (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ --dir /opt/ajaxterm 'attr(0750,ajaxterm,www)' \ --file /opt/ajaxterm/ 'attr(0640,ajaxterm,www)' \ --file /opt/ajaxterm/ajaxterm.py 'attr(0550,ajaxterm,www)' \ --file /opt/ajaxterm/login.pl 'attr(0550,ajaxterm,www)' \ >> %{name}-%{version}-filelist find $RPM_BUILD_ROOT -depth -type l -print |\ sed "s@^$RPM_BUILD_ROOT@@g" >> %{name}-%{version}-filelist %clean [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT %pre /usr/sbin/useradd ajaxterm &> /dev/null /sbin/e-smith/config printtype Ajaxterm > /dev/null || /sbin/e-smith/config set Ajaxterm service exit 0; %post if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf /sbin/e-smith/service httpd-e-smith restart /sbin/e-smith/service ajaxterm restart fi exit 0; %preun if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then if [ $1 = 0 ] ; then # uninstall /sbin/e-smith/service ajaxterm stop fi fi exit 0; %postun if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then if [ $1 = 0 ] ; then # uninstall /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf /sbin/e-smith/service httpd-e-smith restart fi fi if [ $1 = 0 ] ; then # uninstall /usr/sbin/userdel -r ajaxterm &> /dev/null fi exit 0; %files -f %{name}-%{version}-filelist %defattr(-,root,root)