[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Backport OSX packaging fixes



Update of /home/or/cvsroot/tor/contrib/osx
In directory moria.mit.edu:/tmp/cvs-serv1426/contrib/osx

Modified Files:
      Tag: tor-0_0_9-patches
	Tor TorBundleWelcome.rtf TorPostflight TorStartupInfo.plist 
	package.sh privoxy.config 
Log Message:
Backport OSX packaging fixes

Index: Tor
===================================================================
RCS file: /home/or/cvsroot/tor/contrib/osx/Tor,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- Tor	4 Jan 2005 05:38:59 -0000	1.1.2.3
+++ Tor	24 Mar 2005 22:43:02 -0000	1.1.2.4
@@ -1,11 +1,22 @@
 #!/bin/sh
 
-TORCONF=/Library/Tor/torrc
-TORDIR=/Library/Tor/var/lib/tor
+TORLOC=/Library/StartupItems/Tor/Tor.loc
+
+if [ -f $TORLOC ]; then
+ TORDIR=`cat /Library/StartupItems/Tor/Tor.loc`
+ if [ "x$TORDIR" = "x" -o ! -d $TORDIR -o ! -x $TORDIR/tor ]; then
+   TORDIR=/Library/Tor
+ fi
+else
+ TORDIR=/Library/Tor
+fi
+TORCONF=$TORDIR/torrc
+TORDATA=$TORDIR/var/lib/tor
 TORPID=/var/run/Tor.pid
 TORUSER=_tor
 TORGROUP=daemon
-TORCMD=/Library/Tor/tor
+TORCMD=$TORDIR/tor
+TORLOG=/var/log/tor/tor.log
 
 ##
 # Tor Service
@@ -24,7 +35,7 @@
 # Tentative
 # Making sure it is not running (I know it is not a best approarch)
 		killall tor 2>/dev/null
-		$TORCMD -f $TORCONF --runasdaemon 1 --pidfile $TORPID --datadirectory $TORDIR --user $TORUSER --group $TORGROUP &
+		$TORCMD -f "$TORCONF" --runasdaemon 1 --pidfile "$TORPID" --datadirectory "$TORDATA" --user "$TORUSER" --group "$TORGROUP" --log "notice file $TORLOG" &
 	fi
     fi
 }

Index: TorBundleWelcome.rtf
===================================================================
RCS file: /home/or/cvsroot/tor/contrib/osx/TorBundleWelcome.rtf,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- TorBundleWelcome.rtf	5 Jan 2005 19:33:55 -0000	1.1.2.3
+++ TorBundleWelcome.rtf	24 Mar 2005 22:43:02 -0000	1.1.2.4
@@ -20,4 +20,4 @@
 \
 Privoxy stands between your web browser and tor to make your web surfing experience safer.\
 \
-For more information, please visit http://www.privoxy.org/}
+For more information, please visit http://www.privoxy.org/}
\ No newline at end of file

Index: TorPostflight
===================================================================
RCS file: /home/or/cvsroot/tor/contrib/osx/TorPostflight,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- TorPostflight	4 Jan 2005 05:38:59 -0000	1.1.2.2
+++ TorPostflight	24 Mar 2005 22:43:02 -0000	1.1.2.3
@@ -10,7 +10,9 @@
 
 TORUSER=_tor
 TORGROUP=daemon
-TORDIR=/Library/Tor/var/lib/tor
+TARGET=$2/Library/Tor
+TORDIR=$TARGET/var/lib/tor
+LOGDIR=$TARGET/var/log/tor
 
 # Create user $TORUSER in group daemon.  If it's already there, great.
 $ADDSYSUSER $TORUSER "Tor System user" $TORDIR
@@ -19,12 +21,23 @@
 if [ ! -d $TORDIR ]; then
   mkdir -p $TORDIR
 fi
+if [ ! -d $LOGDIR ]; then
+  mkdir -p $LOGDIR
+fi
 # Check its permissions.
 chown $TORUSER $TORDIR
 chgrp daemon $TORDIR
 chmod 700 $TORDIR
+chown $TORUSER $LOGDIR
+chgrp daemon $LOGDIR
+chmod 700 $LOGDIR
 
-# 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 +45,21 @@
 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 .
+
+if [ ! -e /var/log/tor -o -L /var/log/tor ]; then
+  cd /var/log
+  rm -f tor
+  ln -sf $LOGDIR tor
+fi
+
+if [ ! -d /Library/StartupItems/Tor ]; then
+  mkdir -p /Library/StartupItems/Tor
+fi
+rm -f /Library/StartupItems/Tor/Tor.loc
+echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc

Index: TorStartupInfo.plist
===================================================================
RCS file: /home/or/cvsroot/tor/contrib/osx/TorStartupInfo.plist,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- TorStartupInfo.plist	19 Dec 2004 04:26:30 -0000	1.1.2.1
+++ TorStartupInfo.plist	24 Mar 2005 22:43:02 -0000	1.1.2.2
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>CFBundleGetInfoString</key>
-	<string>Tor Startup Script (experimental)</string>
+	<string>Tor Startup Script</string>
 	<key>CFBundleName</key>
 	<string>Tor Startup Script</string>
 	<key>CFBundleSortVersionString</key>

Index: package.sh
===================================================================
RCS file: /home/or/cvsroot/tor/contrib/osx/package.sh,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -d -r1.1.2.7 -r1.1.2.8
--- package.sh	4 Jan 2005 05:38:59 -0000	1.1.2.7
+++ package.sh	24 Mar 2005 22:43:02 -0000	1.1.2.8
@@ -48,7 +48,7 @@
 
 ### Make Tor package.
 make install DESTDIR=$BUILD_DIR/tor_packageroot
-mv $BUILD_DIR/tor_packageroot/Library/Tor/torrc.sample $BUILD_DIR/tor_packageroot/Library/Tor/torrc
+#mv $BUILD_DIR/tor_packageroot/Library/Tor/torrc.sample $BUILD_DIR/tor_packageroot/Library/Tor/torrc
 cp contrib/osx/ReadMe.rtf $BUILD_DIR/tor_resources
 #cp contrib/osx/License.rtf $BUILD_DIR/tor_resources
 cp contrib/osx/TorPostflight $BUILD_DIR/tor_resources/postflight

Index: privoxy.config
===================================================================
RCS file: /home/or/cvsroot/tor/contrib/osx/privoxy.config,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- privoxy.config	19 Dec 2004 04:26:30 -0000	1.1.2.1
+++ privoxy.config	24 Mar 2005 22:43:02 -0000	1.1.2.2
@@ -285,7 +285,7 @@
 #  
 #      The jarfile may grow to ridiculous sizes over time.
 #  
-jarfile jarfile
+#jarfile jarfile
 
 #  
 #  1.7. trustfile
@@ -568,7 +568,7 @@
 #      If you want to use CLF (Common Log Format), you should set
 #      "debug 512" ONLY and not enable anything else.
 #  
-debug   1    # show each GET/POST/CONNECT request
+#debug   1    # show each GET/POST/CONNECT request
 debug   4096 # Startup banner and warnings
 debug   8192 # Errors - *we highly recommended enabling this*