== Dependencies

=== SWIG

This is a prerequisite for building M2Crypto.

http://www.swig.org/download.html
http://downloads.sourceforge.net/project/swig/swig/swig-2.0.8/swig-2.0.8.tar.gz

The sha256sum (shasum -a 256) of the package I used was

aeeefa20bbe1c03bacf23f0af9e7d6193e8b807b7585470615b71b1ee0c8ca4f  swig-2.0.8.tar.gz

SWIG requires PCRE, but is capable of building PCRE by itself if you
download the source first. Save the PCRE tarball inside the extracted
SWIG directory.

http://www.pcre.org
http://downloads.sourceforge.net/project/pcre/pcre/8.32/pcre-8.32.tar.bz2
http://downloads.sourceforge.net/project/pcre/pcre/8.32/pcre-8.32.tar.bz2.sig

	$ rm pcre-8.32.tar.bz2.sig # The next command won't run with this file present.
	$ ./Tools/pcre-build.sh
	$ ./configure --prefix=~/bundle/usr
	$ make
	$ make install

=== M2Crypto

http://chandlerproject.org/Projects/MeTooCrypto#Downloads
http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.21.1.tar.gz
http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.21.1.tar.gz.asc

	$ python setup.py build_ext --swig ~/bundle/usr/bin/swig
	$ mkdir -p ~/usr/lib/python2.7/site-packages/
	$ python setup.py install --root=~/bundle --prefix=/usr

=== PyCrypto

https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.tar.gz
https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.tar.gz.asc

Extract and verify the tarball. Then run

	$ python setup.py install --root=~/bundle --prefix=/usr

=== argparse

This is included for compatibility with older versions of python.
See https://trac.torproject.org/projects/tor/ticket/8549.

https://argparse.googlecode.com/files/argparse-1.2.1.tar.gz

The sha256 sum should be

ddaf4b0a618335a32b6664d4ae038a1de8fbada3b25033f9021510ed2b3941a4  argparse-1.2.1.tar.gz

Extract the tarball into your bundle directory.

== Go cross compiler

https://code.google.com/p/go/downloads/list
https://go.googlecode.com/files/go1.1.src.tar.gz

	$ cd
	$ tar xzvf go1.1.src.tar.gz
	$ cd go/src
	$ GOOS=darwin GOARCH=386 ./make.bash --no-clean
	$ cd ~/flashproxy/websocket-transport/
	$ export GOPATH=~/gotmp
	$ sudo apt-get install mercurial
	$ ~/go/bin/go get
	$ GOOS=darwin GOARCH=386 ~/go/bin/go build -o websocket-client websocket-client.go socks.go pt.go
	$ file websocket-client
	websocket-client: Mach-O i386 executable

== Browser bundle

Clone pyptlib, obfsproxy, and flashproxy. Set each one to the branch you
want to include in the builds; e.g., "git pull" or "git checkout 1.0".

	$ cd
	$ git clone https://git.torproject.org/pluggable-transports/pyptlib.git
	$ git clone https://git.torproject.org/pluggable-transports/obfsproxy.git
	$ git clone https://git.torproject.org/flashproxy.git

Enter the doc directory and edit the top of Makefile to set the version
numbers you want to use.
	BUNDLE_VERSION = ...
	BUNDLE_RELEASE = ...
	PT_BUNDLE_RELEASE = pt1
The latest Tor Browser Bundle version number can be found at
https://www.torproject.org/projects/torbrowser.html.en#Download-torbrowserbundlealpha.
PT_BUNDLE_RELEASE release should increment each time you build a new
bundle with the same BUNDLE_VERSION and BUNDLE_RELEASE, and be reset to
"pt1" when either of those change.

	$ make macosx-i686

Test running the bundle.
