           Building the Vidalia/Tor/Privoxy OS X Bundle

Libevent
1. Download and extract the latest libevent source from
   http://www.monkey.org/~provos/libevent/

2. Configure libevent with the following:
   ./configure --enable-static --disable-shared

3. Build and install libevent as follows:
   make && make install

   You will need to be root to `make install`

  NOTE: If you have previously installed a Libevent that was not configured with
  the options above, you must remove those before building Tor, otherwise Tor
  will link to the wrong Libevent.


Qt
4. Download and extract the open source version of Qt 4.2 or higher from 
   Trolltech at the following address:
   http://www.trolltech.com/developer/downloads/qt/mac

5. Configure Qt with the following (OS X 10.4 or later):
  export MACOSX_DEPLOYENT_TARGET=10.4
   ./configure -static -release -universal -fast -no-qt3support \
     -nomake demos -nomake examples -sdk /Developer/SDKs/MacOSX10.4u.sdk/

6. Build and install Qt as follows:
   make && make install
 
 
Privoxy
7. Download the OS X Privoxy package from 
   http://prdownloads.sourceforge.net/ijbswa/privoxyosx_setup_3.0.3.zip?download
  
   Note the location in which you save this .zip file, because you will need
   to specify it in Step 8.


Tor
8. Download and extract the latest Tor source from
   https://www.torproject.org/download

   Note the location in which you extract Tor's source, because you will need
   to specify it in Step 8.
   
9. Configure Tor with the following:
   ./configure --prefix=/Library/Tor --bindir=/Library/Tor --sysconfdir=/Library

Vidalia
10. Configure Vidalia with the following:
      cmake -DOSX_FAT_BINARY=1 . 

   The Vidalia binary on OS X links to Qt statically, so you will need to have
   your Qt installation configured appropriately.

11. Run `make` to build Vidalia.

12. Download the latest Torbutton and LICENSE file from https://torbutton.torproject.org/dev/.
Remember where you put this file.

   
Finish
12. From Vidalia's pkg/ directory in Vidalia's source, run the following:
     ./package.sh osx-bundle <path-to-tor> <privoxy-package.zip>
  
  Example:
     ./package.sh osx-bundle ~/tor-0.2.0.11-alpha ~/privoxyosx_setup_3.0.3.zip

  The script that builds the .mpkg (pkg/osx/bundle/buildmpkg.sh) gets Tor's
  version number from the directory name, so it should be named appropriately,
  as in the example above.
  
The resulting .dmg containg the .mpkg and necessary licenses will be placed in
the 'pkg' directory under Vidalia's source.

NOTE: Steps 1-6 only need to be done once initially, unless you need to change the
packaged version of Libevent or Qt. Step 7 also only needs to be done once,
unless Privoxy ever gets updated. Steps 8-9 need to be repeated when the
bundled version of Tor changes. Steps 10-11 need to be repeated when the
bundled version of Vidalia changes.

