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