[tor-commits] [torbrowser/master] Add option for automatic build of obfsproxy TBBs.

erinn at torproject.org erinn at torproject.org
Thu Aug 2 06:58:37 UTC 2012


commit a08b546605d13d82e6f664bf8e2d8b3caf61327c
Author: Shondoit Walker <shondoit at gmail.com>
Date:   Wed Jul 25 22:18:19 2012 +0200

    Add option for automatic build of obfsproxy TBBs.
    
    Introduces the flag USE_OBFSPROXY. When set to 1, an obfsproxy bundle will be build.
---
 build-scripts/linux-alpha.mk   |   34 +++++++++++++++++++++++++++++++++-
 build-scripts/osx-alpha.mk     |   31 ++++++++++++++++++++++++++++++-
 build-scripts/windows-alpha.mk |   32 +++++++++++++++++++++++++++++---
 3 files changed, 92 insertions(+), 5 deletions(-)

diff --git a/build-scripts/linux-alpha.mk b/build-scripts/linux-alpha.mk
index 96d715d..28cfa40 100644
--- a/build-scripts/linux-alpha.mk
+++ b/build-scripts/linux-alpha.mk
@@ -82,6 +82,13 @@ TOR_OPTS=--with-openssl-dir=$(BUILT_DIR) --with-zlib-dir=$(BUILT_DIR) --with-lib
 build-pidgin:
 	echo "We're not building pidgin yet!"
 
+build-obfsproxy: $(OBFSPROXY_DIR)
+ifeq ($(USE_OBFSPROXY),1)
+	cd $(OBFSPROXY_DIR) && libevent_CFLAGS=-I$(BUILT_DIR)/include libevent_LIBS="-L$(BUILT_DIR)/lib -levent" libcrypto_CFLAGS=-I$(BUILT_DIR)/include/openssl libcrypto_LIBS="-L$(BUILT_DIR)/lib -lssl -lcrypto" ./configure --prefix=$(BUILT_DIR)
+	cd $(OBFSPROXY_DIR) && make
+	cd $(OBFSPROXY_DIR) && make install
+endif
+
 build-firefox: config/dot_mozconfig $(FIREFOX_DIR)
 	cp config/dot_mozconfig $(FIREFOX_DIR)/mozconfig
 	cp branding/* $(FIREFOX_DIR)/browser/branding/official
@@ -94,7 +101,7 @@ copy-firefox:
 	mkdir -p $(BUILD_DIR)/Firefox
 	cp -r $(FIREFOX_DIR)/obj-$(ARCH_TYPE)-*/dist/firefox/* $(BUILD_DIR)/Firefox
 
-build-all-binaries: source-dance build-zlib build-openssl build-libpng build-qt build-vidalia build-libevent build-tor build-firefox copy-firefox
+build-all-binaries: source-dance build-zlib build-openssl build-libpng build-qt build-vidalia build-libevent build-tor build-firefox copy-firefox build-obfsproxy
 	echo "If we're here, we've done something right."
 
 ## Location of compiled libraries
@@ -115,12 +122,17 @@ VIDALIA=$(BUILT_DIR)/usr/local/bin/vidalia
 ## Someday, this will be our custom Firefox
 FIREFOX=$(BUILD_DIR)/Firefox
 PIDGIN=$(COMPILED_BINS)/pidgin
+OBFSPROXY=$(COMPILED_BINS)/obfsproxy
 
 ## Location of utility applications
 WGET:=$(shell which wget)
 
 ## Destination for the generic bundle
+ifeq ($(USE_OBFSPROXY),1)
+DEST=generic-obfsproxy-bundle
+else
 DEST=generic-bundle
+endif
 
 ## Name of the bundle
 NAME=tor-browser
@@ -131,6 +143,7 @@ DISTDIR=tbbl-alpha-dist
 ## Version and name of the compressed bundle (also used for source)
 VERSION=$(RELEASE_VER)-$(BUILD_NUM)-dev
 DEFAULT_COMPRESSED_BASENAME=tor-browser-gnu-linux-$(ARCH_TYPE)-$(VERSION)-
+OBFS_COMPRESSED_BASENAME=tor-obfsproxy-browser-gnu-linux-$(ARCH_TYPE)-$(VERSION)-
 IM_COMPRESSED_BASENAME=tor-im-browser-gnu-linux-$(VERSION)-
 DEFAULT_COMPRESSED_NAME=$(DEFAULT_COMPRESSED_BASENAME)$(VERSION)
 IM_COMPRESSED_NAME=$(IM_COMPRESSED_BASENAME)$(VERSION)
@@ -138,8 +151,12 @@ IM_COMPRESSED_NAME=$(IM_COMPRESSED_BASENAME)$(VERSION)
 ifeq ($(USE_PIDGIN),1)
 COMPRESSED_NAME=$(IM_COMPRESSED_NAME)
 else
+ifeq ($(USE_OBFSPROXY),1)
+COMPRESSED_NAME=$(OBFS_COMPRESSED_NAME)
+else
 COMPRESSED_NAME=$(DEFAULT_COMPRESSED_NAME)
 endif
+endif
 
 ## Extensions to install by default
 DEFAULT_EXTENSIONS=torbutton.xpi noscript.xpi httpseverywhere.xpi
@@ -261,6 +278,9 @@ install-binaries:
 	# Vidalia
 	cp $(VIDALIA) $(APPDIR)
 	cp $(TOR) $(APPDIR)
+ifeq ($(USE_OBFSPROXY),1)
+	cp $(OBFSPROXY) $(APPDIR)
+endif
 
 ## Fixup
 ## Collect up license files
@@ -274,6 +294,10 @@ install-docs:
 	cp ../changelog.linux-2.3 $(DOCSDIR)/changelog
 	# This should be updated to be more generic (version-wise) and more Linux specific
 	cp ../README.LINUX-2.3 $(DOCSDIR)/README-TorBrowserBundle
+ifeq ($(USE_OBFSPROXY),1)
+	mkdir -p $(DOCSDIR)/Obfsproxy
+	cp $(OBFSPROXY_DIR)/LICENSE $(DOCSDIR)/Obfsproxy
+endif
 
 ## Copy over Firefox
 install-firefox:
@@ -304,10 +328,18 @@ endif
 ifeq ($(USE_PIDGIN),1)
 	cp config/vidalia.conf.ff+pidgin-linux $(DEST)/Data/Vidalia/vidalia.conf
 else
+ifeq ($(USE_OBFSPROXY),1)
+	cp config/alpha/vidalia.conf.ff-obfsproxy-linux $(DEST)/Data/Vidalia/vidalia.conf
+else
 	cp config/alpha/vidalia.conf.ff-linux $(DEST)/Data/Vidalia/vidalia.conf
 endif
+endif
 	## Configure Tor
+ifeq ($(USE_OBFSPROXY),1)
+	cp config/alpha/torrc-obfsproxy-linux $(DEST)/Data/Tor/torrc
+else
 	cp config/alpha/torrc-linux $(DEST)/Data/Tor/torrc
+endif
 	cp $(TOR_DIR)/src/config/geoip $(DEST)/Data/Tor/geoip
 	chmod 700 $(DEST)/Data/Tor
 
diff --git a/build-scripts/osx-alpha.mk b/build-scripts/osx-alpha.mk
index 4c6a1a4..9f1319d 100644
--- a/build-scripts/osx-alpha.mk
+++ b/build-scripts/osx-alpha.mk
@@ -117,6 +117,13 @@ TOR_CFLAGS="-arch $(ARCH_TYPE) -I$(BUILT_DIR)/include $(MIN_VERSION) $(CF_MIN_VE
 TOR_LDFLAGS="-L$(BUILT_DIR)/lib $(LD_MIN_VERSION)"
 TOR_OPTS=--enable-static-openssl --enable-static-libevent --with-openssl-dir=$(BUILT_DIR)/lib --with-libevent-dir=$(BUILT_DIR)/lib --disable-dependency-tracking $(CC)
 
+build-obfsproxy: $(OBFSPROXY_DIR)
+ifeq ($(USE_OBFSPROXY),1)
+	cd $(OBFSPROXY_DIR) && libevent_CFLAGS=-I$(BUILT_DIR)/include libevent_LIBS="-L$(BUILT_DIR)/lib -levent" libcrypto_CFLAGS=-I$(BUILT_DIR)/include/openssl libcrypto_LIBS="-L$(BUILT_DIR)/lib -lssl -lcrypto" ./configure --prefix=$(BUILT_DIR)
+	cd $(OBFSPROXY_DIR) && make
+	cd $(OBFSPROXY_DIR) && make install
+endif
+
 build-firefox: $(FIREFOX_DIR) config/mozconfig-osx-$(ARCH_TYPE)
 	cp config/mozconfig-osx-$(ARCH_TYPE) $(FIREFOX_DIR)/mozconfig
 	cp branding/* $(FIREFOX_DIR)/browser/branding/official
@@ -127,7 +134,7 @@ copy-firefox:
 	-rm -rf $(BUILD_DIR)/TorBrowser.app
 	cp -r $(FIREFOX_DIR)/obj*/dist/*.app $(BUILD_DIR)/TorBrowser.app
 
-build-all-binaries: build-zlib build-openssl build-vidalia build-libevent build-tor build-firefox
+build-all-binaries: build-zlib build-openssl build-vidalia build-libevent build-tor build-firefox build-obfsproxy
 	echo "If we're here, we've done something right."
 
 ## Location of compiled libraries
@@ -147,12 +154,17 @@ TOR=$(COMPILED_BINS)/tor
 ## Someday, this will be our custom Firefox
 FIREFOX=$(BUILD_DIR)/TorBrowser.app
 PIDGIN=$(COMPILED_BINS)/pidgin
+OBFSPROXY=$(COMPILED_BINS)/obfsproxy
 
 ## Location of utility applications
 WGET:=$(shell which wget)
 
 ## Destination for the generic bundle
+ifeq ($(USE_OBFSPROXY),1)
+DEST=generic-obfsproxy-bundle
+else
 DEST=generic-bundle
+endif
 
 ## Name of the bundle
 NAME=TorBrowser
@@ -163,6 +175,7 @@ DISTDIR=tbbosx-alpha-dist
 ## Version and name of the compressed bundle (also used for source)
 VERSION=$(RELEASE_VER)-$(BUILD_NUM)
 DEFAULT_COMPRESSED_BASENAME=TorBrowser-$(VERSION)-osx-$(ARCH_TYPE)-
+OBFS_COMPRESSED_BASENAME=TorBrowser-Obfsproxy-$(VERSION)-osx-$(ARCH_TYPE)-
 IM_COMPRESSED_BASENAME=TorBrowser-IM-$(VERSION)-
 DEFAULT_COMPRESSED_NAME=$(DEFAULT_COMPRESSED_BASENAME)
 IM_COMPRESSED_NAME=$(IM_COMPRESSED_BASENAME)$(VERSION)
@@ -170,8 +183,12 @@ IM_COMPRESSED_NAME=$(IM_COMPRESSED_BASENAME)$(VERSION)
 ifeq ($(USE_PIDGIN),1)
 COMPRESSED_NAME=$(IM_COMPRESSED_NAME)
 else
+ifeq ($(USE_OBFSPROXY),1)
+COMPRESSED_NAME=$(OBFS_COMPRESSED_NAME)
+else
 COMPRESSED_NAME=$(DEFAULT_COMPRESSED_NAME)
 endif
+endif
 
 ## Extensions to install by default
 DEFAULT_EXTENSIONS=torbutton.xpi
@@ -270,6 +287,9 @@ install-binaries:
 	# Vidalia
 	cp -R $(VIDALIA) $(APPDIR)/Vidalia.app
 	cp $(TOR) $(APPDIR)
+ifeq ($(USE_OBFSPROXY),1)
+	cp $(OBFSPROXY) $(APPDIR)
+endif
 
 VIDALIA_PLUGINS=$(BUILD_DIR)/vidalia-plugins
 install-plugins:
@@ -310,14 +330,23 @@ configure-apps:
 	mkdir -p $(DEST)/Library/Vidalia/plugins
 	#cp -r $(BUILD_DIR)/vidalia-plugins/tbb $(DEST)/Library/Vidalia/plugins
 	mkdir -p $(DEST)/Library/Vidalia
+
+ifeq ($(USE_OBFSPROXY),1)
+	cp config/vidalia.conf.ff-obfsproxy-osx $(DEST)/Library/Vidalia/vidalia.conf
+else
 ifeq ($(USE_SANDBOX),1)
 	cp config/vidalia.conf.ff-osx-sandbox $(DEST)/Library/Vidalia/vidalia.conf
 else
 	cp config/alpha/vidalia.conf.ff-osx $(DEST)/Library/Vidalia/vidalia.conf
 endif
+endif
 
 	## Configure Tor
+ifeq ($(USE_OBFSPROXY),1)
+	cp config/alpha/torrc-obfsproxy-osx $(DEST)/Library/Vidalia/torrc
+else
 	cp config/alpha/torrc-osx $(DEST)/Library/Vidalia/torrc
+endif
 	cp $(TOR_DIR)/src/config/geoip $(DEST)/Contents/Resources/Data/Tor/geoip
 	chmod 700 $(DATADIR)/Tor
 
diff --git a/build-scripts/windows-alpha.mk b/build-scripts/windows-alpha.mk
index 39dffe5..97ababf 100644
--- a/build-scripts/windows-alpha.mk
+++ b/build-scripts/windows-alpha.mk
@@ -81,7 +81,7 @@ build-qt: build-zlib build-openssl $(QT_DIR)
 VIDALIA_OPTS=-DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -Wl,--nxcompat -Wl,--dynamicbase" -DWIN2K=1 -DQT_QMAKE_EXECUTABLE=$(QT_LIB)/qmake -DCMAKE_BUILD_TYPE=minsizerel -DMINGW_BINARY_DIR=$(MING) -DWIX_BINARY_DIR=$(WIX_LIB)
 # XXX Once we build qt on windows, we'll want to add build-qt here
 build-vidalia: PATH+=:$(QT_LIB)
-build-vidalia: $(VIDALIA_DIR) $(WIX_LIB)
+build-vidalia: $(VIDALIA_DIR) | $(WIX_LIB)
 	-mkdir $(VIDALIA_DIR)/build
 	cd $(VIDALIA_DIR)/build && cmake -G "MSYS Makefiles" $(VIDALIA_OPTS) ..
 	cd $(VIDALIA_DIR)/build && make -j $(NUM_CORES)
@@ -103,10 +103,12 @@ TOR_LDFLAGS="-L$(BUILT_DIR)/lib -L$(BUILT_DIR)/bin"
 TOR_OPTS=--enable-static-libevent --with-libevent-dir=$(BUILT_DIR)/lib --disable-asciidoc
 build-tor:PATH+=:$(BUILT_DIR)/bin
 
-build-obfsproxy:
+build-obfsproxy: $(OBFSPROXY_DIR)
+ifeq ($(USE_OBFSPROXY),1)
 	cd $(OBFSPROXY_DIR) && libevent_CFLAGS=-I$(BUILT_DIR)/include libevent_LIBS="-L$(BUILT_DIR)/lib -levent" libcrypto_CFLAGS=-I$(BUILT_DIR)/include/openssl libcrypto_LIBS="-L$(BUILT_DIR)/lib -lssl -lcrypto" ./configure --prefix=$(BUILT_DIR)
 	cd $(OBFSPROXY_DIR) && make
 	cd $(OBFSPROXY_DIR) && make install
+endif
 
 build-firefox: $(FIREFOX_DIR) config/dot_mozconfig $(MOZBUILD_DIR) $(MOZBUILD_DIR)/start-msvc$(MSVC_VER).bat | $(PYTHON) $(PYMAKE_DIR)
 	cp config/dot_mozconfig $(FIREFOX_DIR)/mozconfig
@@ -121,7 +123,7 @@ copy-firefox:
 	cp "/c/Program Files (x86)/Microsoft Visual Studio 9.0/VC/redist/x86/Microsoft.VC90.CRT/"msvc*90.dll $(FIREFOX)/App/Firefox
 	cp -r $(FIREFOX_DIR)/obj-*/dist/firefox/* $(FIREFOX)/App/Firefox
 
-build-all-binaries: build-zlib build-openssl build-vidalia build-libevent build-tor build-firefox copy-firefox
+build-all-binaries: build-zlib build-openssl build-vidalia build-libevent build-tor build-firefox copy-firefox build-obfsproxy
 	echo "If we're here, we've done something right."
 
 ## Location of compiled libraries
@@ -137,7 +139,11 @@ LIBEVENT=$(COMPILED_LIBS)
 
 
 ## Destination for the generic bundle
+ifeq ($(USE_OBFSPROXY),1)
+DEST="Generic Obfsproxy Bundle"
+else
 DEST="Generic Bundle"
+endif
 
 ## Name of the bundle
 NAME="Tor Browser"
@@ -148,6 +154,7 @@ DISTDIR=tbbwin-alpha-dist
 ## Version and name of the compressed bundle (also used for source)
 VERSION=$(RELEASE_VER)-$(BUILD_NUM)
 DEFAULT_COMPRESSED_BASENAME=tor-browser-$(VERSION)
+OBFS_COMPRESSED_BASENAME=tor-obfsproxy-browser-$(VERSION)
 IM_COMPRESSED_BASENAME=tor-im-browser-$(VERSION)
 DEFAULT_COMPRESSED_NAME=$(DEFAULT_COMPRESSED_BASENAME)
 IM_COMPRESSED_NAME=$(IM_COMPRESSED_BASENAME)$(VERSION)
@@ -155,8 +162,12 @@ IM_COMPRESSED_NAME=$(IM_COMPRESSED_BASENAME)$(VERSION)
 ifeq ($(USE_PIDGIN),1)
 COMPRESSED_NAME=$(IM_COMPRESSED_NAME)
 else
+ifeq ($(USE_OBFSPROXY),1)
+COMPRESSED_NAME=$(OBFS_COMPRESSED_BASENAME)
+else
 COMPRESSED_NAME=$(DEFAULT_COMPRESSED_NAME)
 endif
+endif
 
 ## Extensions to install by default
 DEFAULT_EXTENSIONS=torbutton.xpi
@@ -260,6 +271,9 @@ install-binaries:
 	cp $(OPENSSL_LIB)/libeay32.dll $(APPDIR)
 	cp $(VIDALIA)/build/src/vidalia/vidalia.exe $(APPDIR)
 	cp $(TOR)/src/or/tor.exe $(APPDIR)
+ifeq ($(USE_OBFSPROXY),1)
+	cp $(OBFSPROXY_DIR)/obfsproxy.exe $(APPDIR)
+endif
 
 install-plugins:
 	mkdir -p $(DATADIR)/Vidalia/plugins
@@ -280,6 +294,10 @@ install-docs:
 	cp $(MING)/../msys/1.0/share/doc/MSYS/COPYING $(DOCSDIR)/MinGW
 	cp ../changelog.windows-2.3 $(DOCSDIR)/changelog
 	cp ../README.WIN-2.3 $(DOCSDIR)/README-TorBrowserBundle
+ifeq ($(USE_OBFSPROXY),1)
+	mkdir -p $(DOCSDIR)/Obfsproxy
+	cp $(OBFSPROXY_DIR)/LICENSE $(DOCSDIR)/Obfsproxy
+endif
 
 ## Copy over FirefoxPortable
 install-firefoxportable:
@@ -319,10 +337,18 @@ endif
 ifeq ($(USE_PIDGIN),1)
 	cp config/alpha/vidalia.conf.ff+pidgin $(DEST)/Data/Vidalia/vidalia.conf
 else
+ifeq ($(USE_OBFSPROXY),1)
+	cp config/alpha/vidalia.conf.ff-obfsproxy $(DEST)/Data/Vidalia/vidalia.conf
+else
 	cp config/alpha/vidalia.conf.ff $(DEST)/Data/Vidalia/vidalia.conf
 endif
+endif
 	## Configure Tor
+ifeq ($(USE_OBFSPROXY),1)
+	cp config/alpha/torrc-obfsproxy $(DEST)/Data/Tor/torrc
+else
 	cp config/alpha/torrc $(DEST)/Data/Tor/torrc
+endif
 	cp $(TOR)/src/config/geoip $(DEST)/Data/Tor
 
 launcher:





More information about the tor-commits mailing list