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