d243e3
## This package understands the following switches:
c1d09a
%bcond_without		fedora
c1d09a
d243e3
d243e3
%global username		toranon
c1d09a
%global uid			19
d243e3
%global homedir			%_var/lib/%name
d243e3
%global logdir			%_var/log/%name
d243e3
d243e3
%{!?release_func:%global release_func() %1%{?dist}}
d243e3
d243e3
Name:		tor
41aa13
Version:	0.1.1.26
965ed0
Release:	%release_func 1
d243e3
Group:		System Environment/Daemons
d243e3
License:	BSD
d243e3
Summary:	Anonymizing overlay network for TCP (The onion router)
d243e3
URL:		http://tor.eff.org
d243e3
Requires:	%name-core = %version-%release
d243e3
Requires:	%name-lsb  = %version-%release
d243e3
d243e3
d243e3
%package core
d243e3
Summary:	Core programs for tor
d243e3
Group:		System Environment/Daemons
d243e3
URL:		http://tor.eff.org
d243e3
Source0:	http://tor.eff.org/dist/%name-%version.tar.gz
d243e3
Source1:	http://tor.eff.org/dist/%name-%version.tar.gz.asc
d243e3
Source2:	tor.logrotate
d243e3
Patch0:		tor-0.1.0.15-setgroups.patch
c1d09a
BuildRoot:	%_tmppath/%name-%version-%release-root
d243e3
d243e3
BuildRequires:	libevent-devel openssl-devel transfig tetex-latex ghostscript
c1d09a
BuildRequires:	fedora-usermgmt-devel
c1d09a
Provides:		user(%username)  = %uid
c1d09a
Provides:		group(%username) = %uid
d243e3
Requires:		init(%name)
c1d09a
Requires(pre):		/etc/logrotate.d
c1d09a
Requires(postun):	/etc/logrotate.d
c1d09a
%{?FE_USERADD_REQ}
d243e3
d243e3
d243e3
%package lsb
d243e3
Summary:	LSB initscripts for tor
d243e3
Group:		System Environment/Daemons
d243e3
Provides:	init(%name) = lsb
d243e3
Requires:	%name-core =  %version-%release
d243e3
Source10:	tor.lsb
d243e3
Requires(pre):		%name-core
c1d09a
Requires(postun):	lsb-core-noarch %name-core
c1d09a
Requires(post):		lsb-core-noarch
c1d09a
Requires(preun):	lsb-core-noarch
d243e3
d243e3
d243e3
%description
d243e3
Tor is a connection-based low-latency anonymous communication system.
d243e3
d243e3
Applications connect to the local Tor proxy using the SOCKS protocol. The
d243e3
local proxy chooses a path through a set of relays, in which each relay
d243e3
knows its predecessor and successor, but no others. Traffic flowing down
d243e3
the circuit is unwrapped by a symmetric key at each relay, which reveals
d243e3
the downstream relay.
d243e3
d243e3
Warnings: Tor does no protocol cleaning.  That means there is a danger
d243e3
that application protocols and associated programs can be induced to
d243e3
reveal information about the initiator. Tor depends on Privoxy and
d243e3
similar protocol cleaners to solve this problem. This is alpha code,
d243e3
and is even more likely than released code to have anonymity-spoiling
d243e3
bugs. The present network is very small -- this further reduces the
d243e3
strength of the anonymity provided. Tor is not presently suitable for
d243e3
high-stakes anonymity.
d243e3
d243e3
d243e3
%description core
d243e3
Tor is a connection-based low-latency anonymous communication system.
d243e3
d243e3
This package provides the "tor" program, which serves as both a client
d243e3
and a relay node.
d243e3
d243e3
d243e3
%description lsb
d243e3
Tor is a connection-based low-latency anonymous communication system.
d243e3
d243e3
This package contains the LSB compliant initscripts to start the "tor"
d243e3
daemon.
d243e3
d243e3
d243e3
%prep
d243e3
%setup -q
d243e3
%patch0 -p1 -b .setgroups
d243e3
41aa13
sed -i -e 's!^\(\# *\)\?DataDirectory .*!DataDirectory %homedir/.tor!' src/config/torrc.sample.in
d243e3
cat <<eof>>src/config/torrc.sample.in
d243e3
Group %username
d243e3
User  %username
d243e3
EOF
d243e3
d243e3
d243e3
%build
d243e3
%configure
d243e3
make %{?_smp_mflags}
d243e3
make -C doc/design-paper tor-design.pdf
d243e3
d243e3
d243e3
%install
d243e3
rm -rf $RPM_BUILD_ROOT
d243e3
d243e3
make install DESTDIR=$RPM_BUILD_ROOT
d243e3
mv $RPM_BUILD_ROOT%_sysconfdir/tor/torrc{.sample,}
d243e3
d243e3
mkdir -p $RPM_BUILD_ROOT{%_sysconfdir/logrotate.d,%_initrddir,%logdir,%homedir,%_var/run/%name}
d243e3
d243e3
install -p -m0755 %SOURCE10 $RPM_BUILD_ROOT%_initrddir/tor
d243e3
install -p -m0644 %SOURCE2  $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/tor
d243e3
d243e3
d243e3
%pre core
c1d09a
%__fe_groupadd %uid -r %username &>/dev/null || :
c1d09a
%__fe_useradd  %uid -r -s /sbin/nologin -d %homedir -M          \
c1d09a
                    -c 'TOR anonymizing user' -g %username %username &>/dev/null || :
d243e3
d243e3
%postun core
c1d09a
%__fe_userdel  %username &>/dev/null || :
c1d09a
%__fe_groupdel %username &>/dev/null || :
d243e3
d243e3
d243e3
%post lsb
d243e3
/usr/lib/lsb/install_initd %_initrddir/tor
d243e3
d243e3
%preun lsb
d243e3
test "$1" != 0 || {
d243e3
	%_initrddir/tor stop &>/dev/null || :
d243e3
	/usr/lib/lsb/remove_initd %_initrddir/tor
d243e3
}
d243e3
d243e3
%postun lsb
d243e3
test "$1"  = 0 || %_initrddir/tor try-restart &>/dev/null
d243e3
d243e3
d243e3
%clean
d243e3
rm -rf $RPM_BUILD_ROOT
d243e3
d243e3
d243e3
%files
d243e3
%defattr(-,root,root,-)
d243e3
%doc doc/HACKING doc/TODO
d243e3
%doc doc/*.txt
d243e3
%doc doc/design-paper/tor-design.pdf
d243e3
%doc %lang(en) doc/website/*.en
d243e3
%doc %lang(es) doc/website/*.es
d243e3
%doc %lang(fr) doc/website/*.fr
d243e3
%doc %lang(it) doc/website/*.it
d243e3
%doc %lang(pt) doc/website/*.pt
d243e3
%doc %lang(ru) doc/website/*.ru
d243e3
%doc doc/website/*.css
d243e3
d243e3
d243e3
%files core
d243e3
%defattr(-,root,root,-)
d243e3
%doc AUTHORS INSTALL LICENSE README ChangeLog
d243e3
%dir               %_sysconfdir/tor
d243e3
%config(noreplace) %_sysconfdir/logrotate.d/tor
d243e3
%attr(0700,%username,%username) %dir %homedir
d243e3
%attr(0730,root,%username)      %dir %logdir
d243e3
%attr(0640,root,%username) %config(noreplace) %_sysconfdir/tor/torrc
d243e3
%_bindir/*
d243e3
%_mandir/man1/*
d243e3
d243e3
%exclude %_bindir/torify
d243e3
%exclude %_mandir/man1/torify*
d243e3
%exclude %_sysconfdir/tor/tor-tsocks.conf
d243e3
d243e3
d243e3
%files lsb
d243e3
  %defattr(-,root,root,-)
d243e3
  %config %_initrddir/*
d243e3
  %attr(0755,%username,%username) %dir %_var/run/%name
d243e3
d243e3
d243e3
%changelog
41aa13
* Sun Dec 17 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.26-1
41aa13
- updated to 0.1.1.26 (SECURITY)
41aa13
- do not turn on logging by default; it's easier to say "we do not log
41aa13
  anything" to the police instead of enumerating the logged event
41aa13
  classes and trying to explain that they do not contain any valuable
41aa13
  information
41aa13
44165a
* Sun Nov 12 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.25-1
44165a
- updated to 0.1.1.25
44165a
965ed0
* Thu Oct  5 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.24-1
965ed0
- updated to 0.1.1.24
965ed0
c1d09a
* Sat Sep 30 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-5
c1d09a
- updated to recent fedora-usermgmt
c1d09a
- minor cleanups
c1d09a
- require only 'lsb-core-noarch' instead of whole 'lsb'
c1d09a
3959dc
* Tue Sep 26 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-4
3959dc
- first FE release (review #175433)
3959dc
d243e3
* Mon Sep 25 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-3
d243e3
- removed '.have-lsb' and related logic in logrotate script; check for
d243e3
  existence of the corresponding initscript instead of
d243e3
- fixed bare '%%' in changelog section
d243e3
d243e3
* Thu Sep 21 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-2
d243e3
- simplified things yet more and removed tsocks/torify too
d243e3
- build -lsb unconditionally
d243e3
d243e3
* Thu Sep 21 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-1
d243e3
- simplified spec file and removed -initng and -minit stuff
d243e3
d243e3
* Sun Aug 13 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-0
d243e3
- updated to 0.1.1.23
d243e3
d243e3
* Sat Jul  8 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.22-0
d243e3
- updated to 0.1.1.22
d243e3
d243e3
* Tue Jun 13 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.21-0
d243e3
- updated to 0.1.1.21
d243e3
d243e3
* Wed May 24 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.20-0
d243e3
- updated to 0.1.1.20; adjusted %%doc file-list
d243e3
- added (optional) -tsocks subpackage
d243e3
- use the more modern %%bcond_with* for specifying optional features
d243e3
d243e3
* Sun Feb 19 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.17-0
d243e3
- updated to 0.1.0.17
d243e3
d243e3
* Mon Jan 30 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.16-0.1
d243e3
- renamed the current main-package into a '-core' subpackage and
d243e3
  created a new main-package which requires both the 'tor-core'
d243e3
  subpackage and this with the current default init-method. This
d243e3
  allows 'yum install tor' to work better; because yum is not very
d243e3
  smart, the old packaging might install unwanted packages else.
d243e3
d243e3
* Wed Jan  4 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.16-0
d243e3
- updated to 0.1.0.16
d243e3
d243e3
* Fri Dec 23 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1.11
d243e3
- reworked the 'setgroups' patch so that 'tor' survives a SIGHUP
d243e3
- (re)added the 'reload' functionality to the lsb initscript and use
d243e3
  it in logrotate
d243e3
d243e3
* Fri Dec 23 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1.8
d243e3
- added ChangeLog to %%doc
d243e3
- made torrc not world-readable
d243e3
- added logrotate script
d243e3
d243e3
* Thu Dec 22 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1.4
d243e3
- updated initng scripts to initng-0.4.8 syntax
d243e3
- tweaked some Requires(...):
d243e3
- added ghostscript BuildRequires:
d243e3
- install initng scripts into the correct dir
d243e3
d243e3
* Thu Dec 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1.2
d243e3
- use relative UID of 19 instead of 18 due to conflicts with the
d243e3
  'munin' package
d243e3
d243e3
* Wed Dec 14 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1.1
d243e3
- added -minit subpackage
d243e3
d243e3
* Sat Dec 10 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1
d243e3
- initial build