aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lewman <andrew@torproject.org>2008-01-08 01:50:28 +0000
committerAndrew Lewman <andrew@torproject.org>2008-01-08 01:50:28 +0000
commit136c7482aa87457ef04725460eab73fec5131cad (patch)
treec75c3a4cfce97d50882a2613fc35eeb518319a1c
parenta0eb902277dd8b99bfa53f131149ec6aa6dd55ab (diff)
downloadtor-136c7482aa87457ef04725460eab73fec5131cad.tar.gz
tor-136c7482aa87457ef04725460eab73fec5131cad.zip
Backport: the alpha installer for osx has been through four release,
consider it well tested. svn:r13065
-rw-r--r--contrib/osx/Makefile.am4
-rw-r--r--contrib/osx/ReadMe.rtf2
-rwxr-xr-xcontrib/osx/Tor13
-rw-r--r--contrib/osx/TorBundleDesc.plist.in4
-rw-r--r--contrib/osx/TorBundleInfo.plist.in6
-rwxr-xr-xcontrib/osx/TorBundleWelcome.rtf35
-rw-r--r--contrib/osx/TorPostflight58
-rw-r--r--contrib/osx/TorPreFlight42
-rw-r--r--contrib/osx/TorbuttonDesc.plist10
-rw-r--r--contrib/osx/TorbuttonInfo.plist22
-rwxr-xr-xcontrib/osx/addsysuser111
-rw-r--r--contrib/osx/package.sh41
-rw-r--r--contrib/osx/package_list.txt1
-rwxr-xr-xcontrib/osx/uninstall_tor_bundle.sh6
14 files changed, 265 insertions, 90 deletions
diff --git a/contrib/osx/Makefile.am b/contrib/osx/Makefile.am
index 5fd70ecd98..db96efe47c 100644
--- a/contrib/osx/Makefile.am
+++ b/contrib/osx/Makefile.am
@@ -8,5 +8,5 @@ EXTRA_DIST = PrivoxyConfDesc.plist PrivoxyConfInfo.plist \
TorInfo.plist.in TorStartupDesc.plist.in TorStartupInfo.plist \
package.sh privoxy.config TorPostflight addsysuser \
Tor_Uninstaller.applescript uninstall_tor_bundle.sh \
- package_list.txt tor_logo.gif \
- TorPreFlight
+ TorbuttonInfo.plist TorbuttonDesc.plist \
+ package_list.txt tor_logo.gif TorPreFlight
diff --git a/contrib/osx/ReadMe.rtf b/contrib/osx/ReadMe.rtf
index 8922760b53..cf335c3880 100644
--- a/contrib/osx/ReadMe.rtf
+++ b/contrib/osx/ReadMe.rtf
@@ -4,4 +4,4 @@
\margl1440\margr1440\vieww9000\viewh9000\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-\f0\fs24 \cf0 Tor is a toolset for a wide range of organizations and people who want to improve their safety and security on the Internet. Using Tor can help you anonymize web browsing and publishing, instant messaging, IRC, SSH, and more. Tor also provides a platform on which software developers can build new applications with built-in anonymity, safety, and privacy features.} \ No newline at end of file
+\f0\fs24 \cf0 Tor is a toolset for a wide range of organizations and people who want to improve their safety and security on the Internet. Using Tor can help you anonymize web browsing and publishing, instant messaging, IRC, SSH, and more. Tor also provides a platform on which software developers can build new applications with built-in anonymity, safety, and privacy features.}
diff --git a/contrib/osx/Tor b/contrib/osx/Tor
index 901759c426..26697720fc 100755
--- a/contrib/osx/Tor
+++ b/contrib/osx/Tor
@@ -26,21 +26,20 @@ if [ -x /usr/bin/sw_vers ]; then
OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2`
case "$OSVER" in
"10.5") OS="leopard" ARCH="universal";;
- "10.4") OS="tiger" ARCH="universal";;
- "10.3") OS="panther" ARCH="ppc";;
- "10.2") OS="jaguar" ARCH="ppc";;
- "10.1") OS="puma" ARCH="ppc";;
- "10.0") OS="cheetah" ARCH="ppc";;
+ "10.4") OS="tiger" ARCH="universal";;
+ "10.3") OS="panther" ARCH="ppc";;
+ "10.2") OS="jaguar" ARCH="ppc";;
+ "10.1") OS="puma" ARCH="ppc";;
+ "10.0") OS="cheetah" ARCH="ppc";;
esac
else
OS="unknown"
fi
-
+
if [ $ARCH != "universal" ]; then
export EVENT_NOKQUEUE=1
fi
-
##
# Tor Service
##
diff --git a/contrib/osx/TorBundleDesc.plist.in b/contrib/osx/TorBundleDesc.plist.in
index 60b4a696c0..a70a0691a9 100644
--- a/contrib/osx/TorBundleDesc.plist.in
+++ b/contrib/osx/TorBundleDesc.plist.in
@@ -5,9 +5,9 @@
<key>IFPkgDescriptionDeleteWarning</key>
<string></string>
<key>IFPkgDescriptionDescription</key>
- <string>Bundled package of Tor @VERSION@ and Privoxy.</string>
+ <string>Bundled package of Tor @VERSION@, Privoxy 3.0.6, and Torbutton.</string>
<key>IFPkgDescriptionTitle</key>
- <string>Tor - Privoxy Bundle</string>
+ <string>Tor - Privoxy - Torbutton Bundle</string>
<key>IFPkgDescriptionVersion</key>
<string>@VERSION@</string>
</dict>
diff --git a/contrib/osx/TorBundleInfo.plist.in b/contrib/osx/TorBundleInfo.plist.in
index 16cc83694e..e477e5865d 100644
--- a/contrib/osx/TorBundleInfo.plist.in
+++ b/contrib/osx/TorBundleInfo.plist.in
@@ -38,6 +38,12 @@
<key>IFPkgFlagPackageSelection</key>
<string>selected</string>
</dict>
+ <dict>
+ <key>IFPkgFlagPackageLocation</key>
+ <string>torbutton.pkg</string>
+ <key>IFPkgFlagPackageSelection</key>
+ <string>selected</string>
+ </dict>
</array>
<key>IFPkgFormatVersion</key>
<real>0.10000000149011612</real>
diff --git a/contrib/osx/TorBundleWelcome.rtf b/contrib/osx/TorBundleWelcome.rtf
index 63ff45646d..8b08dd31d1 100755
--- a/contrib/osx/TorBundleWelcome.rtf
+++ b/contrib/osx/TorBundleWelcome.rtf
@@ -1,23 +1,38 @@
-{\rtf1\mac\ansicpg10000\cocoartf102
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;}
+{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
+{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Oblique;\f2\fswiss\fcharset77 Helvetica-Bold;
+}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh9000\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
-\f0\fs24 \cf0 Welcome to Tor - Privoxy Bundle installer.\
-This will install Tor and privoxy in your computer.\
+\f0\fs24 \cf0 Welcome to Tor - Privoxy - Torbutton Bundle installer.\
+This will install Tor, Privoxy, and Torbutton in your computer.\
\
-\f1\b Tor and Privoxy are separate products.\
+\f1\i Tor, Privoxy, and Torbutton are separate products.\
They are packaged together for your convenience.
+\f2\i0\b \
+
\f0\b0 \
-\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-\cf0 Tor is a system for using the Internet anonymously, and allowing\
+
+\f2\b \cf0 Tor
+\f0\b0 is a system for using the Internet anonymously, and allowing\
others to do so.\
\
-For more information, please visit https://www.torproject.org/\
+ For more information, please visit https://www.torproject.org/\
\
-Privoxy stands between your web browser and Tor to make your web surfing experience safer.\
+
+\f2\b Privoxy
+\f0\b0 stands between your web browser and Tor to make your web surfing experience safer.\
+\
+ For more information, please visit http://www.privoxy.org/\
+\
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
+
+\f2\b \cf0 Torbutton
+\f0\b0 is a 1-click way for Firefox users to enable or disable the browser's use of Tor.
+\f1\i Torbutton will not install if you do not have Firefox installed.
+\f0\i0 \
\
-For more information, please visit http://www.privoxy.org/}
+ For more information, please visit https://torbutton.torproject.org/}
diff --git a/contrib/osx/TorPostflight b/contrib/osx/TorPostflight
index c1108c05f8..ec117a56eb 100644
--- a/contrib/osx/TorPostflight
+++ b/contrib/osx/TorPostflight
@@ -1,4 +1,37 @@
#!/bin/sh
+# ====================================================================
+# TorPostFlight is distributed under this license
+#
+# Copyright (c) 2006 Andrew Lewman
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#
+# * Neither the names of the copyright owners nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ======================================================================
# TorPostflight gets invoked after any install or upgrade.
@@ -13,6 +46,7 @@ TORGROUP=daemon
TARGET=$2/Library/Tor
TORDIR=$TARGET/var/lib/tor
LOGFILE=/var/log/tor.log
+TORBUTTON_VERSION="1.0.4.01-fx+tb"
# Check defaults for TARGET
if [ "$TARGET" == "//Library/Tor" ]; then
@@ -55,8 +89,8 @@ ln -sf $TARGET/tor .
ln -sf $TARGET/tor-resolve .
cd /usr/share/man/man1
-MAN1=$TARGET/man/man1
-ln -sf $MAN1/*.1 .
+MAN1=$TARGET/share/man/man1
+#ln -sf $MAN1/*.1 .
if [ -d /Library/StartupItems/Privoxy ]; then
find /Library/StartupItems/Privoxy -print0 | xargs -0 chown root:wheel
@@ -70,12 +104,12 @@ fi
# Copy Uninstaller
if [ -f $PACKAGE_PATH/Contents/Resources/Tor_Uninstaller.applescript ]; then
cp $PACKAGE_PATH/Contents/Resources/Tor_Uninstaller.applescript $TARGET/Tor_Uninstaller.applescript
- chmod 555 $TARGET/Tor_Uninstaller.applescript
+ chmod 550 $TARGET/Tor_Uninstaller.applescript
fi
if [ -f $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh ]; then
cp $PACKAGE_PATH/Contents/Resources/uninstall_tor_bundle.sh $TARGET/uninstall_tor_bundle.sh
- chmod 555 $TARGET/uninstall_tor_bundle.sh
+ chmod 550 $TARGET/uninstall_tor_bundle.sh
fi
if [ -f $PACKAGE_PATH/Contents/Resources/package_list.txt ]; then
@@ -86,3 +120,19 @@ if [ -d /Library/StartupItems/Tor ]; then
rm -f /Library/StartupItems/Tor/Tor.loc
echo "$TARGET" > /Library/StartupItems/Tor/Tor.loc
fi
+
+if [ -f /Applications/Firefox.app/Contents/MacOS/firefox ]; then
+ if [ -f $TARGET/torbutton-$TORBUTTON_VERSION.xpi ]; then
+ /Applications/Firefox.app/Contents/MacOS/firefox -install-global-extension $TARGET/torbutton-$TORBUTTON_VERSION.xpi
+# The following is a kludge to get around the fact that the installer
+# runs as root. This means the Torbutton extension will install with
+# root permissions; thereby making uninstalling Torbutton from inside
+# Firefox impossible. The user will be caught in an endless loop of
+# uninstall -> automatic re-installation of Torbutton. The OSX
+# installer doesn't tell you the owner of Firefox, therefore we have to
+# parse it.
+ USR=`ls -alrt /Applications/Firefox.app/Contents/MacOS/extensions/ | tail -1 | awk '{print $3}'`
+ GRP=`ls -alrt /Applications/Firefox.app/Contents/MacOS/extensions/ | tail -1 | awk '{print $4}'`
+ chown -R $USR:$GRP /Applications/Firefox.app/Contents/MacOS/extensions/
+ fi
+fi
diff --git a/contrib/osx/TorPreFlight b/contrib/osx/TorPreFlight
index 49b17104b9..11a6d80e59 100644
--- a/contrib/osx/TorPreFlight
+++ b/contrib/osx/TorPreFlight
@@ -1,4 +1,40 @@
#!/bin/sh
+#
+# ===================================================================
+#
+# TorPreFlight is distributed under this license:
+#
+# Copyright (c) 2006 Andrew Lewman
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#
+# * Neither the names of the copyright owners nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#===============================================================================
+
# TorPreFlight is invoked before the install begins
# Figure out where Tor is installed
@@ -16,8 +52,8 @@ fi
# Backup all of Tor, just in case
if [ -d $TORPATH ]; then
- cp ${TORPATH}/torrc ${TORPATH}/torrc.installer-saved
- cp ${PRIVOXYPATH}/config ${PRIVOXYPATH}/config.installer-saved
- cp ${PRIVOXYPATH}/user.action ${PRIVOXYPATH}/user.action.installer-saved
+ cp $TORPATH/torrc $TORPATH/torrc.installer-saved
+ cp $PRIVOXYPATH/config $PRIVOXYPATH/config.installer-saved
+ cp $PRIVOXYPATH/user.action $PRIVOXYPATH/user.action.installer-saved
fi
diff --git a/contrib/osx/TorbuttonDesc.plist b/contrib/osx/TorbuttonDesc.plist
new file mode 100644
index 0000000000..6b0442d645
--- /dev/null
+++ b/contrib/osx/TorbuttonDesc.plist
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IFPkgDescriptionTitle</key>
+ <string>Torbutton Extension for Firefox</string>
+ <key>IFPkgDescriptionVersion</key>
+ <string>0.1</string>
+</dict>
+</plist>
diff --git a/contrib/osx/TorbuttonInfo.plist b/contrib/osx/TorbuttonInfo.plist
new file mode 100644
index 0000000000..d4854fd077
--- /dev/null
+++ b/contrib/osx/TorbuttonInfo.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleIdentifier</key>
+ <string>Torbutton Extension for Firefox</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Torbutton configuration for Tor</string>
+ <key>CFBundleName</key>
+ <string>Torbutton configuration for Tor</string>
+ <key>CFBundleSortVersionString</key>
+ <string>0.1</string>
+ <key>IFPkgFlagAuthorizationAction</key>
+ <string>RootAuthorization</string>
+ <key>IFPkgFlagRestartAction</key>
+ <string>RecommendedRestart</string>
+ <key>IFPkgFlagFollowLinks</key>
+ <true/>
+ <key>IFPkgFlagIsRequired</key>
+ <false/>
+</dict>
+</plist>
diff --git a/contrib/osx/addsysuser b/contrib/osx/addsysuser
index 7b167eac00..50797f1ab0 100755
--- a/contrib/osx/addsysuser
+++ b/contrib/osx/addsysuser
@@ -4,65 +4,80 @@
#
# Modified for Tor installer by Nick Mathewson
# 2007-06-12 Modified for leopard by Andrew Lewman
+# Copyright (c) 2007 Andrew Lewman
+#
ROOTPROP=/
if [ "`whoami`" != "root" ]; then
-echo "You must be root to execute this script."
-exit
+ echo "You must be root to execute this script."
+ exit
fi
if [ "x$3" = "x" ]; then
-echo 'Usage: addsysuser <username> "<full name>" <homedir>'
-exit 0
+ echo 'Usage: addsysuser <username> "<full name>" <homedir>'
+ exit 0
fi
+
username=$1
realname=$2
homedir=$3
+
if [ -x /usr/bin/dscl ]; then
- # Determine the gid of the daemon group
- gid=`dscl . -read /groups/daemon gid`
- if [ "x`dscl . -list /users|cut -f2 -d' '|grep $username`" != "x" ]; then
- echo The account $username already exists.
- exit 0
- fi
- # home is the local path to the home directory
- home=/Users/$username
- echo Creating account for $username...
- dscl . -create /users/$username
- dscl . -create /users/$username _writers_tim_passwd $username
- dscl . -create /users/$username realname $realname
- dscl . -create /users/$username _writers_passwd $username
- dscl . -create /users/$username gid $gid
- dscl . -create /users/$username home $homedir
- dscl . -create /users/$username name $username
- dscl . -create /users/$username passwd '*'
- dscl . -create /users/$username shell /dev/null
+ # Determine the gid of the daemon group
+ gid=`dscl . -read /groups/daemon gid`
+ if [ "x`dscl . -list /users|cut -f2 -d' '|grep $username`" != "x" ]; then
+ echo The account $username already exists.
+ exit 0
+ fi
+ if [ -x /usr/bin/nidump ]; then
+ uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1`
+ else
+ _tmp=/tmp/_dsexport_tmp.txt.$$
+ rm -f $_tmp
+ dsexport $_tmp '/Local/Default' 'dsRecTypeStandard:Users' > /dev/null 2>&1
+ uiddef=`cat $_tmp | sed 's/\\\://g' | cut -d: -f6 | grep '^[0-9]' | sort -n | grep -v '^[56789]..' | grep -v '^....$' | tail -n 1`
+ rm -f $_tmp
+ fi
+ uiddef=`echo $uiddef + 1 | bc`
+ dscl . -create /users/$username uid $uiddef
+ # home is the local path to the home directory
+ home=/Users/$username
+ echo Creating account for $username...
+ dscl . -create /users/$username
+ dscl . -create /users/$username _writers_tim_passwd $username
+ dscl . -create /users/$username realname $realname
+ dscl . -create /users/$username _writers_passwd $username
+ dscl . -create /users/$username gid $gid
+ dscl . -create /users/$username home $homedir
+ dscl . -create /users/$username name $username
+ dscl . -create /users/$username passwd '*'
+ dscl . -create /users/$username shell /dev/null
else
- # Determine the gid of the daemon group
- gid=`niutil -readprop $ROOTPROP /groups/daemon gid`
- if [ "x`niutil -list $ROOTPROP /users|cut -f2 -d' '|grep $username`" != "x" ]; then
- echo The account $username already exists.
- exit 0
- fi
- # home is the local path to the home directory
- home=/Users/$username
- # defhome is what goes into NetInfo
- defhome="/Network/Servers/MyServer/Users"
- #echo "Determining next available system uid (please be patient)..."
- # Uids over 500 are for system users.
- uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1`
- uiddef=`echo $uiddef + 1 |bc`
- echo Creating account for $username...
- niutil -create $ROOTPROP /users/$username
- niutil -createprop $ROOTPROP /users/$username _writers_tim_passwd $username
- niutil -createprop $ROOTPROP /users/$username realname $realname
- niutil -createprop $ROOTPROP /users/$username _writers_passwd $username
- niutil -createprop $ROOTPROP /users/$username uid $uiddef
- #niutil -createprop $ROOTPROP /users/$username home_loc "<home_dir><url>afp://afp.server.com/Users/</url><path>$username</path></home_dir>"
- niutil -createprop $ROOTPROP /users/$username gid $gid
- niutil -createprop $ROOTPROP /users/$username home $homedir
- niutil -createprop $ROOTPROP /users/$username name $username
- niutil -createprop $ROOTPROP /users/$username passwd '*'
- niutil -createprop $ROOTPROP /users/$username shell /dev/null
+ # Determine the gid of the daemon group
+ gid=`niutil -readprop $ROOTPROP /groups/daemon gid`
+ if [ "x`niutil -list $ROOTPROP /users|cut -f2 -d' '|grep $username`" != "x" ]; then
+ echo The account $username already exists.
+ exit 0
+ fi
+ # home is the local path to the home directory
+ home=/Users/$username
+ # defhome is what goes into NetInfo
+ defhome="/Network/Servers/MyServer/Users"
+ #echo "Determining next available system uid (please be patient)..."
+ # Uids over 500 are for system users.
+ uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1`
+ uiddef=`echo $uiddef + 1 |bc`
+ echo Creating account for $username...
+ niutil -create $ROOTPROP /users/$username
+ niutil -createprop $ROOTPROP /users/$username _writers_tim_passwd $username
+ niutil -createprop $ROOTPROP /users/$username realname $realname
+ niutil -createprop $ROOTPROP /users/$username _writers_passwd $username
+ niutil -createprop $ROOTPROP /users/$username uid $uiddef
+ #niutil -createprop $ROOTPROP /users/$username home_loc "<home_dir><url>afp://afp.server.com/Users/</url><path>$username</path></home_dir>"
+ niutil -createprop $ROOTPROP /users/$username gid $gid
+ niutil -createprop $ROOTPROP /users/$username home $homedir
+ niutil -createprop $ROOTPROP /users/$username name $username
+ niutil -createprop $ROOTPROP /users/$username passwd '*'
+ niutil -createprop $ROOTPROP /users/$username shell /dev/null
fi
diff --git a/contrib/osx/package.sh b/contrib/osx/package.sh
index 74f5b23b69..905e66d1cf 100644
--- a/contrib/osx/package.sh
+++ b/contrib/osx/package.sh
@@ -1,6 +1,7 @@
#!/bin/sh
# $Id$
# Copyright 2004-2005 Nick Mathewson.
+# Copyright 2005-2008 Andrew Lewman
# See LICENSE in Tor distribution for licensing information.
# This script builds a Macintosh OS X metapackage containing 4 packages:
@@ -8,6 +9,7 @@
# - One for Privoxy.
# - One for a tor-specific privoxy configuration script.
# - One for Startup scripts for Tor.
+# - One for Torbutton, an extension for FireFox
#
# This script expects to be run from the toplevel makefile, with VERSION
# set to the latest Tor version, and Tor already built.
@@ -20,6 +22,11 @@
# privoxy lives somewhere else.
PRIVOXY_PKG_ZIP=~/tmp/privoxyosx_setup_3.0.6.zip
+# Where have we put the xpi and license for Torbutton? Edit this if your
+# torbutton and torbutton license live somewhere else.
+TORBUTTON_PATH=~/tmp/torbutton-1.0.4.01-fx+tb.xpi
+TORBUTTON_LIC_PATH=~/tmp/LICENSE
+
###
# Helpful info on OS X packaging:
# http://developer.apple.com/documentation/DeveloperTools/Conceptual/SoftwareDistribution/index.html
@@ -66,11 +73,13 @@ for subdir in tor_packageroot tor_resources \
torstartup_packageroot \
privoxyconf_packageroot \
torbundle_resources \
+ torbutton_packageroot \
output; do
mkdir $BUILD_DIR/$subdir
done
### 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
cp contrib/osx/ReadMe.rtf $BUILD_DIR/tor_resources
@@ -139,16 +148,31 @@ $PACKAGEMAKER -build \
### Make Startup Script package
- mkdir -p $BUILD_DIR/torstartup_packageroot/Library/StartupItems/Tor
- cp contrib/osx/Tor contrib/osx/StartupParameters.plist \
+mkdir -p $BUILD_DIR/torstartup_packageroot/Library/StartupItems/Tor
+cp contrib/osx/Tor contrib/osx/StartupParameters.plist \
$BUILD_DIR/torstartup_packageroot/Library/StartupItems/Tor
- find $BUILD_DIR/torstartup_packageroot -print0 | sudo xargs -0 chown root:wheel
- $PACKAGEMAKER -build \
- -p $BUILD_DIR/output/torstartup.pkg \
- -f $BUILD_DIR/torstartup_packageroot \
- -i contrib/osx/TorStartupInfo.plist \
- -d contrib/osx/TorStartupDesc.plist
+find $BUILD_DIR/torstartup_packageroot -print0 | sudo xargs -0 chown root:wheel
+
+$PACKAGEMAKER -build \
+ -p $BUILD_DIR/output/torstartup.pkg \
+ -f $BUILD_DIR/torstartup_packageroot \
+ -i contrib/osx/TorStartupInfo.plist \
+ -d contrib/osx/TorStartupDesc.plist
+
+### Make Torbutton Installation package
+
+mkdir -p $BUILD_DIR/torbutton_packageroot/Library/Torbutton
+cp $TORBUTTON_PATH $BUILD_DIR/torbutton_packageroot/Library/Torbutton/
+cp $TORBUTTON_LIC_PATH $BUILD_DIR/torbutton_packageroot/Library/Torbutton/Torbutton-LICENSE.txt
+
+find $BUILD_DIR/torbutton_packageroot -print0 | sudo xargs -0 chown root:wheel
+
+$PACKAGEMAKER -build \
+ -p $BUILD_DIR/output/torbutton.pkg \
+ -f $BUILD_DIR/torbutton_packageroot \
+ -i contrib/osx/TorbuttonInfo.plist \
+ -d contrib/osx/TorbuttonDesc.plist
### Assemble the metapackage. Packagemaker won't buld metapackages from
# the command line, so we need to do it by hand.
@@ -175,6 +199,7 @@ cp $PRIVOXY_RESDIR/License.html $BUILD_DIR/output/Privoxy\ License.html
cp $PRIVOXY_RESDIR/ReadMe.txt $BUILD_DIR/output/Privoxy\ ReadMe.txt
cp contrib/osx/ReadMe.rtf $BUILD_DIR/output/Tor\ ReadMe.rtf
cp LICENSE $BUILD_DIR/output/Tor\ License.txt
+cp $TORBUTTON_LIC_PATH $BUILD_DIR/output/Torbutton_LICENSE.txt
### Package it all into a DMG
diff --git a/contrib/osx/package_list.txt b/contrib/osx/package_list.txt
index 33b6d6ab85..1bb860505d 100644
--- a/contrib/osx/package_list.txt
+++ b/contrib/osx/package_list.txt
@@ -3,3 +3,4 @@ Privoxy
torstartup
privoxyconf
Vidalia
+torbutton
diff --git a/contrib/osx/uninstall_tor_bundle.sh b/contrib/osx/uninstall_tor_bundle.sh
index d0120be537..b7d6427559 100755
--- a/contrib/osx/uninstall_tor_bundle.sh
+++ b/contrib/osx/uninstall_tor_bundle.sh
@@ -33,11 +33,9 @@
## (ie "Tor", "torstartup", ...) the list should be new-line-delimited.
PACKAGE_LIST_SRC=./package_list.txt
-
### this is the name of the user created in the install process of Tor
TOR_USER=_tor
-
### these should be constant across all osX installs (so leave them be)
STARTUP_ITEMS_DIR=/Library/StartupItems
PKG_RCPT_BASE_DIR=/Library/Receipts
@@ -45,7 +43,6 @@ BOM_INTERMEDIATE_DIR=Contents/Resources
INFO_INTERMEDIATE_DIR=$BOM_INTERMEDIATE_DIR/English.lproj
TEMP_BOM_CONTENTS=/tmp/tor_uninst_scratch
-
### make sure the script is being run as root, barf if not
if [ "`whoami`" != "root" ]; then
echo "Must be root to run the uninstall script."
@@ -134,11 +131,10 @@ else
niutil -destroy . /users/$TOR_USER
fi
-
## clean up
echo ". Cleaning up"
rm -rf $TEMP_BOM_CONTENTS
-rm -rf /Library/Privoxy/ /Library/StartupItems/Privoxy/ /Library/Tor/ /Library/StartupItems/Tor/
+rm -rf /Library/Privoxy/ /Library/StartupItems/Privoxy/ /Library/Tor/ /Library/StartupItems/Tor/ /Library/Torbutton/
echo ". Finished"