== Creating a Debian VM

Set up Debian VMs for building bundles. You need one for i386 and one
for amd64.

http://cdimage.debian.org/debian-cd/7.0.0/i386/iso-cd/debian-7.0.0-i386-netinst.iso
http://cdimage.debian.org/debian-cd/7.0.0/i386/iso-cd/SHA256SUMS
http://cdimage.debian.org/debian-cd/7.0.0/i386/iso-cd/SHA256SUMS.sign

http://cdimage.debian.org/debian-cd/7.0.0/amd64/iso-cd/debian-7.0.0-amd64-netinst.iso
http://cdimage.debian.org/debian-cd/7.0.0/amd64/iso-cd/SHA256SUMS
http://cdimage.debian.org/debian-cd/7.0.0/amd64/iso-cd/SHA256SUMS.sign

Verify the digests.
	http://www.debian.org/CD/verify
If you are using Debian, you can get the signing key by installing the
debian-keyring package (apt-get install debian-keyring). Add
	--keyring /usr/share/keyrings/debian-role-keys.gpg
to the gpg --verify command.

	$ gpg --verify SHA256SUMS.sign SHA256SUMS

	$ sha256sum debian-7.0.0-i386-netinst.iso
	e41fbf8a1691faba2eba1981f42503027d6793e8e9bb02afcf6836b76dbdbdb6  debian-7.0.0-i386-netinst.iso
	$ grep netinst SHA256SUMS
	e41fbf8a1691faba2eba1981f42503027d6793e8e9bb02afcf6836b76dbdbdb6  debian-7.0.0-i386-netinst.iso

	$ sha256sum debian-7.0.0-amd64-netinst.iso
	a1f8bf08ac01ba44437482b0afa0676839a16a20d7d9f6cb1d8ea0fc2b383ac4  debian-7.0.0-amd64-netinst.iso
	$ grep netinst SHA256SUMS
	a1f8bf08ac01ba44437482b0afa0676839a16a20d7d9f6cb1d8ea0fc2b383ac4  debian-7.0.0-amd64-netinst.iso

Create the disk images.

	$ qemu-img create -f qcow2 debian-7-i386-bundle.hda 10G
	$ qemu-img create -f qcow2 debian-7-amd64-bundle.hda 10G

Then boot the VM. You need your normal user to be in the "kvm" group for
this to work (sudo usermod -a -G kvm user).

	$ kvm -hda debian-7-i386-bundle.hda -cdrom debian-7.0.0-i386-netinst.iso
	$ kvm -hda debian-7-amd64-bundle.hda -cdrom debian-7.0.0-amd64-netinst.iso

Choose "Install" when it boots. Here are settings:

	English
	United States
	American English
	Hostname: debian
	Domain name:
	Root password:
	User full name: bundle
	User name: bundle
	User password: password
	Any time zone
	Guided - use entire disk
	All files in one partition
	Any mirror
	popularity-contest: no
	Software select: uncheck all but "Standard system utilities"
	GRUB on MBR: yes

Packages to install:

	$ sudo apt-get install --no-install-recommends git make zip
	$ sudo apt-get install --no-install-recommends golang
	$ sudo apt-get install --no-install-recommends python-argparse python-crypto python-m2crypto python-setuptools python-twisted

One time only, you need to "go get" the websocket library for Go. GOPATH
must be set to the same place for subsequent runs. Ignore the warnings
about multiple definitions from "go get"; they happen because
websocket-client and websocket-server share some source files.

	$ sudo apt-get install --no-install-recommends mercurial
	$ export GOPATH=~/go
	$ cd ~/flashproxy/websocket-transport
	$ go get

== Browser bundle

Clone this bundle repository, and 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/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

Update your Debian.

	$ sudo apt-get update
	$ sudo apt-get upgrade

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.

Run one of these two commands, depending on the platform:
	$ make gnulinux-i686
	$ make gnulinux-x86_64

Test running the bundle.
