]> git.pld-linux.org Git - packages/anyterm.git/blobdiff - anyterm.spec
- pl
[packages/anyterm.git] / anyterm.spec
index f95469b83aa667aac8889609c894b53d7b596772..0eaa555784eb968c4203989f0c4f6b6a23ee8d70 100644 (file)
@@ -1,10 +1,14 @@
-#
+# TODO
+# - anygetty hangs due /bin/login calling vhangup()
+#   http://anyterm.org/1.0/config.html
+# - put anygetty to separate package?
 %define        apxs            /usr/sbin/apxs
 Summary:       Terminal emulator in a web browser
+Summary(pl):   Emulator terminala dzia³aj±cy w przegl±darce WWW
 Name:          anyterm
 Version:       1.1.4
-Release:       1
-Epoch:         1
+Release:       0.9
+Epoch:         0
 License:       GPL
 Group:         Networking/Daemons
 Source0:       http://anyterm.org/download/%{name}-%{version}.tbz2
@@ -14,60 +18,101 @@ URL:               http://anyterm.org/
 BuildRequires: apache-devel >= 2.0.52-2
 BuildRequires: apr-devel
 BuildRequires: rote-devel >= 0.2.8
-BuildRequires: rpmbuild(macros) >= 1.194
+BuildRequires: rpmbuild(macros) >= 1.228
 BuildRequires: %{apxs}
 Requires:      apache >= 2.0.52-2
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _httpdir        /home/services/httpd
+%define                _appdir         %{_datadir}/%{name}
 %define                _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
 %define                _sysconfdir /etc/httpd
 
 %description
-An apache module plus scripts to make a terminal within a web browser.
+An Apache module plus scripts to make a terminal within a web browser.
+
+%description -l pl
+Modu³ Apache'a i skrypty tworz±ce terminal w przegl±darce WWW.
 
 %prep
 %setup -q
 %patch0 -p1
+mv -f browser/.htaccess htaccess
 
 %build
-rm -rf $RPM_BUILD_ROOT
-cd apachemod
-%{__make} \
+%{__make} -C apachemod \
        INCLUDES='-I%{_includedir}/apr-util' \
-       APXS2=apxs \
+       APXS2=%{apxs} \
        APR_CONFIG=apr-1-config
-cd ..
-cd anygetty
-%{__make}
-cd ..
+%{__make} -C anygetty
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/httpd.conf,%{_pkglibdir},%{_mandir}/man8,%{_httpdir}}
+install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/httpd.conf,%{_pkglibdir},%{_mandir}/man8,%{_appdir}}
 
-cat > $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/70_anyterm.conf <<END
+cat > $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/70_anyterm.conf <<'END'
 LoadModule anyterm modules/%{name}.so
-Alias /%{name} "%{_httpdir}/%{name}"
-anyterm_command '%{_sbindir}/anygetty --remotehost "Anyterm: %h"'
+<IfModule anyterm>
+       Alias /%{name} "%{_appdir}"
+       # hangs on login:
+#      anyterm_command '%{_sbindir}/anygetty --remotehost "Anyterm: %h"'
+       # works for me:
+       anyterm_command "USER=%u; exec /usr/bin/ssh ${USER:+$USER@}localhost"
+
+       <Files anyterm-module>
+               SetHandler anyterm
+               <IfModule mod_setenv.c>
+                       # for this to work you need to change CustomLog:
+                       # CustomLog /path/to/logfile combined env=!DONTLOG
+                       # http://anyterm.org/security.html
+                       SetEnv DONTLOG
+               </IfModule>
+       </Files>
+
+       <IfModule !mod_auth.c>
+               <Location /%{name}>
+                       allow from all
+               </Location>
+       </IfModule>
+
+       <IfModule mod_auth.c>
+               <Location /%{name}>
+                       AuthType Basic
+                       AuthUserFile /etc/httpd/user
+                       AuthGroupFile /etc/httpd/group
+                       AuthName "AnyTerm"
+                       require group anyterm
+                       satisfy any
+                       order allow,deny
+               </Location>
+       </IfModule>
+</IfModule>
+# vim: filetype=apache ts=4 sw=4 et
 END
 
 install apachemod/.libs/%{name}.so $RPM_BUILD_ROOT%{_pkglibdir}/%{name}.so
-cp -a browser $RPM_BUILD_ROOT/%{_httpdir}/%{name}
+cp -a browser/* $RPM_BUILD_ROOT%{_appdir}
 install anygetty/anygetty $RPM_BUILD_ROOT/%{_sbindir}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+%service httpd restart
+
+%banner %{name} <<-EOF
+To use anygetty, you need to setuid it:
+chmod 4755 %{_sbindir}/anygetty
+EOF
+
+%preun
+if [ "$1" = "0" ]; then
+       %service -q httpd restart
+fi
+
 %files
 %defattr(644,root,root,755)
-%doc README
+%doc README CHANGELOG htaccess
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*
 %attr(755,root,root) %{_pkglibdir}/%{name}.so
 %attr(755,root,root) %{_sbindir}/anygetty
-%{_httpdir}/%{name}
-
-%post
-%banner %{name} <<EOF
-For full function, setuid %{_sbindir}/anygetty.
-EOF
+%{_appdir}
This page took 0.050795 seconds and 4 git commands to generate.