Commit 20142a25 authored by Nick Mathewson's avatar Nick Mathewson 🎨
Browse files

Forward-port OSX packaging stuff from maint branch


svn:r3299
parent 041edf87
......@@ -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
......
......@@ -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
......
SUBDIRS = osx
DIST_SUBDIRS = osx
confdir = $(sysconfdir)/tor
EXTRA_DIST = tor-tsocks.conf torify.1 tor-control.py tor.nsi tor.sh torctl
......
Makefile
Makefile.in
TorBundleDesc.plist
TorBundleInfo.plist
TorDesc.plist
TorInfo.plist
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
<?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>
<?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>
{\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.}
\ No newline at end of file
{
Description = "Tor";
Provides = ("tor");
Requires = ("Network");
Uses = ("Network");
OrderPreference = "Last";
Messages =
{
start = "Starting Tor";
stop = "Stopping Tor";
};
}
#!/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"
<?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>
<?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>
<?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>
<?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>
{\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/}
\ No newline at end of file
<?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>
<?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>
<?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>
<?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>
#!/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 .
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment