summaryrefslogtreecommitdiff
path: root/contrib/osx/TorPostflight
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-03-18 20:59:14 +0000
committerNick Mathewson <nickm@torproject.org>2005-03-18 20:59:14 +0000
commit4b400312de504885f722e5f726ce10527c43da1d (patch)
treee60e4512f6e6ee67a7d6e585332d9e8119a0f009 /contrib/osx/TorPostflight
parent7c29b65466ca0a6c4e4e43130815b3fcfb8cb718 (diff)
downloadtor-4b400312de504885f722e5f726ce10527c43da1d.tar.gz
tor-4b400312de504885f722e5f726ce10527c43da1d.zip
Mac packaging magic: make man pages useable, and do not overwrite existing torrc files.
svn:r3774
Diffstat (limited to 'contrib/osx/TorPostflight')
-rw-r--r--contrib/osx/TorPostflight18
1 files changed, 14 insertions, 4 deletions
diff --git a/contrib/osx/TorPostflight b/contrib/osx/TorPostflight
index 1a46fcd0f1..8919f376c9 100644
--- a/contrib/osx/TorPostflight
+++ b/contrib/osx/TorPostflight
@@ -10,7 +10,8 @@ fi
TORUSER=_tor
TORGROUP=daemon
-TORDIR=/Library/Tor/var/lib/tor
+TARGET=$2/Library/Tor
+TORDIR=$TARGET/var/lib/tor
# Create user $TORUSER in group daemon. If it's already there, great.
$ADDSYSUSER $TORUSER "Tor System user" $TORDIR
@@ -24,7 +25,12 @@ chown $TORUSER $TORDIR
chgrp daemon $TORDIR
chmod 700 $TORDIR
-# Ensure a symbolic link.
+# Create the configuration file only if there wan't one already.
+if [ ! -f $TARGET/torrc ]; then
+ cp $TARGET/torrc.sample $TARGET/torrc
+fi
+
+# Ensure symbolic links
cd /usr/bin
if [ -e /usr/bin/tor -a ! -L /usr/bin/tor ]; then
mv tor tor_old
@@ -32,5 +38,9 @@ fi
if [ -e /usr/bin/tor-resolve -a ! -L /usr/bin/tor-resolve ]; then
mv tor-resolve tor-resolve_old
fi
-ln -sf /Library/Tor/tor .
-ln -sf /Library/Tor/tor_resolve .
+ln -sf $TARGET/tor .
+ln -sf $TARGET/tor_resolve .
+
+cd /usr/share/man/man1
+MAN1=$TARGET/man/man1
+ln -sf $MAN1/*.1 .