]>
Commit | Line | Data |
---|---|---|
87aaa0d7 ER |
1 | # TODO |
2 | # - anygetty hangs due /bin/login calling vhangup() | |
3 | # http://anyterm.org/1.0/config.html | |
4 | # - put anygetty to separate package? | |
57ac7731 | 5 | %define apxs /usr/sbin/apxs |
6 | Summary: Terminal emulator in a web browser | |
7 | Name: anyterm | |
8 | Version: 1.1.4 | |
770fba2c | 9 | Release: 0.9 |
e1dd02cd | 10 | Epoch: 0 |
57ac7731 | 11 | License: GPL |
12 | Group: Networking/Daemons | |
13 | Source0: http://anyterm.org/download/%{name}-%{version}.tbz2 | |
14 | # Source0-md5: cf841703b7438866e573f5a33137ff6f | |
8785aef2 | 15 | Patch0: %{name}-makefile.patch |
57ac7731 | 16 | URL: http://anyterm.org/ |
17 | BuildRequires: apache-devel >= 2.0.52-2 | |
18 | BuildRequires: apr-devel | |
19 | BuildRequires: rote-devel >= 0.2.8 | |
ecd95c79 | 20 | BuildRequires: rpmbuild(macros) >= 1.228 |
57ac7731 | 21 | BuildRequires: %{apxs} |
22 | Requires: apache >= 2.0.52-2 | |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
ecd95c79 | 25 | %define _appdir %{_datadir}/%{name} |
8785aef2 ER |
26 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) |
27 | %define _sysconfdir /etc/httpd | |
57ac7731 | 28 | |
29 | %description | |
30 | An apache module plus scripts to make a terminal within a web browser. | |
31 | ||
32 | %prep | |
33 | %setup -q | |
34 | %patch0 -p1 | |
ecd95c79 | 35 | mv -f browser/.htaccess htaccess |
57ac7731 | 36 | |
37 | %build | |
3f2c16d7 | 38 | %{__make} -C apachemod \ |
8785aef2 | 39 | INCLUDES='-I%{_includedir}/apr-util' \ |
ecd95c79 | 40 | APXS2=%{apxs} \ |
57ac7731 | 41 | APR_CONFIG=apr-1-config |
3f2c16d7 | 42 | %{__make} -C anygetty |
57ac7731 | 43 | |
44 | %install | |
45 | rm -rf $RPM_BUILD_ROOT | |
ecd95c79 | 46 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/httpd.conf,%{_pkglibdir},%{_mandir}/man8,%{_appdir}} |
57ac7731 | 47 | |
cca3cb31 | 48 | cat > $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/70_anyterm.conf <<'END' |
57ac7731 | 49 | LoadModule anyterm modules/%{name}.so |
ecd95c79 ER |
50 | <IfModule anyterm> |
51 | Alias /%{name} "%{_appdir}" | |
cca3cb31 ER |
52 | # hangs on login: |
53 | # anyterm_command '%{_sbindir}/anygetty --remotehost "Anyterm: %h"' | |
54 | # works for me: | |
55 | anyterm_command "USER=%u; exec /usr/bin/ssh ${USER:+$USER@}localhost" | |
ecd95c79 ER |
56 | |
57 | <Files anyterm-module> | |
58 | SetHandler anyterm | |
87aaa0d7 ER |
59 | <IfModule mod_setenv.c> |
60 | # for this to work you need to change CustomLog: | |
61 | # CustomLog /path/to/logfile combined env=!DONTLOG | |
62 | # http://anyterm.org/security.html | |
63 | SetEnv DONTLOG | |
64 | </IfModule> | |
ecd95c79 | 65 | </Files> |
cca3cb31 | 66 | |
770fba2c ER |
67 | <IfModule !mod_auth.c> |
68 | <Location /%{name}> | |
69 | allow from all | |
70 | </Location> | |
71 | </IfModule> | |
cca3cb31 | 72 | |
770fba2c ER |
73 | <IfModule mod_auth.c> |
74 | <Location /%{name}> | |
75 | AuthType Basic | |
76 | AuthUserFile /etc/httpd/user | |
77 | AuthGroupFile /etc/httpd/group | |
78 | AuthName "AnyTerm" | |
79 | require group anyterm | |
80 | satisfy any | |
81 | order allow,deny | |
82 | </Location> | |
83 | </IfModule> | |
ecd95c79 ER |
84 | </IfModule> |
85 | # vim: filetype=apache ts=4 sw=4 et | |
57ac7731 | 86 | END |
87 | ||
88 | install apachemod/.libs/%{name}.so $RPM_BUILD_ROOT%{_pkglibdir}/%{name}.so | |
ecd95c79 | 89 | cp -a browser/* $RPM_BUILD_ROOT%{_appdir} |
57ac7731 | 90 | install anygetty/anygetty $RPM_BUILD_ROOT/%{_sbindir} |
91 | ||
92 | %clean | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
ecd95c79 ER |
95 | %post |
96 | %service httpd restart | |
97 | ||
db9d5550 ER |
98 | %banner %{name} <<-EOF |
99 | To use anygetty, you need to setuid it: | |
100 | chmod 4755 %{_sbindir}/anygetty | |
101 | EOF | |
ecd95c79 ER |
102 | |
103 | %preun | |
104 | if [ "$1" = "0" ]; then | |
105 | %service -q httpd restart | |
106 | fi | |
107 | ||
57ac7731 | 108 | %files |
109 | %defattr(644,root,root,755) | |
3f2c16d7 | 110 | %doc README CHANGELOG htaccess |
8785aef2 | 111 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/* |
57ac7731 | 112 | %attr(755,root,root) %{_pkglibdir}/%{name}.so |
113 | %attr(755,root,root) %{_sbindir}/anygetty | |
ecd95c79 | 114 | %{_appdir} |