[tor/f18] Stick closer to default upstream configuration

Jamie Nguyen jamielinux at fedoraproject.org
Mon Mar 4 23:14:42 UTC 2013


commit 109f25e2a66aec54b8ad8c4fa3b6c63b5d5c3756
Author: Jamie Nguyen <j at jamielinux.com>
Date:   Mon Mar 4 22:50:16 2013 +0000

    Stick closer to default upstream configuration

 tor.defaults-torrc |    3 +++
 tor.spec           |   16 ++++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/tor.defaults-torrc b/tor.defaults-torrc
new file mode 100644
index 0000000..7359f3a
--- /dev/null
+++ b/tor.defaults-torrc
@@ -0,0 +1,3 @@
+DataDirectory /var/lib/tor
+User toranon
+Log notice syslog
diff --git a/tor.spec b/tor.spec
index c70005d..7599a96 100644
--- a/tor.spec
+++ b/tor.spec
@@ -16,6 +16,7 @@ Requires:       %{name}-systemd  = %{version}-%{release}
 Source0:        https://www.torproject.org/dist/%{name}-%{version}.tar.gz
 Source1:        https://www.torproject.org/dist/%{name}-%{version}.tar.gz.asc
 Source2:        tor.logrotate
+Source3:        tor.defaults-torrc
 Source10:       tor.systemd.service
 
 Obsoletes:      tor-core    < 0:0.2.3.25-1801
@@ -69,10 +70,6 @@ make install DESTDIR=$RPM_BUILD_ROOT
 mv $RPM_BUILD_ROOT%{_sysconfdir}/tor/torrc{.sample,}
 sed -i -e "s|#DataDirectory.*$|DataDirectory %{homedir}/.tor|g" \
     $RPM_BUILD_ROOT%{_sysconfdir}/tor/torrc
-cat << EOF >> $RPM_BUILD_ROOT%{_sysconfdir}/tor/torrc
-Log notice syslog
-User %{toruser}
-EOF
 
 mkdir -p $RPM_BUILD_ROOT%{logdir}
 mkdir -p $RPM_BUILD_ROOT%{homedir}
@@ -82,6 +79,8 @@ install -D -p -m 0644 %{SOURCE10} \
     $RPM_BUILD_ROOT%_unitdir/%{name}.service
 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
 
 
 %pre
@@ -158,6 +157,15 @@ exit 0
   as matching how upstream have written their spec
 - use --with-tor-user=%%toruser and --with-tor-group=%%torgroup options when
   running %%configure, as recommended by upstream
+- remove all modifications to the default tor configuration file so that we
+  can stick more closely to upstream defaults
+- add /usr/share/tor/defaults-torrc file, which only contains two options:
+    DataDirectory /var/lib/tor
+    User toranon
+    Log notice syslog
+- when starting the tor service, use the following options as recommended by
+  upstream: --defaults-torrc /usr/share/tor/defaults-torrc -f /etc/tor/torrc
+
 
 
 


More information about the scm-commits mailing list