backport of 16678; removing OS var and keeping ARCH
svn:r16679
This commit is contained in:
parent
214955a322
commit
ce0eeee5e4
|
@ -25,12 +25,13 @@ if [ -x /usr/bin/sw_vers ]; then
|
|||
# the OS version
|
||||
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.6") ARCH="universal";;
|
||||
"10.5") ARCH="universal";;
|
||||
"10.4") ARCH="universal";;
|
||||
"10.3") ARCH="ppc";;
|
||||
"10.2") ARCH="ppc";;
|
||||
"10.1") ARCH="ppc";;
|
||||
"10.0") ARCH="ppc";;
|
||||
esac
|
||||
else
|
||||
OS="unknown"
|
||||
|
|
|
@ -2,14 +2,12 @@
|
|||
# $Id$
|
||||
# Copyright 2004-2005 Nick Mathewson.
|
||||
# Copyright 2005-2007 Andrew Lewman
|
||||
# Copyright 2008 The Tor Project
|
||||
# See LICENSE in Tor distribution for licensing information.
|
||||
|
||||
# This script builds a Macintosh OS X metapackage containing 4 packages:
|
||||
# This script builds a Macintosh OS X metapackage containing 2 packages:
|
||||
# - One for Tor.
|
||||
# - 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.
|
||||
|
@ -18,15 +16,6 @@
|
|||
# Read the documentation located in tor/doc/tor-osx-dmg-creation.txt on
|
||||
# how to build Tor for OSX
|
||||
|
||||
# Where have we put the zip file containing Privoxy? Edit this if your
|
||||
# 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.2.0rc5.xpi
|
||||
TORBUTTON_LIC_PATH=~/tmp/LICENSE
|
||||
|
||||
###
|
||||
# Helpful info on OS X packaging:
|
||||
# http://developer.apple.com/documentation/DeveloperTools/Conceptual/SoftwareDistribution/index.html
|
||||
|
@ -46,17 +35,17 @@ if [ -x /usr/bin/sw_vers ]; then
|
|||
# the OS version
|
||||
OSVER=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 | cut -d"." -f1,2`
|
||||
case "$OSVER" in
|
||||
"10.6") OS="snowleopard" ARCH="universal";;
|
||||
"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";;
|
||||
*) OS="unknown";;
|
||||
"10.6") ARCH="universal";;
|
||||
"10.5") ARCH="universal";;
|
||||
"10.4") ARCH="universal";;
|
||||
"10.3") ARCH="ppc";;
|
||||
"10.2") ARCH="ppc";;
|
||||
"10.1") ARCH="ppc";;
|
||||
"10.0") ARCH="ppc";;
|
||||
*) ARCH="unknown";;
|
||||
esac
|
||||
else
|
||||
OS="unknown"
|
||||
ARCH="unknown"
|
||||
fi
|
||||
|
||||
# Where will we put our temporary files?
|
||||
|
@ -72,9 +61,7 @@ sudo rm -rf $BUILD_DIR
|
|||
mkdir $BUILD_DIR || exit 1
|
||||
for subdir in tor_packageroot tor_resources \
|
||||
torstartup_packageroot \
|
||||
privoxyconf_packageroot \
|
||||
torbundle_resources \
|
||||
torbutton_packageroot \
|
||||
output; do
|
||||
mkdir $BUILD_DIR/$subdir
|
||||
done
|
||||
|
@ -128,18 +115,6 @@ $PACKAGEMAKER -build \
|
|||
-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:wheel
|
||||
|
||||
$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
|
||||
|
@ -154,24 +129,10 @@ $PACKAGEMAKER -build \
|
|||
-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.
|
||||
|
||||
MPKG=$BUILD_DIR/output/Tor-$VERSION-$OS-$ARCH-Bundle.mpkg
|
||||
MPKG=$BUILD_DIR/output/Tor-$VERSION-$ARCH-Bundle.mpkg
|
||||
mkdir -p "$MPKG/Contents/Resources"
|
||||
echo -n "pmkrpkg1" > "$MPKG/Contents/PkgInfo"
|
||||
cp contrib/osx/ReadMe.rtf "$MPKG/Contents/Resources"
|
||||
|
@ -180,28 +141,23 @@ cp contrib/osx/TorBundleWelcome.rtf "$MPKG/Contents/Resources/Welcome.rtf"
|
|||
cp contrib/osx/TorBundleDesc.plist "$MPKG/Contents/Resources/Description.plist"
|
||||
cp contrib/osx/tor_logo.gif "$MPKG/Contents/Resources/background.gif"
|
||||
|
||||
# Move all the subpackages into place. unzip Privoxy.pkg into place,
|
||||
# and fix its file permissions so we can rm -rf it later.
|
||||
# Move all the subpackages into place.
|
||||
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 )
|
||||
( cd $BUILD_DIR/output/.contained_packages )
|
||||
|
||||
### 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
|
||||
cp $TORBUTTON_LIC_PATH $BUILD_DIR/output/Torbutton_LICENSE.txt
|
||||
|
||||
### Package it all into a DMG
|
||||
|
||||
find $BUILD_DIR/output -print0 | sudo xargs -0 chown root:wheel
|
||||
|
||||
mv $BUILD_DIR/output "$BUILD_DIR/Tor-$VERSION-$OS-$ARCH-Bundle"
|
||||
rm -f "Tor-$VERSION-$OS-$ARCH-Bundle.dmg"
|
||||
mv $BUILD_DIR/output "$BUILD_DIR/Tor-$VERSION-$ARCH-Bundle"
|
||||
rm -f "Tor-$VERSION-$ARCH-Bundle.dmg"
|
||||
USER="`whoami`"
|
||||
sudo hdiutil create -format UDZO -srcfolder "$BUILD_DIR/Tor-$VERSION-$OS-$ARCH-Bundle" "Tor-$VERSION-$OS-$ARCH-Bundle.dmg"
|
||||
sudo chown "$USER" "Tor-$VERSION-$OS-$ARCH-Bundle.dmg"
|
||||
sudo hdiutil create -format UDZO -srcfolder "$BUILD_DIR/Tor-$VERSION-$ARCH-Bundle" "Tor-$VERSION-$ARCH-Bundle.dmg"
|
||||
sudo chown "$USER" "Tor-$VERSION-$ARCH-Bundle.dmg"
|
||||
|
||||
sudo rm -rf $BUILD_DIR
|
||||
|
|
Loading…
Reference in New Issue