[tor/el6] Sync with fedora master

Jamie Nguyen jamielinux at fedoraproject.org
Tue Mar 5 00:18:14 UTC 2013


commit e6de76e0e62be502532a36120da41a48b0ead97f
Author: Jamie Nguyen <j at jamielinux.com>
Date:   Mon Mar 4 23:46:49 2013 +0000

    Sync with fedora master

 defaults-torrc => tor.defaults-torrc |    0
 tor.spec                             |  149 ++++++++++++++++++---------------
 2 files changed, 81 insertions(+), 68 deletions(-)
---
diff --git a/defaults-torrc b/tor.defaults-torrc
similarity index 100%
rename from defaults-torrc
rename to tor.defaults-torrc
diff --git a/tor.spec b/tor.spec
index 989142b..39fa6a7 100644
--- a/tor.spec
+++ b/tor.spec
@@ -1,89 +1,95 @@
-%global tor_user        toranon
-%global tor_group       toranon
-%global tor_homedir     %{_sharedstatedir}/tor
-%global tor_logdir      %{_localstatedir}/log/tor
 %global _hardened_build 1
 
-Name:              tor
-Version:           0.2.3.25
-Release:           6%{?dist}
-
-Summary:           Anonymizing overlay network for TCP (The onion router)
-Group:             System Environment/Daemons
-License:           BSD
-URL:               http://www.torproject.org
-
-Source0:           https://www.torproject.org/dist/tor-%{version}.tar.gz
-Source1:           https://www.torproject.org/dist/tor-%{version}.tar.gz.asc
-Source2:           tor.logrotate
-Source3:           tor.service
-Source4:           defaults-torrc
-
-BuildRequires:     libevent-devel >= 1.4.13
-BuildRequires:     openssl-devel >= 0.9.7
-Requires(pre):     shadow-utils
-Requires(post):    chkconfig
-Requires(preun):   chkconfig
-Requires(preun):   initscripts
-Requires(postun):  initscripts
-Requires:          torsocks
-
-Obsoletes:         tor-doc < 0.2.2
+%global toruser     toranon
+%global torgroup    toranon
+%global homedir     %{_localstatedir}/lib/%{name}
+%global logdir      %{_localstatedir}/log/%{name}
+%global rundir      %{_localstatedir}/run/%{name}
+
+Name:       tor
+Version:    0.2.3.25
+Release:    6%{?dist}
+Group:      System Environment/Daemons
+License:    BSD
+Summary:    Anonymizing overlay network for TCP (The onion router)
+URL:        https://www.torproject.org
+
+Source0:    https://www.torproject.org/dist/%{name}-%{version}.tar.gz
+Source1:    https://www.torproject.org/dist/%{name}-%{version}.tar.gz.asc
+# Upstream ship their own logrotate file. Ours only has 2 modifications:
+# use 'toranon' user, and use systemctl to reload.
+Source2:    tor.logrotate
+# This makes sure tor runs as 'toranon', logs to syslog at 'notice' level,
+# and writes to /var/lib/tor instead of /root/.tor directory.
+Source3:    tor.defaults-torrc
+Source10:   tor.service
+
+Obsoletes:  tor-doc < 0.2.2
+Provides:   tor-doc = %{version}-%{release}
+
+BuildRequires:    libevent-devel >= 1.4.13
+BuildRequires:    openssl-devel >= 0.9.7
+
+# /usr/bin/torify is now just a wrapper for torsocks and is only there for
+# backwards compatibility.
+Requires:         torsocks
+Requires(pre):    shadow-utils
+Requires(post):   chkconfig
+Requires(preun):  chkconfig
+Requires(preun):  initscripts
+Requires(postun): initscripts
 
 
 %description
 Tor is a connection-based low-latency anonymous communication system.
-This package provides the "tor" program, which serves as both a client
-and a relay node.
 
-Applications connect to the local Tor proxy using the SOCKS
-protocol. The tor client chooses a path through a set of relays, in
-which each relay knows its predecessor and successor, but no
-others. Traffic flowing down the circuit is unwrapped by a symmetric
-key at each relay, which reveals the downstream relay.
+Applications connect to the local Tor proxy using the SOCKS protocol. The
+local proxy chooses a path through a set of relays, in which each relay
+knows its predecessor and successor, but no others. Traffic flowing down
+the circuit is unwrapped by a symmetric key at each relay, which reveals
+the downstream relay.
 
 Warnings: Tor does no protocol cleaning.  That means there is a danger
 that application protocols and associated programs can be induced to
-reveal information about the initiator. Tor depends on Privoxy or
+reveal information about the initiator. Tor depends on Privoxy and
 similar protocol cleaners to solve this problem. This is alpha code,
 and is even more likely than released code to have anonymity-spoiling
-bugs. The present network is small -- this further reduces the
-strength of the anonymity provided. Tor is not presently suitable
-for high-stakes anonymity.
+bugs. The present network is very small -- this further reduces the
+strength of the anonymity provided. Tor is not presently suitable for
+high-stakes anonymity.
 
 
 %prep
-%setup -q -n tor-%{version}
+%setup -q
 
 
 %build
-%configure --with-tor-user=%{tor_user} --with-tor-group=%{tor_group} \
+%configure --with-tor-user=%{toruser} --with-tor-group=%{torgroup} \
     --docdir=%{_docdir}/%{name}-%{version}
 make %{?_smp_mflags}
 
 
 %install
-make install DESTDIR=%{buildroot}
-
-mv %{buildroot}%{_sysconfdir}/tor/torrc{.sample,}
+make install DESTDIR=$RPM_BUILD_ROOT
+mv $RPM_BUILD_ROOT%{_sysconfdir}/tor/torrc.sample \
+    $RPM_BUILD_ROOT%{_sysconfdir}/tor/torrc
 
-mkdir -p %{buildroot}%{tor_homedir}
-mkdir -p %{buildroot}%{tor_logdir}
-mkdir -p %{buildroot}%{_localstatedir}/run/tor
+mkdir -p $RPM_BUILD_ROOT%{logdir}
+mkdir -p $RPM_BUILD_ROOT%{homedir}
+mkdir -p $RPM_BUILD_ROOT%{rundir}
 
-install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/tor
-
-install -p -D -m 0755 contrib/torctl %{buildroot}%{_bindir}/torctl
-install -p -D -m 0755 %{SOURCE3} %{buildroot}%{_initrddir}/tor
-
-install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_datadir}/tor/defaults-torrc
+install -D -p -m 0755 %SOURCE10 $RPM_BUILD_ROOT%{_initrddir}/tor
+install -D -p -m 0644 %SOURCE2  $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/tor
+install -D -p -m 0644 %SOURCE3  $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults-torrc
+install -D -p -m 0755 contrib/torctl $RPM_BUILD_ROOT%{_bindir}/torctl
 
 
 %pre
-getent group %{tor_group} >/dev/null || groupadd -r %{tor_group}
-getent passwd %{tor_user} >/dev/null || \
-    useradd -r -g %{tor_group} -d %{tor_homedir} -s /sbin/nologin \
-    -c "Tor client" %{tor_user}
+getent group %{torgroup} >/dev/null || groupadd -r %{torgroup}
+getent passwd %{toruser} >/dev/null || \
+    useradd -r -s /sbin/nologin -d %{homedir} -M \
+    -c 'TOR anonymizing user' -g %{torgroup} %{toruser}
+exit 0
 
 %post
 /sbin/chkconfig --add tor
@@ -101,33 +107,40 @@ fi
 
 
 %files
-%doc ChangeLog LICENSE README ReleaseNotes doc/HACKING
+%doc LICENSE README ChangeLog ReleaseNotes doc/HACKING doc/*.html
 %{_bindir}/tor
-%{_bindir}/torctl
-%{_bindir}/torify
 %{_bindir}/tor-gencert
 %{_bindir}/tor-resolve
-%{_datadir}/tor
+%{_bindir}/torctl
+%{_bindir}/torify
 %{_mandir}/man1/tor.1*
-%{_mandir}/man1/torify.1*
 %{_mandir}/man1/tor-gencert.1*
 %{_mandir}/man1/tor-resolve.1*
+%{_mandir}/man1/torify.1*
+%dir %{_datadir}/tor
+%{_datadir}/tor/defaults-torrc
+%{_datadir}/tor/geoip
 %{_initrddir}/tor
+
 %dir %{_sysconfdir}/tor
-%attr(0644,root,%{tor_user}) %config(noreplace) %{_sysconfdir}/tor/torrc
-%config(noreplace) %{_sysconfdir}/logrotate.d/tor
 %config(noreplace) %{_sysconfdir}/tor/tor-tsocks.conf
-%attr(0700,%{tor_user},%{tor_group}) %dir %{tor_homedir}
-%attr(0700,%{tor_user},%{tor_group}) %dir %{tor_logdir}
-%attr(0700,%{tor_user},%{tor_group}) %dir %{_localstatedir}/run/tor
+%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/tor/torrc
+%config(noreplace) %{_sysconfdir}/logrotate.d/tor
+
+%attr(0700,%{toruser},%{torgroup}) %dir %{homedir}
+%attr(0700,%{toruser},%{torgroup}) %dir %{logdir}
+%attr(0700,%{toruser},%{torgroup}) %dir %{rundir}
 
 
 %changelog
 * Mon Mar 04 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.2.3.25-6
 - no need to change the default configuration file
 - do not include doc/TODO which doesn't contain anything useful
+- include doc/*.html
 - change /var/log/tor and /var/run/tor permissions to 0700
 - change /etc/tor/torrc permissions to 0644
+- whitespace changes and reorganization to make the spec more similar to
+  fedora master branch (to make maintenance more straightforward)
 
 * Wed Feb 27 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.2.3.25-5
 - add torsocks to Requires


More information about the scm-commits mailing list