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