another changelog entry
[tor.git] / contrib / tor.spec.in
blob5d9c1356d7ac401ebc3c7f0728655a2213a17375
1 %define rellevel 2
2 %define relbase std.%{rellevel}
3 %define rhrel %([ -f /etc/redhat-release ] && (sed -e 's/^Red Hat Linux release //' -e 's/ .*$//' -e 's/\\./_/g' -e 's/^.*$/.rh&/' < /etc/redhat-release))
4 %define blddate %(date -u +"%Y%m%d%H%M")
5 %define release %{relbase}%{rhrel}.%{blddate}
7 %define initdir /etc/rc.d/init.d
9 Summary: tor: anonymizing overlay network for TCP
10 Name: tor
11 Version: @VERSION@
12 Vendor: R. Dingledine <arma@seul.org>
13 Release: %{release}
14 License: BSD-like
15 Group: Applications/Internet
16 URL: http://freehaven.net/tor/
18 Source0: http://freehaven.net/tor/dist/tor-%{version}.tar.gz
20 Requires(pre): shadow-utils, /usr/bin/id, /bin/date, /bin/sh
21 Requires(pre): %{_sbindir}/useradd, %{_sbindir}/groupadd
23 BuildRoot: %{_tmppath}/%{name}-%{version}-%{relbase}-root
25 %description
26 Tor is a connection-based low-latency anonymous communication system which
27 addresses many flaws in the original onion routing design.
29 In brief, Onion Routing is a connection-oriented anonymizing communication
30 service. Users choose a source-routed path through a set of nodes, and
31 negotiate a "virtual circuit" through the network, in which each node
32 knows its predecessor and successor, but no others. Traffic flowing down
33 the circuit is unwrapped by a symmetric key at each node, which reveals
34 the downstream node.
36 Basically Tor provides a distributed network of servers ("onion
37 routers"). Users bounce their tcp streams (web traffic, ftp, ssh, etc)
38 around the routers, and recipients, observers, and even the routers
39 themselves have difficulty tracking the source of the stream.
41 Note that Tor does no protocol cleaning. That means there is a danger that
42 application protocols and associated programs can be induced to reveal
43 information about the initiator. Tor depends on Privoxy and similar protocol
44 cleaners to solve this problem.
46 Client applications can use the Tor network by connecting to the local
47 onion proxy. If the application itself does not come with socks support
48 you can use a socks client such as tsocks. Some web browsers like mozilla
49 and web proxies like privoxy come with socks support, so you don't need an
50 extra socks client if you want to use Tor with them.
52 Remember that this is alpha code, and the network is very small -- Tor will
53 not provide anonymity currently.
55 This package provides the "tor" program, which serves as both a client
56 and a relay node. Scripts will automatically create a "tor" user and
57 group, set tor up to run as a daemon, and automatically start it at
58 installation time.
60 %prep
61 %setup -q
63 # Patch the startup script to use the right user and group IDs. Force
64 # the use of /bin/sh as the shell for the "tor" account.
65 ed -s contrib/tor.sh.in << '/EOF/' > /dev/null
66 ,s/^TORUSER=$/TORUSER=tor/
67 ,s/^TORGROUP=$/TORGROUP=tor/
68 ,s:/bin/su:/bin/su -s /bin/sh:
70 # Save and exit ed
73 /EOF/
75 %build
76 %configure
77 %__make
79 %install
80 %makeinstall
82 # Install init script.
83 %__mkdir_p ${RPM_BUILD_ROOT}%{initdir}
84 %__install -m 755 contrib/tor.sh ${RPM_BUILD_ROOT}%{initdir}/tor
86 # Directories that don't have any preinstalled files
87 %__mkdir_p -m 700 ${RPM_BUILD_ROOT}/var/lib/tor
88 %__mkdir_p -m 755 ${RPM_BUILD_ROOT}/var/run/tor
89 %__mkdir_p -m 755 ${RPM_BUILD_ROOT}/var/log/tor
91 %clean
92 [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
94 %pre
95 [ -f %{initdir}/tor ] && /sbin/service tor stop
96 if [ ! -n "`/usr/bin/id -g tor 2>/dev/null`" ]; then
97 # One would like to default the GID, but doing that properly would
98 # require thought.
99 %{_sbindir}/groupadd tor 2> /dev/null
101 if [ ! -n "`/usr/bin/id -u tor 2>/dev/null`" ]; then
102 # One would also like to default the UID, but doing that properly would
103 # also require thought.
104 if [ -x /sbin/nologin ]; then
105 %{_sbindir}/useradd -r -g tor -d / -s /sbin/nologin tor 2> /dev/null
106 else
107 %{_sbindir}/useradd -r -g tor -d / -s /bin/false tor 2> /dev/null
111 %post
112 /sbin/chkconfig --add tor
113 /sbin/chkconfig tor && /sbin/service tor start
115 %preun
116 /sbin/chkconfig tor && /sbin/service tor stop
117 /sbin/chkconfig --del tor
119 %files
120 %defattr(-,root,root)
121 %doc AUTHORS INSTALL LICENSE README
122 %{_mandir}/man*/*
123 %{_bindir}/tor
124 %{_bindir}/torify
125 %{initdir}/tor
126 %dir %{_sysconfdir}/tor/
127 %config(noreplace) %{_sysconfdir}/tor/torrc
128 %config(noreplace) %{_sysconfdir}/tor/dirservers
129 %config(noreplace) %{_sysconfdir}/tor/tor-tsocks.conf
130 %attr(-,tor,tor) %dir /var/lib/tor
131 %attr(-,tor,tor) %dir /var/run/tor
132 %attr(-,tor,tor) %dir /var/log/tor
134 %changelog
135 * Sat Jan 17 2004 John Bashinski <jbash@velvet.com>
136 - Basic spec file; tested with Red Hat 9.