mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Forward-port OSX packaging stuff from maint branch
svn:r3299
This commit is contained in:
+16
@@ -24,6 +24,22 @@ dist-rpm: dist
|
||||
mv $$RPM_BUILD_DIR/RPMS/*/* .; \
|
||||
rm -rf $$RPM_BUILD_DIR
|
||||
|
||||
dist-osx:
|
||||
@if [ "x$(prefix)" != 'x/Library/Tor' ]; then \
|
||||
echo "Configure with --prefix=/Library/Tor, please"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
if [ "x$(bindir)" != 'x/Library/Tor' ]; then \
|
||||
echo "Configure with --bindir=/Library/Tor, please"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
if [ "x$(sysconfdir)" != 'x/Library' ]; then \
|
||||
echo "Configure with --sysconfdir=/Library, please"; \
|
||||
exit 1; \
|
||||
fi
|
||||
$(MAKE) all
|
||||
VERSION=$(VERSION) sh ./contrib/osx/package.sh
|
||||
|
||||
doxygen:
|
||||
doxygen && cd doc/doxygen/latex && make
|
||||
|
||||
|
||||
+1
-1
@@ -244,7 +244,7 @@ CFLAGS="$CFLAGS -Wall -g -O2"
|
||||
|
||||
echo "confdir: $CONFDIR"
|
||||
|
||||
AC_OUTPUT(Makefile tor.spec contrib/tor.sh contrib/torctl contrib/torify contrib/Makefile src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile)
|
||||
AC_OUTPUT(Makefile tor.spec contrib/tor.sh contrib/torctl contrib/torify contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile)
|
||||
|
||||
if test -x /usr/bin/perl && test -x ./contrib/updateVersions.pl ; then
|
||||
./contrib/updateVersions.pl
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
SUBDIRS = osx
|
||||
DIST_SUBDIRS = osx
|
||||
|
||||
confdir = $(sysconfdir)/tor
|
||||
|
||||
EXTRA_DIST = tor-tsocks.conf torify.1 tor-control.py tor.nsi tor.sh torctl
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
TorBundleDesc.plist
|
||||
TorBundleInfo.plist
|
||||
TorDesc.plist
|
||||
TorInfo.plist
|
||||
@@ -0,0 +1,8 @@
|
||||
confdir = $(sysconfdir)/tor
|
||||
|
||||
EXTRA_DIST = PrivoxyConfDesc.plist PrivoxyConfInfo.plist \
|
||||
ReadMe.rtf StartupParameters.plist Tor TorBundleDesc.plist.in \
|
||||
TorBundleInfo.plist.in TorBundleWelcome.rtf TorDesc.plist.in \
|
||||
TorInfo.plist.in TorStartupDesc.plist TorStartupInfo.plist \
|
||||
package.sh privoxy.config TorPostflight addsysuser
|
||||
|
||||
@@ -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>Privoxy configuration for Tor</string>
|
||||
<key>IFPkgDescriptionVersion</key>
|
||||
<string>0.1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?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>CFBundleGetInfoString</key>
|
||||
<string>Privoxy configuration for Tor</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Privoxy 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>
|
||||
@@ -0,0 +1,7 @@
|
||||
{\rtf1\mac\ansicpg10000\cocoartf102
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\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.}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
Description = "Tor";
|
||||
Provides = ("tor");
|
||||
Requires = ("Network");
|
||||
Uses = ("Network");
|
||||
OrderPreference = "Last";
|
||||
Messages =
|
||||
{
|
||||
start = "Starting Tor";
|
||||
stop = "Stopping Tor";
|
||||
};
|
||||
}
|
||||
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
|
||||
TORCONF=/Library/Tor/torrc
|
||||
TORDIR=/Library/Tor/var/lib/tor
|
||||
TORPID=/var/run/Tor.pid
|
||||
TORUSER=_tor
|
||||
TORGROUP=daemon
|
||||
TORCMD=/Library/Tor/tor
|
||||
|
||||
##
|
||||
# Tor Service
|
||||
##
|
||||
|
||||
. /etc/rc.common
|
||||
|
||||
StartService ()
|
||||
{
|
||||
|
||||
if [ -f $TORCMD ]; then
|
||||
if pid=$(GetPID Tor); then
|
||||
return 0
|
||||
else
|
||||
ConsoleMessage "Starting Tor Service"
|
||||
# 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 &
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
StopService ()
|
||||
{
|
||||
if pid=$(GetPID Tor); then
|
||||
ConsoleMessage "Stopping Tor Service"
|
||||
kill -TERM "${pid}"
|
||||
# Just for sanity (sometimes necessary.)
|
||||
killall tor 2>/dev/null
|
||||
else
|
||||
ConsoleMessage "Tor Service not responding."
|
||||
# Just for sanity (sometimes necessary.)
|
||||
killall tor 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
RestartService () { StopService; StartService; }
|
||||
|
||||
RunService "$1"
|
||||
@@ -0,0 +1,14 @@
|
||||
<?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>IFPkgDescriptionDeleteWarning</key>
|
||||
<string></string>
|
||||
<key>IFPkgDescriptionDescription</key>
|
||||
<string>Bundled package of Tor 0.1.0.0-alpha-cvs and Privoxy.</string>
|
||||
<key>IFPkgDescriptionTitle</key>
|
||||
<string>Tor - Privoxy Bundle</string>
|
||||
<key>IFPkgDescriptionVersion</key>
|
||||
<string>0.1.0.0-alpha-cvs</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?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>IFPkgDescriptionDeleteWarning</key>
|
||||
<string></string>
|
||||
<key>IFPkgDescriptionDescription</key>
|
||||
<string>Bundled package of Tor @VERSION@ and Privoxy.</string>
|
||||
<key>IFPkgDescriptionTitle</key>
|
||||
<string>Tor - Privoxy Bundle</string>
|
||||
<key>IFPkgDescriptionVersion</key>
|
||||
<string>@VERSION@</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?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>CFBundleName</key>
|
||||
<string>Tor Bundle</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>Tor Bundle 0.1.0.0-alpha-cvs</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>net.freehaven.torbundle</string>
|
||||
<key>CFBundleSortVersionString</key>
|
||||
<string>0.1.0.0-alpha-cvs</string>
|
||||
<key>IFPkgFlagComponentDirectory</key>
|
||||
<string>../.contained_packages</string>
|
||||
<key>IFPkgFlagPackageList</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>IFPkgFlagPackageLocation</key>
|
||||
<string>Tor.pkg</string>
|
||||
<key>IFPkgFlagPackageSelection</key>
|
||||
<string>required</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>IFPkgFlagPackageLocation</key>
|
||||
<string>Privoxy.pkg</string>
|
||||
<key>IFPkgFlagPackageSelection</key>
|
||||
<string>selected</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>IFPkgFlagPackageLocation</key>
|
||||
<string>privoxyconf.pkg</string>
|
||||
<key>IFPkgFlagPackageSelection</key>
|
||||
<string>selected</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>IFPkgFlagPackageLocation</key>
|
||||
<string>torstartup.pkg</string>
|
||||
<key>IFPkgFlagPackageSelection</key>
|
||||
<string>unselected</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>IFPkgFormatVersion</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?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>CFBundleName</key>
|
||||
<string>Tor Bundle</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>Tor Bundle @VERSION@</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>net.freehaven.torbundle</string>
|
||||
<key>CFBundleSortVersionString</key>
|
||||
<string>@VERSION@</string>
|
||||
<key>IFPkgFlagComponentDirectory</key>
|
||||
<string>../.contained_packages</string>
|
||||
<key>IFPkgFlagPackageList</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>IFPkgFlagPackageLocation</key>
|
||||
<string>Tor.pkg</string>
|
||||
<key>IFPkgFlagPackageSelection</key>
|
||||
<string>required</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>IFPkgFlagPackageLocation</key>
|
||||
<string>Privoxy.pkg</string>
|
||||
<key>IFPkgFlagPackageSelection</key>
|
||||
<string>selected</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>IFPkgFlagPackageLocation</key>
|
||||
<string>privoxyconf.pkg</string>
|
||||
<key>IFPkgFlagPackageSelection</key>
|
||||
<string>selected</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>IFPkgFlagPackageLocation</key>
|
||||
<string>torstartup.pkg</string>
|
||||
<key>IFPkgFlagPackageSelection</key>
|
||||
<string>unselected</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>IFPkgFormatVersion</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
</plist>
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
{\rtf1\mac\ansicpg10001\cocoartf102
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\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.\
|
||||
\
|
||||
|
||||
\f1\b Tor and Privoxy are separate product.\
|
||||
It is packaged together for your convenience.
|
||||
\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\
|
||||
others to do so.\
|
||||
\
|
||||
For more information, please visit http://www.freehaven.net/tor/\
|
||||
\
|
||||
Privoxy stands between your web browser and tor to make your web surfing experience safer.\
|
||||
\
|
||||
For more information, please visit http://www.privoxy.org/}
|
||||
@@ -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>Tor</string>
|
||||
<key>IFPkgDescriptionVersion</key>
|
||||
<string>0.1.0.0-alpha-cvs</string>
|
||||
</dict>
|
||||
</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>Tor</string>
|
||||
<key>IFPkgDescriptionVersion</key>
|
||||
<string>@VERSION@</string>
|
||||
</dict>
|
||||
</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>CFBundleGetInfoString</key>
|
||||
<string>Tor 0.1.0.0-alpha-cvs</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Tor</string>
|
||||
<key>CFBundleSortVersionString</key>
|
||||
<string>0.1.0.0-alpha-cvs</string>
|
||||
<key>IFPkgFlagAllowBackRev</key>
|
||||
<true/>
|
||||
<key>IFPkgFlagAuthorizationAction</key>
|
||||
<string>RootAuthorization</string>
|
||||
<key>IFPkgFlagFollowLinks</key>
|
||||
<true/>
|
||||
<key>IFPkgFlagIsRequired</key>
|
||||
<true/>
|
||||
<key>IFPkgFlagRootVolumeOnly</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</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>CFBundleGetInfoString</key>
|
||||
<string>Tor @VERSION@</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Tor</string>
|
||||
<key>CFBundleSortVersionString</key>
|
||||
<string>@VERSION@</string>
|
||||
<key>IFPkgFlagAllowBackRev</key>
|
||||
<true/>
|
||||
<key>IFPkgFlagAuthorizationAction</key>
|
||||
<string>RootAuthorization</string>
|
||||
<key>IFPkgFlagFollowLinks</key>
|
||||
<true/>
|
||||
<key>IFPkgFlagIsRequired</key>
|
||||
<true/>
|
||||
<key>IFPkgFlagRootVolumeOnly</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
|
||||
# TorPostflight gets invoked after any install or upgrade.
|
||||
|
||||
ADDSYSUSER=$RECEIPT_PATH/addsysuser
|
||||
if [ ! -x "$ADDSYSUSER" ]; then
|
||||
echo "Could not find addsysuser script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TORUSER=_tor
|
||||
TORGROUP=daemon
|
||||
TORDIR=/Library/Tor/var/lib/tor
|
||||
|
||||
# Create user $TORUSER in group daemon. If it's already there, great.
|
||||
$ADDSYSUSER $TORUSER "Tor System user" $TORDIR
|
||||
|
||||
# Create the tor directory, if it doesn't exist.
|
||||
if [ ! -d $TORDIR ]; then
|
||||
mkdir -p $TORDIR
|
||||
fi
|
||||
# Check its permissions.
|
||||
chown $TORUSER $TORDIR
|
||||
chgrp daemon $TORDIR
|
||||
chmod 700 $TORDIR
|
||||
|
||||
# Ensure a symbolic link.
|
||||
cd /usr/bin
|
||||
if [ -e /usr/bin/tor -a ! -L /usr/bin/tor ]; then
|
||||
mv tor tor_old
|
||||
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 .
|
||||
@@ -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>Tor Startup Script</string>
|
||||
<key>IFPkgDescriptionVersion</key>
|
||||
<string>0.0.9.1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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>CFBundleGetInfoString</key>
|
||||
<string>Tor Startup Script (experimental)</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Tor Startup Script</string>
|
||||
<key>CFBundleSortVersionString</key>
|
||||
<string>0.1</string>
|
||||
<key>IFPkgFlagAllowBackRev</key>
|
||||
<true/>
|
||||
<key>IFPkgFlagAuthorizationAction</key>
|
||||
<string>RootAuthorization</string>
|
||||
<key>IFPkgFlagRestartAction</key>
|
||||
<string>NoRestart</string>
|
||||
<key>IFPkgFlagFollowLinks</key>
|
||||
<true/>
|
||||
<key>IFPkgFlagIsRequired</key>
|
||||
<false/>
|
||||
<key>IFPkgFlagRootVolumeOnly</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Original adduser 05 Feb 2002 by Jon L. Gardner
|
||||
#
|
||||
# Modified for Tor installer by Nick Mathewson
|
||||
|
||||
if [ "`whoami`" != "root" ]; then
|
||||
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
|
||||
fi
|
||||
username=$1
|
||||
realname=$2
|
||||
homedir=$3
|
||||
# GID 20 is "staff" which is the default. Change it if you want.
|
||||
gid=`niutil -readprop / /groups/daemon gid`
|
||||
if [ "x`niutil -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
|
||||
# defhome is what goes into NetInfo
|
||||
defhome="/Network/Servers/MyServer/Users"
|
||||
#echo "Determining next available uid (please be patient)..."
|
||||
uiddef=`nidump passwd / | cut -d: -f3 | sort -n | tail -n 1`
|
||||
uiddef=`echo $uiddef + 1 |bc`
|
||||
echo Creating account for $username...
|
||||
niutil -create / /users/$username
|
||||
niutil -createprop / /users/$username _writers_tim_passwd $username
|
||||
niutil -createprop / /users/$username realname $realname
|
||||
niutil -createprop / /users/$username _writers_passwd $username
|
||||
niutil -createprop / /users/$username uid $uiddef
|
||||
#niutil -createprop / /users/$username home_loc "<home_dir><url>afp://afp.server.com/Users/</url><path>$username</path></home_dir>"
|
||||
niutil -createprop / /users/$username gid $gid
|
||||
niutil -createprop / /users/$username home $homedir
|
||||
niutil -createprop / /users/$username name $username
|
||||
niutil -createprop / /users/$username passwd '*'
|
||||
niutil -createprop / /users/$username shell /dev/null
|
||||
@@ -0,0 +1,147 @@
|
||||
#!/bin/sh
|
||||
# $Id$
|
||||
# Copyright 2004 Nick Mathewson.
|
||||
# See LICENSE in Tor distribution for licensing information.
|
||||
|
||||
# This script builds a Macintosh OS X metapackage containing 4 packages:
|
||||
# - One for Tor.
|
||||
# - One for Privoxy.
|
||||
# - One for a tor-specific privoxy configuration script.
|
||||
# - One for Startup scripts for Tor.
|
||||
#
|
||||
# This script expects to be run from the toplevel makefile, with VERSION
|
||||
# set to the latest Tor version, and Tor already built.
|
||||
|
||||
# Where have we put the zip file containing Privoxy? Edit this if your
|
||||
# privoxy lives somewhere else.
|
||||
PRIVOXY_PKG_ZIP=~/src/privoxy-setup/privoxyosx_setup_3.0.3.zip
|
||||
|
||||
###
|
||||
# Helpful info on OS X packaging:
|
||||
# http://developer.apple.com/documentation/DeveloperTools/Conceptual/SoftwareDistribution/index.html
|
||||
# man packagemaker
|
||||
|
||||
# Make sure VERSION is set, so we don't name the package "Tor Bundle.dmg"
|
||||
if [ "XX$VERSION" = 'XX' ]; then
|
||||
echo "VERSION not set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Where will we put our temporary files?
|
||||
BUILD_DIR=/tmp/tor-osx-$$
|
||||
# Path to PackageMaker app.
|
||||
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
|
||||
|
||||
umask 022
|
||||
|
||||
echo I might ask you for your password now, so you can sudo.
|
||||
|
||||
sudo rm -rf $BUILD_DIR
|
||||
mkdir $BUILD_DIR || exit 1
|
||||
for subdir in tor_packageroot tor_resources \
|
||||
torstartup_packageroot \
|
||||
privoxyconf_packageroot \
|
||||
torbundle_resources \
|
||||
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
|
||||
#cp contrib/osx/License.rtf $BUILD_DIR/tor_resources
|
||||
cp contrib/osx/TorPostflight $BUILD_DIR/tor_resources/postflight
|
||||
cp contrib/osx/addsysuser $BUILD_DIR/tor_resources/addsysuser
|
||||
cat <<EOF > $BUILD_DIR/tor_resources/Welcome.txt
|
||||
Tor: an anonymous Internet communication system
|
||||
|
||||
Tor is a system for using the internet anonymously, and allowing
|
||||
others to do so.
|
||||
EOF
|
||||
|
||||
find $BUILD_DIR/tor_packageroot -print0 |sudo xargs -0 chown root:admin
|
||||
|
||||
$PACKAGEMAKER -build \
|
||||
-p $BUILD_DIR/output/Tor.pkg \
|
||||
-f $BUILD_DIR/tor_packageroot \
|
||||
-r $BUILD_DIR/tor_resources \
|
||||
-i contrib/osx/TorInfo.plist \
|
||||
-d contrib/osx/TorDesc.plist
|
||||
|
||||
### Put privoxy configuration package in place.
|
||||
mkdir -p $BUILD_DIR/privoxyconf_packageroot/Library/Privoxy
|
||||
cp contrib/osx/privoxy.config $BUILD_DIR/privoxyconf_packageroot/Library/Privoxy/config
|
||||
|
||||
find $BUILD_DIR/privoxyconf_packageroot -print0 |sudo xargs -0 chown root:admin
|
||||
|
||||
$PACKAGEMAKER -build \
|
||||
-p $BUILD_DIR/output/privoxyconf.pkg \
|
||||
-f $BUILD_DIR/privoxyconf_packageroot \
|
||||
-i contrib/osx/PrivoxyConfInfo.plist \
|
||||
-d contrib/osx/PrivoxyConfDesc.plist
|
||||
|
||||
### Make Startup Script package
|
||||
|
||||
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:admin
|
||||
$PACKAGEMAKER -build \
|
||||
-p $BUILD_DIR/output/torstartup.pkg \
|
||||
-f $BUILD_DIR/torstartup_packageroot \
|
||||
-i contrib/osx/TorStartupInfo.plist \
|
||||
-d contrib/osx/TorStartupDesc.plist
|
||||
|
||||
### Assemble the metapackage. Packagemaker won't buld metapackages from
|
||||
# the command line, so we need to do it by hand.
|
||||
|
||||
MPKG=$BUILD_DIR/output/Tor\ Bundle.mpkg
|
||||
mkdir -p "$MPKG/Contents/Resources"
|
||||
echo -n "pmkrpkg1" > "$MPKG/Contents/PkgInfo"
|
||||
cp contrib/osx/ReadMe.rtf "$MPKG/Contents/Resources"
|
||||
#cp contrib/osx/License.rtf "$MPKG/Contents/Resources"
|
||||
cp contrib/osx/TorBundleInfo.plist "$MPKG/Contents/Info.plist"
|
||||
cp contrib/osx/TorBundleWelcome.rtf "$MPKG/Contents/Resources/Welcome.rtf"
|
||||
cp contrib/osx/TorBundleDesc.plist "$MPKG/Contents/Resources/Description.plist"
|
||||
|
||||
# Move all the subpackages into place. unzip Privoxy.pkg into place,
|
||||
# and fix its file permissions so we can rm -rf it later.
|
||||
mkdir $BUILD_DIR/output/.contained_packages
|
||||
mv $BUILD_DIR/output/*.pkg $BUILD_DIR/OUTPUT/.contained_packages
|
||||
( cd $BUILD_DIR/output/.contained_packages && unzip $PRIVOXY_PKG_ZIP && find Privoxy.pkg -type d -print0 | xargs -0 chmod u+w )
|
||||
|
||||
### Copy readmes and licenses into toplevel.
|
||||
PRIVOXY_RESDIR=$BUILD_DIR/output/.contained_packages/Privoxy.pkg/Contents/Resources
|
||||
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
|
||||
|
||||
### Assemble documentation
|
||||
|
||||
DOC=$BUILD_DIR/output/Documents
|
||||
mkdir $DOC
|
||||
cp doc/tor-doc.html doc/tor-doc.css $DOC
|
||||
cp AUTHORS $DOC/AUTHORS.txt
|
||||
groff doc/tor.1 -T ps -m man | ps2pdf - $DOC/tor-reference.pdf
|
||||
groff doc/tor-resolve.1 -T ps -m man | ps2pdf - $DOC/tor-resolve.pdf
|
||||
|
||||
mkdir $DOC/Advanced
|
||||
cp doc/tor-spec.txt doc/rend-spec.txt doc/control-spec.txt doc/socks-extensions.txt $DOC/Advanced
|
||||
cp doc/CLIENTS $DOC/Advanced/CLIENTS.txt
|
||||
cp doc/HACKING $DOC/Advanced/HACKING.txt
|
||||
cp ChangeLog $DOC/Advanced/ChangeLog.txt
|
||||
|
||||
### Package it all into a DMG
|
||||
|
||||
find $BUILD_DIR/output -print0 | sudo xargs -0 chown root:admin
|
||||
|
||||
mv $BUILD_DIR/output "$BUILD_DIR/Tor $VERSION Bundle"
|
||||
rm -f "Tor $VERSION Bundle.dmg"
|
||||
USER="`whoami`"
|
||||
sudo hdiutil create -format UDZO -srcfolder "$BUILD_DIR/Tor $VERSION Bundle" "Tor $VERSION Bundle.dmg"
|
||||
sudo chown "$USER" "Tor $VERSION Bundle.dmg"
|
||||
|
||||
sudo rm -rf $BUILD_DIR
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user