<commit_before>== 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/6.0.6/i386/iso-cd/debian-6.0.6-i386-netinst.iso
http://cdimage.debian.org/debian-cd/6.0.6/i386/iso-cd/SHA256SUMS
http://cdimage.debian.org/debian-cd/6.0.6/i386/iso-cd/SHA256SUMS.sign

http://cdimage.debian.org/debian-cd/6.0.6/amd64/iso-cd/debian-6.0.6-amd64-netinst.iso
http://cdimage.debian.org/debian-cd/6.0.6/amd64/iso-cd/SHA256SUMS
http://cdimage.debian.org/debian-cd/6.0.6/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-6.0.6-i386-netinst.iso
	2b4bcd9e782dfd6a5af9cac3e981be375652b2e5579402405eaf84ac4fe3754f  debian-6.0.6-i386-netinst.iso
	$ grep netinst SHA256SUMS
	2b4bcd9e782dfd6a5af9cac3e981be375652b2e5579402405eaf84ac4fe3754f  debian-6.0.6-i386-netinst.iso

	$ sha256sum debian-6.0.6-amd64-netinst.iso
	41d74134bf967b65d0b61a314ee07dfb539e03502ca69d9d3be8ab3b01da02d2  debian-6.0.6-amd64-netinst.iso
	$ grep netinst SHA256SUMS
	41d74134bf967b65d0b61a314ee07dfb539e03502ca69d9d3be8ab3b01da02d2  debian-6.0.6-amd64-netinst.iso

Create the disk images.

	$ qemu-img create -f qcow2 debian-6-i386-bundle.hda 10G
	$ qemu-img create -f qcow2 debian-6-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-6-i386-bundle.hda -cdrom debian-6.0.6-i386-netinst.iso
	$ kvm -hda debian-6-amd64-bundle.hda -cdrom debian-6.0.6-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 python-m2crypto zip
	$ sudo apt-get install --no-install-recommends python-setuptools python-crypto python-twisted python-argparse

== Dependencies

=== pyptlib

	$ git clone https://git.torproject.org/pluggable-transports/pyptlib.git
	$ cd pyptlib
	$ sudo python setup.py install --single-version-externally-managed --root=/

== Browser bundle

Clone and build the flashproxy source.

	$ git clone https://git.torproject.org/flashproxy.git
	$ cd flashproxy
	$ make dist

Clone pyobfsproxy.

	$ git clone https://git.torproject.org/pluggable-transports/pyobfsproxy.git

Update your Debian.

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

Within the VM, download the 32-bit or 64-bit browser bundle from
https://www.torproject.org/projects/torbrowser.html.en#Download-torbrowserbundlealpha.
The instructions below are for the 32-bit (i686) version.

https://www.torproject.org/dist/torbrowser/linux/tor-browser-gnu-linux-i686-2.4.11-alpha-1-dev-en-US.tar.gz
https://www.torproject.org/dist/torbrowser/linux/tor-browser-gnu-linux-i686-2.4.11-alpha-1-dev-en-US.tar.gz.asc

https://www.torproject.org/dist/torbrowser/linux/tor-browser-gnu-linux-x86_64-2.4.11-alpha-1-dev-en-US.tar.gz
https://www.torproject.org/dist/torbrowser/linux/tor-browser-gnu-linux-x86_64-2.4.11-alpha-1-dev-en-US.tar.gz.asc

Extract the bundle.

	$ gpg --verify tor-browser-gnu-linux-i686-2.4.11-alpha-1-dev-en-US.tar.gz.asc
	$ rm -r tor-browser_en-US
	$ tar xzvf tor-browser-gnu-linux-i686-2.4.11-alpha-1-dev-en-US.tar.gz

Copy files into the bundle.

	$ cd tor-browser_en-US
	$ cp ~/flashproxy/dist/flashproxy-client-VERSION/{flashproxy-client,flashproxy-reg-email,flashproxy-reg-http,flashproxy-reg-url} App
	$ cp -rL /usr/lib/pymodules/python2.6/M2Crypto App
	$ mkdir -p Docs/FlashProxy
	$ cp ~/flashproxy/dist/flashproxy-client-VERSION/{doc/*,README,LICENSE,ChangeLog} Docs/FlashProxy
	$ cp -rL ~/pyobfsproxy/{obfsproxy,bin/pyobfsproxy} App
	$ cp -rL /usr/lib/python2.6/dist-packages/{Crypto,twisted,zope} App
	$ cp -rL /usr/lib/pymodules/python2.6/argparse.py App
	$ cp -rL /usr/local/lib/python2.6/dist-packages/pyptlib App
	$ mkdir -p Docs/PyObfsproxy
	$ cp ~/pyobfsproxy/{LICENSE,README} Docs/PyObfsproxy
	$ find App -name '*.pyc' | xargs rm -f

Append bundle-torrc-gnulinux to the end of Data/Tor/torrc.

	$ cat ~/flashproxy/doc/bundle-torrc-gnulinux >> Data/Tor/torrc

Re-zip the bundle. The "alpha" number should be independent of the
browser bundle's alpha.

	$ cd ..
	$ tar czvf tor-pluggable-transports-browser-gnu-linux-i686-2.4.11-alpha-1-dev-en-US.tar.gz tor-browser_en-US

Test running the bundle. Extract into a separate directory, double-click
the icon to unzip, and run TorBrowser_en-US.app.

	$ mkdir tmp
	$ cp tor-pluggable-transports-browser-gnu-linux-i686-2.4.11-alpha-1-dev-en-US.tar.gz tmp
	$ cd tmp
	$ tar xzvf tor-pluggable-transports-browser-gnu-linux-i686-2.4.11-alpha-1-dev-en-US.tar.gz
	$ cd tor-browser_en-US
	$ ./start-tor-browser<commit_msg>Update bundle-gnulinux.txt to use the makefile.<commit_after>== 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/6.0.6/i386/iso-cd/debian-6.0.6-i386-netinst.iso
http://cdimage.debian.org/debian-cd/6.0.6/i386/iso-cd/SHA256SUMS
http://cdimage.debian.org/debian-cd/6.0.6/i386/iso-cd/SHA256SUMS.sign

http://cdimage.debian.org/debian-cd/6.0.6/amd64/iso-cd/debian-6.0.6-amd64-netinst.iso
http://cdimage.debian.org/debian-cd/6.0.6/amd64/iso-cd/SHA256SUMS
http://cdimage.debian.org/debian-cd/6.0.6/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-6.0.6-i386-netinst.iso
	2b4bcd9e782dfd6a5af9cac3e981be375652b2e5579402405eaf84ac4fe3754f  debian-6.0.6-i386-netinst.iso
	$ grep netinst SHA256SUMS
	2b4bcd9e782dfd6a5af9cac3e981be375652b2e5579402405eaf84ac4fe3754f  debian-6.0.6-i386-netinst.iso

	$ sha256sum debian-6.0.6-amd64-netinst.iso
	41d74134bf967b65d0b61a314ee07dfb539e03502ca69d9d3be8ab3b01da02d2  debian-6.0.6-amd64-netinst.iso
	$ grep netinst SHA256SUMS
	41d74134bf967b65d0b61a314ee07dfb539e03502ca69d9d3be8ab3b01da02d2  debian-6.0.6-amd64-netinst.iso

Create the disk images.

	$ qemu-img create -f qcow2 debian-6-i386-bundle.hda 10G
	$ qemu-img create -f qcow2 debian-6-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-6-i386-bundle.hda -cdrom debian-6.0.6-i386-netinst.iso
	$ kvm -hda debian-6-amd64-bundle.hda -cdrom debian-6.0.6-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 python-m2crypto zip
	$ sudo apt-get install --no-install-recommends python-setuptools python-crypto python-twisted python-argparse

== Dependencies

=== pyptlib

	$ git clone https://git.torproject.org/pluggable-transports/pyptlib.git
	$ cd pyptlib
	$ sudo python setup.py install --single-version-externally-managed --root=/

== Browser bundle

Clone and build the flashproxy source.

	$ git clone https://git.torproject.org/flashproxy.git
	$ cd flashproxy
	$ make dist

Clone pyobfsproxy.

	$ git clone https://git.torproject.org/pluggable-transports/pyobfsproxy.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.
{'fraction_non_alphanumeric': 0.11589778380823157, 'fraction_numerical': 0.07835820895522388, 'mean_word_length': 3.8894416804864567, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 12, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5412815', 'n_tokens_mistral': 3895, 'n_tokens_neox': 3475, 'n_words': 727}