011ba79
%global tor_user        toranon
011ba79
%global tor_group       toranon
011ba79
%global tor_homedir     %{_sharedstatedir}/tor
011ba79
%global tor_logdir      %{_localstatedir}/log/tor
011ba79
%global _hardened_build 1
011ba79
011ba79
Name:              tor
011ba79
Version:           0.2.3.25
dd63373
Release:           3%{?dist}
011ba79
011ba79
Summary:           Anonymizing overlay network for TCP (The onion router)
011ba79
Group:             System Environment/Daemons
011ba79
License:           BSD
011ba79
URL:               http://www.torproject.org
011ba79
011ba79
Source0:           https://www.torproject.org/dist/tor-%{version}.tar.gz
011ba79
Source1:           https://www.torproject.org/dist/tor-%{version}.tar.gz.asc
011ba79
Source2:           tor.logrotate
011ba79
Source3:           tor.service
011ba79
011ba79
BuildRequires:     libevent-devel >= 1.4.13
011ba79
BuildRequires:     openssl-devel >= 0.9.7
453f2f1
Requires(pre):     shadow-utils
011ba79
Requires(post):    chkconfig
011ba79
Requires(preun):   chkconfig
011ba79
Requires(preun):   initscripts
011ba79
Requires(postun):  initscripts
dd63373
011ba79
Obsoletes:         tor-doc < 0.2.2
481b5f8
481b5f8
d243e33
%description
d243e33
Tor is a connection-based low-latency anonymous communication system.
011ba79
This package provides the "tor" program, which serves as both a client
011ba79
and a relay node.
d243e33
011ba79
Applications connect to the local Tor proxy using the SOCKS
011ba79
protocol. The tor client chooses a path through a set of relays, in
011ba79
which each relay knows its predecessor and successor, but no
011ba79
others. Traffic flowing down the circuit is unwrapped by a symmetric
011ba79
key at each relay, which reveals the downstream relay.
d243e33
d243e33
Warnings: Tor does no protocol cleaning.  That means there is a danger
d243e33
that application protocols and associated programs can be induced to
011ba79
reveal information about the initiator. Tor depends on Privoxy or 
d243e33
similar protocol cleaners to solve this problem. This is alpha code,
d243e33
and is even more likely than released code to have anonymity-spoiling
011ba79
bugs. The present network is small -- this further reduces the
011ba79
strength of the anonymity provided. Tor is not presently suitable
011ba79
for high-stakes anonymity.
d243e33
481b5f8
d243e33
%prep
011ba79
%setup -q -n tor-%{version}
d243e33
d243e33
d243e33
%build
011ba79
%configure --with-tor-user=%{tor_user} --with-tor-group=%{tor_group} \
011ba79
    --docdir=%{_docdir}/%{name}-%{version}
d243e33
make %{?_smp_mflags}
d243e33
d243e33
d243e33
%install
011ba79
make install DESTDIR=%{buildroot}
011ba79
011ba79
mv %{buildroot}%{_sysconfdir}/tor/torrc{.sample,}
011ba79
sed -i -e "s|#DataDirectory.*$|DataDirectory %{tor_homedir}/tor|g" \
011ba79
    %{buildroot}%{_sysconfdir}/tor/torrc
011ba79
cat << EOF >> %{buildroot}%{_sysconfdir}/tor/torrc
011ba79
Log notice syslog
011ba79
User %{tor_user}
324f1e3
EOF
d243e33
011ba79
mkdir -p %{buildroot}%{tor_homedir}
011ba79
mkdir -p %{buildroot}%{tor_logdir}
011ba79
mkdir -p %{buildroot}%{_localstatedir}/run/tor
011ba79
011ba79
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/tor
d243e33
011ba79
install -p -D -m 0755 contrib/torctl %{buildroot}%{_bindir}/torctl
011ba79
install -p -D -m 0755 %{SOURCE3} %{buildroot}%{_initrddir}/tor
d243e33
d243e33
011ba79
%pre
011ba79
if [ $1 -eq 1 ]; then
453f2f1
    getent group %{tor_group} >/dev/null || groupadd -r %{tor_group}
453f2f1
    getent passwd %{tor_user} >/dev/null || \
453f2f1
        useradd -r -g %{tor_group} -d %{tor_homedir} -s /sbin/nologin \
453f2f1
        -c "Tor client" %{tor_user}
453f2f1
    exit 0
011ba79
fi
481b5f8
011ba79
%post
011ba79
/sbin/chkconfig --add tor
481b5f8
011ba79
%preun
011ba79
if [ $1 -eq 0 ] ; then
011ba79
    /sbin/service tor stop >/dev/null 2>&1
011ba79
    /sbin/chkconfig --del tor
011ba79
fi
481b5f8
011ba79
%postun
011ba79
if [ $1 -ge 1 ] ; then
011ba79
    /sbin/service tor condrestart >/dev/null 2>&1 || :
011ba79
fi
d243e33
d243e33
d243e33
%files
011ba79
%doc ChangeLog LICENSE README ReleaseNotes doc/HACKING doc/TODO
011ba79
%{_bindir}/tor
011ba79
%{_bindir}/torctl
011ba79
%{_bindir}/torify
011ba79
%{_bindir}/tor-gencert
011ba79
%{_bindir}/tor-resolve
011ba79
%{_datadir}/tor
011ba79
%{_mandir}/man1/tor.1*
011ba79
%{_mandir}/man1/torify.1*
011ba79
%{_mandir}/man1/tor-gencert.1*
011ba79
%{_mandir}/man1/tor-resolve.1*
011ba79
%{_initrddir}/tor
011ba79
%dir %{_sysconfdir}/tor
011ba79
%attr(0640,root,%{tor_user}) %config(noreplace) %{_sysconfdir}/tor/torrc
011ba79
%config(noreplace) %{_sysconfdir}/logrotate.d/tor
011ba79
%config(noreplace) %{_sysconfdir}/tor/tor-tsocks.conf
011ba79
%attr(0700,%{tor_user},%{tor_group}) %dir %{tor_homedir}
011ba79
%attr(0750,%{tor_user},%{tor_group}) %dir %{tor_logdir}
011ba79
%attr(0750,%{tor_user},%{tor_group}) %dir %{_localstatedir}/run/tor
481b5f8
481b5f8
d243e33
%changelog
dd63373
* Sat Dec 08 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.3.25-3
dd63373
- remove dependency on fedora-usermgmt
dd63373
453f2f1
* Sat Dec 08 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.3.25-2
453f2f1
- remove dependency on fedora-usermgmt-devel
453f2f1
011ba79
* Sun Nov 25 2012 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.3.25-1
011ba79
- rewrite package from scratch for simplicity and clarity
011ba79
- stick closer with upstream defaults
011ba79
- update to latest stable release
011ba79
dcdc14f
* Thu Mar 18 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.1.25-1200
dcdc14f
- updated to 0.2.1.25
dcdc14f
8992d11
* Thu Mar 11 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.1.24-1201
8992d11
- removed /var/lib/tor-data dir (Chen Lei)
8992d11
b0160cc
* Tue Mar  2 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.1.24-1200
b0160cc
- updated to 0.2.1.24
b0160cc
- require tor-core, not tor in -upstart (thx to Dave Jones)
b0160cc
0181ab6
* Mon Feb 15 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.1.23-1200
0181ab6
- updated to 0.2.1.23
0181ab6
71f0317
* Thu Jan 21 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.1.22-1200
71f0317
- updated to 0.2.1.22
71f0317
25bea37
* Thu Dec 31 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.1.21-1200
25bea37
- updated to 0.2.1.21
25bea37
ea09f5e
* Sat Nov 14 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.1.20-1200
ea09f5e
- updated URLs (#532373)
ea09f5e
- removed (inactive) update mechanism for GeoIP data; this might
ea09f5e
  reduce anonimity  (#532373)
ea09f5e
- use the pidfile at various places in the LSB initscript to operate
ea09f5e
  on the correct process (#532373)
ea09f5e
- set a higher 'nofile' limit in the upstart initscript to allow fast
ea09f5e
  relays; LSB users will have to add a 'ulimit -n' into /etc/sysconfig/tor
ea09f5e
  to get a similar effect (#532373)
ea09f5e
- let the LSB initscript wait until process exits within a certain
ea09f5e
  time; this fixes shutdown/restart problems when working as a server
ea09f5e
  (#532373)
ea09f5e
- fixed initng related typo in logrotate script (#532373)
ea09f5e
- removed <linux/netfilter_ipv4.h> hack; it is fixed upstream and/or
ea09f5e
  in the kernel sources
ea09f5e
- use %%postun, not %%post as a -upstart scriptlet and send INT, not
ea09f5e
  TERM signal to stop/restart daemon
ea09f5e
38eb2fb
* Sun Oct 25 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.1.20-1
38eb2fb
- updated to 0.2.1.20
38eb2fb
324f1e3
* Sat Sep 12 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.1.19-2
324f1e3
- workaround bug in redhat-lsb (#522053)
324f1e3
a0a2c71
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 0.2.1.19-1
a0a2c71
- rebuilt with new openssl
a0a2c71
158f965
* Sun Aug  9 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.1.19-0
158f965
- updated to 0.2.1.19
158f965
- rediffed patches
158f965
deb6a8a
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0.35-2
deb6a8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
deb6a8a
4883443
* Fri Jun 26 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.0.35-1
4883443
- updated to 0.2.0.35
4883443
- added '--quiet' to startup options (bug #495987)
14aa17d
- updated %%doc entries
4883443
fbe5024
* Wed May  6 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.0.34-4
fbe5024
- made it easy to rebuild package in RHEL by adding a 'noarch'
fbe5024
  conditional to enable/disable noarch subpackages
fbe5024
481b5f8
* Sat Mar  7 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.0.34-3
481b5f8
- added -upstart subpackage (-lsb still wins by default as there exists
481b5f8
  no end-user friendly solution for managing upstart initscripts)
481b5f8
f1bcd51
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0.34-2
f1bcd51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
f1bcd51
ba9fc1b
* Tue Feb 10 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.0.34-1
ba9fc1b
- updated to 0.2.0.34 (SECURITY: fixes DoS vulnerabilities)
ba9fc1b
4460497
* Thu Jan 22 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.0.33-1
4460497
- updated to 0.2.0.33 (SECURITY: fixed heap-corruption bug)
4460497
51f8f68
* Sun Jan 18 2009 Tomas Mraz <tmraz@redhat.com> - 0.2.0.32-2
51f8f68
- rebuild with new openssl
51f8f68
19c708b
* Sun Dec  7 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.0.32-1
19c708b
- updated to 0.2.0.32
19c708b
- removed -setgroups patch; supplementary groups are now set upstream
19c708b
2e599d2
* Sun Jul 20 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.2.0.30-1
5b8e530
- updated to 0.2.0.30; rediffed patches
2e599d2
- (re)enabled transparent proxy support by workarounding broken
2e599d2
  <linux/netfilter_ipv4.h> header
2e599d2
- moved the 'geoip' database to /var/lib/tor-data where it can be
2e599d2
  updated periodically
2e599d2
- built with -Wl,--as-needed
2e599d2
Nikolay Vladimirov b1da098
* Thu Jul 10 2008 Nikolay Vladimirov <nikolay@vladimiroff.com> - 0.1.2.19-3
Nikolay Vladimirov b1da098
- rebuild for new libevent
Nikolay Vladimirov b1da098
e98ad5b
* Wed Feb 13 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.2.19-2
e98ad5b
- added 'missingok' to logrotate script (#429402)
e98ad5b
ae3a018
* Tue Feb 12 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.2.19-1
ae3a018
- updated to 0.1.2.19
ae3a018
- use file based BR for latex
ae3a018
- improved 'status' method of initscript to return rc of 'pidofproc'
ae3a018
  instead of doing further manual tests.  Calling 'pidofproc' directly
ae3a018
  instead of within a subshell should workaround #432254 too.
ae3a018
e740077
* Sat Jan 26 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.1.2.18-4
e740077
- Update BuildRequires: tex(latex),
e740077
- BR: texlive-texmf-fonts seems also to be necessary
e740077
e740077
* Sat Jan 26 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.1.2.18-3
50e64c3
- Rebuild for new libevent.
50e64c3
bbc2d14
* Thu Dec 06 2007 Release Engineering <rel-eng at fedoraproject dot org> - 0.1.2.18-2
bbc2d14
- Rebuild for deps
bbc2d14
740a459
* Tue Oct 30 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.2.18-1
740a459
- updated to 0.1.2.18
740a459
cbea9b1
* Fri Aug 31 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.2.17-1
cbea9b1
- updated to 0.1.2.17
cbea9b1
1f89aa3
* Sat Aug 25 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.2.16-2
1f89aa3
- fixed open(2) issue
1f89aa3
17039a9
* Fri Aug  3 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.2.16-1
17039a9
- updated to 0.1.2.16 (SECURITY)
17039a9
03d84ae
* Sat Jul 28 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.2.15-1
03d84ae
- updated to 0.1.2.15
03d84ae
9a4d761
* Sat May 26 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.2.14-1
9a4d761
- updated to 0.1.2.14
9a4d761
126c378
* Wed Apr 25 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.2.13-1
126c378
- updated to 0.1.2.13
126c378
- minor cleanups; especially in the %%doc section
126c378
f5249f3
* Sun Apr  8 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.26-4
f5249f3
- rebuilt for (yet another) new libevent
f5249f3
632808c
* Mon Feb 26 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.26-3
632808c
- rebuilt for new libevent
632808c
36321bd
* Wed Jan 24 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.26-2
36321bd
- updated -setgroups patch (#224090, thx to Sami Farin)
36321bd
1ed7ca9
* Sun Dec 17 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.26-1
1ed7ca9
- updated to 0.1.1.26 (SECURITY)
1ed7ca9
- do not turn on logging by default; it's easier to say "we do not log
1ed7ca9
  anything" to the police instead of enumerating the logged event
1ed7ca9
  classes and trying to explain that they do not contain any valuable
1ed7ca9
  information
1ed7ca9
1ed7ca9
* Sun Nov 12 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.25-1
1ed7ca9
- updated to 0.1.1.25
1ed7ca9
965ed04
* Thu Oct  5 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.24-1
965ed04
- updated to 0.1.1.24
965ed04
c1d09ab
* Sat Sep 30 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-5
c1d09ab
- updated to recent fedora-usermgmt
c1d09ab
- minor cleanups
c1d09ab
- require only 'lsb-core-noarch' instead of whole 'lsb'
c1d09ab
3959dc5
* Tue Sep 26 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-4
3959dc5
- first FE release (review #175433)
3959dc5
d243e33
* Mon Sep 25 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-3
d243e33
- removed '.have-lsb' and related logic in logrotate script; check for
d243e33
  existence of the corresponding initscript instead of
d243e33
- fixed bare '%%' in changelog section
d243e33
d243e33
* Thu Sep 21 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-2
d243e33
- simplified things yet more and removed tsocks/torify too
d243e33
- build -lsb unconditionally
d243e33
d243e33
* Thu Sep 21 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-1
d243e33
- simplified spec file and removed -initng and -minit stuff
d243e33
d243e33
* Sun Aug 13 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.23-0
d243e33
- updated to 0.1.1.23
d243e33
d243e33
* Sat Jul  8 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.22-0
d243e33
- updated to 0.1.1.22
d243e33
d243e33
* Tue Jun 13 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.21-0
d243e33
- updated to 0.1.1.21
d243e33
d243e33
* Wed May 24 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.1.20-0
d243e33
- updated to 0.1.1.20; adjusted %%doc file-list
d243e33
- added (optional) -tsocks subpackage
d243e33
- use the more modern %%bcond_with* for specifying optional features
d243e33
d243e33
* Sun Feb 19 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.17-0
d243e33
- updated to 0.1.0.17
d243e33
d243e33
* Mon Jan 30 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.16-0.1
d243e33
- renamed the current main-package into a '-core' subpackage and
d243e33
  created a new main-package which requires both the 'tor-core'
d243e33
  subpackage and this with the current default init-method. This
d243e33
  allows 'yum install tor' to work better; because yum is not very
d243e33
  smart, the old packaging might install unwanted packages else.
d243e33
d243e33
* Wed Jan  4 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.16-0
d243e33
- updated to 0.1.0.16
d243e33
d243e33
* Fri Dec 23 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1.11
d243e33
- reworked the 'setgroups' patch so that 'tor' survives a SIGHUP
d243e33
- (re)added the 'reload' functionality to the lsb initscript and use
d243e33
  it in logrotate
d243e33
d243e33
* Fri Dec 23 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1.8
d243e33
- added ChangeLog to %%doc
d243e33
- made torrc not world-readable
d243e33
- added logrotate script
d243e33
d243e33
* Thu Dec 22 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1.4
d243e33
- updated initng scripts to initng-0.4.8 syntax
d243e33
- tweaked some Requires(...):
d243e33
- added ghostscript BuildRequires:
d243e33
- install initng scripts into the correct dir
d243e33
d243e33
* Thu Dec 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1.2
d243e33
- use relative UID of 19 instead of 18 due to conflicts with the
d243e33
  'munin' package
d243e33
d243e33
* Wed Dec 14 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1.1
d243e33
- added -minit subpackage
d243e33
d243e33
* Sat Dec 10 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.1.0.15-1
d243e33
- initial build