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