== Dependencies

Python setuptools (i.e., setup.py) will try to download dependencies of
packages in an unsafe way by default. To disable this, run the command
	$ export http_proxy=127.0.0.1:9
in any shell where you are executing setup.py commands.

=== 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-root/usr
	$ make
	$ make install

=== M2Crypto

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

	$ python setup.py build_ext --swig ~/bundle-root/usr/bin/swig
	$ mkdir -p ~/usr/lib/python2.7/site-packages/
	$ python setup.py install --root=~/bundle-root --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-root --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.

=== Pluggable transport repos

Get checkouts of pluggable transports and this bundle repository.

	$ cd
	$ git clone https://git.torproject.org/pluggable-transports/bundle.git
	$ 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

== Browser bundle

Update pluggable transport checkouts.

	$ cd ~/bundle && git pull
	$ cd ~/pyptlib && git pull
	$ cd ~/obfsproxy && git pull
	$ cd ~/flashproxy && git pull

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 (search for
"Alpha Releases"). 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.

If you installed dependencies somewhere other than ~/bundle-root, edit
the variable MACOSX_BUNDLE_ROOT in Makefile.

	$ make macosx-i686

Test running the bundle.
