1 |
%define runuser toruser |
2 |
|
3 |
Name: tor |
4 |
Version: 0.2.2.32 |
5 |
Release: %mkrel 1 |
6 |
Summary: Anonymizing overlay network for TCP (The onion router) |
7 |
URL: http://www.torproject.org/ |
8 |
Group: Networking/Other |
9 |
License: BSD-like |
10 |
Requires(pre): rpm-helper |
11 |
Requires(post): rpm-helper |
12 |
Requires(preun): rpm-helper |
13 |
Requires(postun): rpm-helper |
14 |
Requires: openssl >= 0.9.6 |
15 |
Requires: tsocks |
16 |
BuildRequires: openssl-devel >= 0.9.6 |
17 |
BuildRequires: libevent-devel |
18 |
BuildRequires: zlib-devel |
19 |
BuildRequires: autoconf2.5 |
20 |
BuildRequires: transfig, tetex-latex |
21 |
BuildRequires: ghostscript |
22 |
Source0: http://www.torproject.org/dist/%{name}-%{version}.tar.gz |
23 |
Source1: %{name}.logrotate |
24 |
Source2: %{name}.init |
25 |
Source3: %{name}.sysconfig |
26 |
|
27 |
%description |
28 |
Tor is a connection-based low-latency anonymous communication system. |
29 |
|
30 |
This package provides the "tor" program, which serves as both a client and |
31 |
a relay node. Scripts will automatically create a "%{runuser}" user and |
32 |
group, and set tor up to run as a daemon when the system is rebooted. |
33 |
|
34 |
Applications connect to the local Tor proxy using the SOCKS |
35 |
protocol. The local proxy chooses a path through a set of relays, in |
36 |
which each relay knows its predecessor and successor, but no |
37 |
others. Traffic flowing down the circuit is unwrapped by a symmetric |
38 |
key at each relay, which reveals the downstream relay. |
39 |
|
40 |
Warnings: Tor does no protocol cleaning. That means there is a danger |
41 |
that application protocols and associated programs can be induced to |
42 |
reveal information about the initiator. Tor depends on Privoxy and |
43 |
similar protocol cleaners to solve this problem. This is alpha code, |
44 |
and is even more likely than released code to have anonymity-spoiling |
45 |
bugs. The present network is very small -- this further reduces the |
46 |
strength of the anonymity provided. Tor is not presently suitable |
47 |
for high-stakes anonymity. |
48 |
|
49 |
%prep |
50 |
%setup -q |
51 |
|
52 |
%build |
53 |
%configure2_5x |
54 |
%make |
55 |
make -C doc/design-paper tor-design.pdf |
56 |
|
57 |
%install |
58 |
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} |
59 |
|
60 |
%makeinstall |
61 |
|
62 |
%define _logdir %{_var}/log |
63 |
|
64 |
mkdir -p ${RPM_BUILD_ROOT}%{_initrddir} |
65 |
cat %{SOURCE2} > ${RPM_BUILD_ROOT}%{_initrddir}/%{name} |
66 |
chmod 0755 ${RPM_BUILD_ROOT}%{_initrddir}/%{name} |
67 |
|
68 |
install -p -m 644 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/torrc.sample ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/torrc |
69 |
|
70 |
mkdir -p -m 755 ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d |
71 |
cat %{SOURCE1} > ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name} |
72 |
|
73 |
mkdir -p -m 755 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/ |
74 |
cat %{SOURCE3} > ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name} |
75 |
|
76 |
mkdir -p -m 700 ${RPM_BUILD_ROOT}%{_localstatedir}/lib/%{name} |
77 |
mkdir -p -m 755 ${RPM_BUILD_ROOT}%{_var}/run/%{name} |
78 |
mkdir -p -m 755 ${RPM_BUILD_ROOT}%{_logdir}/%{name} |
79 |
|
80 |
# Bash completion |
81 |
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/bash_completion.d |
82 |
echo 'complete -F _command $filenames torify' > ${RPM_BUILD_ROOT}%{_sysconfdir}/bash_completion.d/%{name} |
83 |
|
84 |
%clean |
85 |
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} |
86 |
|
87 |
%pre |
88 |
%_pre_useradd %{runuser} / /bin/false |
89 |
|
90 |
%post |
91 |
%_post_service %{name} |
92 |
|
93 |
%preun |
94 |
%_preun_service %{name} |
95 |
rm -f %{_localstatedir}/%{name}/cached-directory |
96 |
rm -f %{_localstatedir}/%{name}/bw_accounting |
97 |
rm -f %{_localstatedir}/%{name}/control_auth_cookie |
98 |
rm -f %{_localstatedir}/%{name}/router.desc |
99 |
rm -f %{_localstatedir}/%{name}/fingerprint |
100 |
|
101 |
%postun |
102 |
%_postun_userdel %{runuser} |
103 |
%_postun_groupdel %{runuser} |
104 |
|
105 |
%files |
106 |
%defattr(-,root,root) |
107 |
%doc AUTHORS INSTALL LICENSE README ChangeLog doc/HACKING doc/TODO doc/design-paper/tor-design.pdf |
108 |
%{_mandir}/man*/* |
109 |
%{_bindir}/tor |
110 |
%{_bindir}/torify |
111 |
%{_bindir}/tor-resolve |
112 |
%{_bindir}/tor-gencert |
113 |
%config(noreplace) %attr(0755,%{runuser},%{runuser}) %{_initrddir}/%{name} |
114 |
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/logrotate.d/%{name} |
115 |
%dir %attr(0755,root,%{runuser}) %{_sysconfdir}/%{name}/ |
116 |
%config(noreplace) %attr(0644,root,%{runuser}) %{_sysconfdir}/%{name}/* |
117 |
%config(noreplace) %{_sysconfdir}/sysconfig/%{name} |
118 |
%attr(0700,%{runuser},%{runuser}) %dir %{_localstatedir}/lib/%{name} |
119 |
%attr(0750,%{runuser},%{runuser}) %dir %{_var}/run/%{name} |
120 |
%attr(0750,%{runuser},%{runuser}) %dir %{_logdir}/%{name} |
121 |
%{_sysconfdir}/bash_completion.d/%{name} |
122 |
%{_datadir}/%{name} |
123 |
|
124 |
|