commit e893bbf146605cc8a9fb42c6b74640027160a848 Author: Erinn Clark erinn@torproject.org Date: Tue Jan 31 18:25:58 2012 +0100
add windows and linux alpha makefiles --- build-scripts/linux-alpha.mk | 518 +++++++++++++++++++++++++++++++++++++++ build-scripts/windows-alpha.mk | 523 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1041 insertions(+), 0 deletions(-)
diff --git a/build-scripts/linux-alpha.mk b/build-scripts/linux-alpha.mk new file mode 100644 index 0000000..409db51 --- /dev/null +++ b/build-scripts/linux-alpha.mk @@ -0,0 +1,518 @@ +### +### Makefile for building Tor USB bundle on Gnu/Linux +### +### Copyright 2007 Steven J. Murdoch http://www.cl.cam.ac.uk/users/sjm217/ +### Copyright 2009 Jacob Appelbaum jacob@appelbaum.net +### Copyright 2010 Erinn Clark erinn@torproject.org +### +### You want to do the following currently supported activities: +# This downloads and compiles everything +### make -f linux-alpha.mk build-all-binaries +# This makes a generic bundle +### make -f linux-alpha.mk generic-bundle +# This makes the English bundle +### make -f linux-alpha.mk bundle_en-US +# This makes the German bundle +### make -f linux-alpha.mk bundle_de +# This makes the German compressed bundle +### make -f linux-alpha.mk compressed-bundle_de +# It's possible you may also want to do: +### make -f linux-alpha.mk build-all-binaries +### make -f linux-alpha.mk all-compressed-bundles +### ... +### Look in tbbl-dist/ for your files. +### +### See LICENSE for licensing information +### +### $Id: Makefile 19973 2009-07-12 02:26:03Z phobos $ +### + +##################### +### Configuration ### +##################### + +## Include versions +include $(PWD)/versions-alpha.mk + +## Architecture +ARCH_TYPE=$(shell uname -m) +BUILD_NUM=4 +PLATFORM=Linux + +## Location of directory for source unpacking +FETCH_DIR=/srv/build-trees/build-alpha-$(ARCH_TYPE) +## Location of directory for prefix/destdir/compiles/etc +BUILT_DIR=$(FETCH_DIR)/built +TBB_FINAL=$(BUILT_DIR)/TBBL + +source-dance: fetch-source unpack-source + echo "We're ready for building now." + +ZLIB_DIR=$(FETCH_DIR)/zlib-$(ZLIB_VER) +ZLIB_OPTS=--shared --prefix=$(BUILT_DIR) +build-zlib: + cd $(ZLIB_DIR) && ./configure $(ZLIB_OPTS) + cd $(ZLIB_DIR) && make + cd $(ZLIB_DIR) && make install + +OPENSSL_DIR=$(FETCH_DIR)/openssl-$(OPENSSL_VER) +OPENSSL_OPTS=-no-idea -no-rc5 -no-md2 shared zlib --prefix=$(BUILT_DIR) --openssldir=$(BUILT_DIR) -I$(BUILT_DIR)/include -L$(BUILT_DIR)/lib +build-openssl: + cd $(OPENSSL_DIR) && ./config $(OPENSSL_OPTS) + cd $(OPENSSL_DIR) && make depend + cd $(OPENSSL_DIR) && make + cd $(OPENSSL_DIR) && make install + +QT_DIR=$(FETCH_DIR)/qt-everywhere-opensource-src-$(QT_VER) +QT_BUILD_PREFS=-system-zlib -confirm-license -opensource -openssl-linked -no-qt3support -fast -release -nomake demos -nomake examples +QT_OPTS=$(QT_BUILD_PREFS) -prefix $(BUILT_DIR) -I $(BUILT_DIR)/include -I $(BUILT_DIR)/include/openssl/ -L$(BUILT_DIR)/lib +build-qt: + cd $(QT_DIR) && ./configure $(QT_OPTS) + cd $(QT_DIR) && make + cd $(QT_DIR) && make install + +QTSCRIPT_DIR=$(FETCH_DIR)/qtscriptgenerator +QTSCRIPT_OPTS= +build-qtscript: + cd $(QTSCRIPT_DIR)/generator && $(BUILT_DIR)/bin/qmake + cd $(QTSCRIPT_DIR)/generator && make -j4 + cd $(QTSCRIPT_DIR)/generator && ./generator --include-paths=/usr/include/ + cp ../src/current-patches/qt/000* $(QTSCRIPT_DIR)/qtbindings/qtscript_uitools + cp patch-any-src.sh $(QTSCRIPT_DIR)/qtbindings/qtscript_uitools + cd $(QTSCRIPT_DIR)/qtbindings/qtscript_uitools && ./patch-any-src.sh + cd $(QTSCRIPT_DIR)/generator && $(BUILT_DIR)/bin/qmake + cd $(QTSCRIPT_DIR)/generator && make -j4 + cd $(QTSCRIPT_DIR)/qtbindings && $(BUILT_DIR)/bin/qmake -recursive CONFIG+="release" INCLUDEPATH+=/srv/build-trees/build-alpha-i686/built/include +build-qtfoo: + cd $(QTSCRIPT_DIR)/qtbindings && for i in $(ls -d qtscript_*); do make -C $i release; done + + +VIDALIA_DIR=$(FETCH_DIR)/vidalia-$(VIDALIA_VER) +VIDALIA_OPTS=-DOPENSSL_LIBCRYPTO=$(BUILT_DIR)/lib/libcrypto.so.1.0.0 -DOPENSSL_LIBSSL=$(BUILT_DIR)/lib/libssl.so.1.0.0 -DQT_QMAKE_EXECUTABLE=$(BUILT_DIR)/bin/qmake -DSCRIPT_DIR=$(QTSCRIPT_DIR)/plugins/script -DTOR_SOURCE_DIR=$(TOR_DIR) .. +build-vidalia: + -rm -rf $(VIDALIA_DIR)/build + -mkdir $(VIDALIA_DIR)/build + cd $(VIDALIA_DIR)/build && cmake $(VIDALIA_OPTS) && make +# cd $(VIDALIA_DIR)/build && DESTDIR=$(BUILT_DIR) make install + +LIBEVENT_DIR=$(FETCH_DIR)/libevent-$(LIBEVENT_VER) +LIBEVENT_OPTS=--prefix=$(BUILT_DIR) +build-libevent: + cd $(LIBEVENT_DIR) && ./configure $(LIBEVENT_OPTS) + cd $(LIBEVENT_DIR) && make -j2 + cd $(LIBEVENT_DIR) && make install + +LIBPNG_DIR=$(FETCH_DIR)/libpng-$(LIBPNG_VER) +LIBPNG_OPTS=--prefix=$(BUILT_DIR) +build-libpng: + cd $(LIBPNG_DIR) && ./configure $(LIBPNG_OPTS) + cd $(LIBPNG_DIR) && make + cd $(LIBPNG_DIR) && make install + +TOR_DIR=$(FETCH_DIR)/tor-$(TOR_VER) +TOR_OPTS=--enable-gcc-warnings --with-openssl-dir=$(BUILT_DIR) --with-zlib-dir=$(BUILT_DIR) --with-libevent-dir=$(BUILT_DIR)/lib --prefix=$(BUILT_DIR) +build-tor: + cd $(TOR_DIR) && ./configure $(TOR_OPTS) + cd $(TOR_DIR) && make -j2 + #cd $(TOR_DIR) && make install + +## Polipo doesn't use autoconf, so we just have to hack their Makefile +## This probably needs to be updated if Polipo ever updates their Makefile +POLIPO_DIR=$(FETCH_DIR)/polipo-$(POLIPO_VER) +POLIPO_MAKEFILE=$(CONFIG_SRC)/polipo-Makefile +build-polipo: + cp $(POLIPO_MAKEFILE) $(POLIPO_DIR)/Makefile + cd $(POLIPO_DIR) && make && PREFIX=$(FETCH_DIR)/built/ make install.binary + +build-pidgin: + echo "We're not building pidgin yet!" + +FIREFOX_DIR=$(FETCH_DIR)/mozilla-release +build-firefox: + cp ../src/current-patches/firefox/* $(FIREFOX_DIR) + cp patch-any-src.sh $(FIREFOX_DIR) + cp $(CONFIG_SRC)/dot_mozconfig $(FIREFOX_DIR)/mozconfig + cd $(FIREFOX_DIR) && ./patch-any-src.sh + cd $(FIREFOX_DIR) && make -f client.mk build + +copy-firefox: + -rm -rf $(FETCH_DIR)/Firefox + ## This is so ugly. Update it to use cool tar --transform soon. + cd $(FIREFOX_DIR) && make -C obj-$(ARCH_TYPE)-*/ package + cp $(FIREFOX_DIR)/obj-$(ARCH_TYPE)-*/dist/*bz2 $(FETCH_DIR) + cd $(FETCH_DIR) && tar -xvjf firefox-$(FIREFOX_VER).en-US.linux-$(ARCH_TYPE).tar.bz2 && mv firefox Firefox + +# source-dance unpack-source +build-all-binaries: source-dance build-zlib build-openssl build-libpng build-qt build-vidalia build-libevent build-tor build-firefox + echo "If we're here, we've done something right." + +## Location of compiled libraries +COMPILED_LIBS=$(BUILT_DIR)/lib +## Location of compiled binaries +COMPILED_BINS=$(BUILT_DIR)/bin/ + +## Location of the libraries we've built +LIBEVENT=$(COMPILED_LIBS) +LIBPNG=$(COMPILED_LIBS) +OPENSSL=$(COMPILED_LIBS) +QT=$(COMPILED_LIBS) +ZLIB=$(COMPILED_LIBS) + +## Location of binary bundle components +POLIPO=$(COMPILED_BINS)/polipo +#TOR=$(COMPILED_BINS)/tor +#VIDALIA=$(BUILT_DIR)/usr/local/bin/vidalia +TOR=$(FETCH_DIR)/tor-$(TOR_VER)/src/or/tor +VIDALIA=$(FETCH_DIR)/vidalia-$(VIDALIA_VER)/build/src/vidalia/vidalia +## Someday, this will be our custom Firefox +FIREFOX=$(FETCH_DIR)/Firefox +PIDGIN=$(COMPILED_BINS)/pidgin + +## Location of utility applications +WGET:=$(shell which wget) + +## Size of split archive volumes for WinRAR +SPLITSIZE=1440k + +## Location of config files +CONFIG_SRC=config + +## Destination for the generic bundle +DEST=generic-bundle + +## Name of the bundle +NAME=tor-browser + +## Where shall we put the finished files for distribution? +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)- +IM_COMPRESSED_BASENAME=tor-im-browser-gnu-linux-$(VERSION)- +DEFAULT_COMPRESSED_NAME=$(DEFAULT_COMPRESSED_BASENAME)$(VERSION) +IM_COMPRESSED_NAME=$(IM_COMPRESSED_BASENAME)$(VERSION) + +ifeq ($(USE_PIDGIN),1) +COMPRESSED_NAME=$(IM_COMPRESSED_NAME) +else +COMPRESSED_NAME=$(DEFAULT_COMPRESSED_NAME) +endif + +## Extensions to install by default +DEFAULT_EXTENSIONS=torbutton.xpi noscript.xpi httpseverywhere.xpi + +## Where to download Mozilla language packs +MOZILLA_LANGUAGE=http://releases.mozilla.org/pub/mozilla.org/firefox/releases/$(FIREFOX_VER)/... + +## Put more extensions here +EXTENSIONS_DIR=extensions + +## Local overrides +-include local.makefile + +############# +### Rules ### +############# + +## +## Default rule +## + +#bundle: bundle_en-US +bundle: bundle_en-US + +all-bundles-both: + USE_PIDGIN=1 make -f linux-alpha.mk all-bundles + make -f linux-alpha.mk clean + USE_PIDGIN=0 make -f linux-alpha.mk all-bundles + make -f linux-alpha.mk clean + +all-bundles: all-compressed-bundles + +all-compressed-bundles: compressed-bundle_ar \ + compressed-bundle_de \ + compressed-bundle_en-US \ + compressed-bundle_es-ES \ + compressed-bundle_fa \ + compressed-bundle_fr \ + compressed-bundle_nl \ + compressed-bundle_pl \ + compressed-bundle_pt-PT \ + compressed-bundle_ru \ + compressed-bundle_zh-CN \ + compressed-bundle_it \ + compressed-bundle_vi + +## +## Cleanup +## + +clean: + rm -fr *.tar.gz + rm -fr $(DEST) *.stamp + rm -f *~ + rm -fr *.xpi *.jar *.zip + rm -fr $(NAME)_* + cd ../src/RelativeLink/ && $(MAKE) clean + +## +## Generate a non-localized bundle and put in $(DEST) +## + +## Install binaries, documentation, FirefoxPortable, PidginPortable, and launcher into $(DEST) +generic-bundle.stamp: + make -f linux-alpha.mk generic-bundle +generic-bundle: directory-structure \ + install-binaries \ + install-docs \ + install-firefox \ + install-pidgin \ + configure-apps \ + launcher \ + strip-it-stripper \ + remove-bundle-shared-lib-symlinks + touch generic-bundle.stamp + +APPDIR=$(DEST)/App +LIBSDIR=$(DEST)/Lib +DOCSDIR=$(DEST)/Docs +DATADIR=$(DEST)/Data +TB_TMPDIR=$(DEST)/tmp + +## Build directory structure +directory-structure: + rm -fr $(DEST) + mkdir -p $(APPDIR) + mkdir -p $(LIBSDIR) + mkdir -p $(LIBSDIR)/libz + mkdir -p $(DATADIR)/Tor + mkdir -p $(DATADIR)/Vidalia + mkdir -p $(DATADIR)/profile + mkdir -p $(DOCSDIR) + mkdir -p $(TB_TMPDIR) + +## Package up all the Vidalia and Tor pre-requisites +## Firefox and Pidgin are installed in their own targets +install-binaries: + # A minimal set of Qt libs and the proper symlinks + cp -d $(QT)/libQtCore.so* $(LIBSDIR) + cp -d $(QT)/libQtGui.so* $(LIBSDIR) + cp -d $(QT)/libQtNetwork.so* $(LIBSDIR) + cp -d $(QT)/libQtXml.so* $(LIBSDIR) + cp -d $(QT)/libQtScript.so* $(LIBSDIR) + #rm $(LIBSDIR)/libQt*.so*.debug + # zlib + cp -d $(ZLIB)/libz.so $(ZLIB)/libz.so.1 $(ZLIB)/libz.so.1.2.5 $(LIBSDIR)/libz + # Libevent + cp -d $(LIBEVENT)/libevent-2.0.so.5 $(LIBEVENT)/libevent-2.0.so.5.1.4 $(LIBEVENT)/libevent_core.so \ + $(LIBEVENT)/libevent_core-2.0.so.5 $(LIBEVENT)/libevent_core-2.0.so.5.1.4 \ + $(LIBEVENT)/libevent_extra-2.0.so.5 $(LIBEVENT)/libevent_extra-2.0.so.5.1.4 \ + $(LIBEVENT)/libevent_extra.so $(LIBEVENT)/libevent.so $(LIBSDIR) + # libpng + cp -d $(LIBPNG)/libpng14.so* $(LIBSDIR) + # OpenSSL + cp -d $(OPENSSL)/libssl.so* $(OPENSSL)/libcrypto.so* $(LIBSDIR) + # Vidalia + cp $(VIDALIA) $(APPDIR) + cp $(TOR) $(APPDIR) + +## Fixup +## Collect up license files +install-docs: + mkdir -p $(DOCSDIR)/Vidalia + mkdir -p $(DOCSDIR)/Tor + mkdir -p $(DOCSDIR)/Qt + cp $(VIDALIA_DIR)/LICENSE* $(VIDALIA_DIR)/CREDITS $(DOCSDIR)/Vidalia + cp $(TOR_DIR)/LICENSE $(TOR_DIR)/README $(DOCSDIR)/Tor + cp $(QT_DIR)/LICENSE.GPL* $(QT_DIR)/LICENSE.LGPL $(DOCSDIR)/Qt + cp ../changelog.linux-2.2 $(DOCSDIR)/changelog + # This should be updated to be more generic (version-wise) and more Linux specific + cp ../README.LINUX-2.2 $(DOCSDIR)/README-TorBrowserBundle + +## Copy over Firefox +install-firefox: + cp -R $(FIREFOX) $(APPDIR) + # Due to various issues with a broken libxml2, we'll remove these... + rm -f $(APPDIR)/Firefox/components/libnkgnomevfs.so + rm -f $(APPDIR)/Firefox/components/libmozgnome.so + +## Copy over Pidgin +install-pidgin: +ifeq ($(USE_PIDGIN),1) + cp -R $(PIDGIN) $(APPDIR) +endif + +## Configure Firefox, Vidalia, Polipo and Tor +configure-apps: + ## Configure Firefox preferences + mkdir -p $(DEST)/Data/profile/extensions + cp -R $(CONFIG_SRC)/firefox-profiles.ini $(DEST)/Data/profiles.ini + cp $(CONFIG_SRC)/bookmarks.html $(DEST)/Data/profile + cp $(CONFIG_SRC)/no-polipo-4.0.js $(DEST)/Data/profile/prefs.js + ## Configure Pidgin +ifeq ($(USE_PIDGIN),1) + mkdir -p $(DEST)/PidginPortable/Data/settings/.purple + cp $(CONFIG_SRC)/prefs.xml $(DEST)/PidginPortable/Data/settings/.purple +endif + ## Configure Vidalia + mkdir -p $(DEST)/Data/Vidalia/plugins + cp -r $(FETCH_DIR)/vidalia-plugins/tbb $(DEST)/Data/Vidalia/plugins + mkdir -p $(DEST)/App/script + cp $(FETCH_DIR)/qtscriptgenerator/plugins/script/* $(DEST)/App/script +ifeq ($(USE_PIDGIN),1) + cp $(CONFIG_SRC)/alpha/vidalia.conf.ff+pidgin-linux $(DEST)/Data/Vidalia/vidalia.conf +else + cp $(CONFIG_SRC)/alpha/vidalia.conf.ff-linux $(DEST)/Data/Vidalia/vidalia.conf +endif + ## Configure Polipo + #cp $(CONFIG_SRC)/polipo.conf $(DEST)/Data/Polipo/polipo.conf + ## Configure Tor + cp $(CONFIG_SRC)/torrc-linux $(DEST)/Data/Tor/torrc + cp $(TOR_DIR)/src/config/geoip $(DEST)/Data/Tor/geoip + chmod 700 $(DEST)/Data/Tor + +# We've replaced the custom C program with a shell script for now... +launcher: + cp ../src/RelativeLink/RelativeLink.sh $(DEST)/start-tor-browser + chmod +x $(DEST)/start-tor-browser + +strip-it-stripper: + strip $(APPDIR)/tor + #strip $(APPDIR)/polipo + strip $(APPDIR)/vidalia + strip $(LIBSDIR)/*.so* + strip $(LIBSDIR)/libz/*.so* + +remove-bundle-shared-lib-symlinks: + ./remove-shared-lib-symlinks $(LIBSDIR) + ./remove-shared-lib-symlinks $(LIBSDIR)/libz + ./remove-shared-lib-symlinks $(APPDIR)/script + +## +## How to create required extensions +## + +## Torbutton development version +torbutton.xpi: + $(WGET) -O $@ $(TORBUTTON) + +## NoScript development version +noscript.xpi: + $(WGET) -O $@ $(NOSCRIPT) + +## BetterPrivacy +betterprivacy.xpi: + $(WGET) -O $@ $(BETTERPRIVACY) + +## HTTPS Everywhere +httpseverywhere.xpi: + $(WGET) -O $@ --no-check-certificate $(HTTPSEVERYWHERE) + +## Generic language pack rule +langpack_%.xpi: + $(WGET) -O $@ $(MOZILLA_LANGUAGE)/$*.xpi + +## English comes as default +#langpack_en-US.xpi: +# touch $@ + +## +## Customize the bundle +## + +bundle_%: + LANGCODE=$* make -f linux-alpha.mk bundle-localized +compressed-bundle_%: + LANGCODE=$* make -f linux-alpha.mk compressed-bundle-localized + +bundle-localized_%.stamp: + make -f linux-alpha.mk copy-files_$* install-extensions install-lang-extensions patch-vidalia-language patch-firefox-language \ + patch-pidgin-language update-extension-pref write-tbb-version + touch bundle-localized_$*.stamp + +bundle-localized: bundle-localized_$(LANGCODE).stamp + +compressed-bundle-localized: bundle-localized_$(LANGCODE).stamp + -rm -f $(DISTDIR)/$(COMPRESSED_NAME)_$(LANGCODE).tar.gz + -mkdir $(DISTDIR) + tar -cvf - $(NAME)_$(LANGCODE) |tardy -unu 0 -una root -gnu 0 -gna wheel |gzip -c9 >$(DISTDIR)/$(DEFAULT_COMPRESSED_BASENAME)$(LANGCODE).tar.gz + rm *.zip *.xpi + +copy-files_%: generic-bundle.stamp + rm -fr $(NAME)_$* + #mkdir $(NAME)_$* + cp -r $(DEST) $(NAME)_$* + +BUNDLE=$(NAME)_$(LANGCODE) +DUMMYPROFILE=$(BUNDLE)/.mozilla/ + +## This is a little overcomplicated, but I'm keeping it here in case there are +## extensions we want to use in the future +install-extensions: $(DEFAULT_EXTENSIONS) + for extension in *.xpi; \ + do \ + cp $$extension $$extension.zip; \ + ext_id=$$(unzip -p $$extension.zip install.rdf | sed -n '/em:id/{s#[^<]*em:id(.*)</em:id>#\1#p;q}'); \ + mkdir -p $(BUNDLE)/Data/profile/extensions/$$ext_id; \ + cp $$extension $(BUNDLE)/Data/profile/extensions/$$ext_id/$$extension.zip; \ + (cd $(BUNDLE)/Data/profile/extensions/$$ext_id/ && unzip *.zip && rm *.zip); \ + done + +install-betterprivacy: betterprivacy.xpi + mkdir -p $(BUNDLE)/Data/profile/extensions/{d40f5e7b-d2cf-4856-b441-cc613eeffbe3} + cp betterprivacy.xpi $(BUNDLE)/Data/profile/extensions/{d40f5e7b-d2cf-4856-b441-cc613eeffbe3}/betterprivacy.zip + (cd $(BUNDLE)/Data/profile/extensions/{d40f5e7b-d2cf-4856-b441-cc613eeffbe3}/ && unzip *.zip && rm *.zip); + + +## Language extensions need to be handled differently from other extensions +fix-install-rdf: $(filter-out langpack_en-US.xpi,langpack_$(LANGCODE).xpi) +ifneq ($(LANGCODE), en-US) + rm -fr xx + mkdir xx + (cd xx && unzip ../langpack_$(LANGCODE).xpi && sed -i -e "s/em:maxVersion>6.0.1/em:maxVersion>6.0.*/" install.rdf && zip -r ../langpack_$(LANGCODE).xpi .) +endif + +install-lang-extensions: $(filter-out langpack_en-US.xpi,langpack_$(LANGCODE).xpi) +ifneq ($(LANGCODE), en-US) + mkdir -p $(BUNDLE)/Data/profile/extensions + cp langpack_$(LANGCODE).xpi $(BUNDLE)/Data/profile/extensions/langpack-$(LANGCODE)@firefox.mozilla.org.xpi +endif + +## Set the language for Vidalia +patch-vidalia-language: + ## Patch Vidalia + ./patch-vidalia-language.sh $(BUNDLE)/Data/Vidalia/vidalia.conf $(LANGCODE) -e + +## Set the language for Pidgin +patch-pidgin-language: + ## Patch Pidgin +ifeq ($(USE_PIDGIN),1) + ./patch-pidgin-language.sh $(BUNDLE)/PidginPortable/Data/settings/PidginPortableSettings.ini $(LANGCODE) \ + $(BUNDLE)/PidginPortable/App/Pidgin/locale \ + $(BUNDLE)/PidginPortable/App/GTK/share/locale +endif + +patch-firefox-language: + ## Patch the default Firefox prefs.js + ## Don't use {} because they aren't always interpreted correctly. Thanks, sh. + mkdir -p $(BUNDLE)/App/Firefox/defaults/profile/ + cp $(CONFIG_SRC)/bookmarks.html $(BUNDLE)/App/Firefox/defaults/profile/ + cp $(CONFIG_SRC)/no-polipo-4.0.js $(BUNDLE)/App/Firefox/defaults/profile/prefs.js + cp $(CONFIG_SRC)/bookmarks.html $(BUNDLE)/Data/profile + cp $(CONFIG_SRC)/no-polipo-4.0.js $(BUNDLE)/Data/profile/prefs.js + ./patch-firefox-language.sh $(BUNDLE)/App/Firefox/defaults/profile/prefs.js $(LANGCODE) -e + ./patch-firefox-language.sh $(BUNDLE)/Data/profile/prefs.js $(LANGCODE) -e + +## Fix prefs.js since extensions.checkCompatibility, false doesn't work +update-extension-pref: + sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/Data/profile/prefs.js + sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/App/Firefox/defaults/profile/prefs.js + +print-version: + @echo $(RELEASE_VER)-$(BUILD_NUM) + +write-tbb-version: + printf 'user_pref("torbrowser.version", "%s");\n' "$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)-$(ARCH_TYPE)" >> $(BUNDLE)/App/Firefox/defaults/profile/prefs.js + printf 'user_pref("torbrowser.version", "%s");\n' "$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)-$(ARCH_TYPE)" >> $(BUNDLE)/Data/profile/prefs.js + diff --git a/build-scripts/windows-alpha.mk b/build-scripts/windows-alpha.mk new file mode 100644 index 0000000..ee73944 --- /dev/null +++ b/build-scripts/windows-alpha.mk @@ -0,0 +1,523 @@ +### +### Makefile for building Tor USB bundle on Mac OS X +### +### Copyright 2007 Steven J. Murdoch http://www.cl.cam.ac.uk/users/sjm217/ +### Copyright 2009, 2010 Jacob Appelbaum jacob@appelbaum.net +### Copyright 2010 Erinn Clark erinn@torproject.org +### +### You want to do the following currently supported activities: +# This downloads and compiles everything +### make -f windows-alpha.mk build-all-binaries +# This makes a generic bundle +### make -f windows-alpha.mk generic-bundle +# This makes the English bundle +### make -f windows-alpha.mk bundle_en-US +# This makes the German bundle +### make -f windows-alpha.mk bundle_de +# This makes the German compressed bundle +### make -f windows-alpha.mk compressed-bundle_de +# It's possible you may also want to do: +### make -f windows-alpha.mk build-all-binaries +### make -f windows-alpha.mk all-compressed-bundles +### ... +### Look in tbbwin-alpha-dist/ for your files. +### +### See LICENSE for licensing information +### + +##################### +### Configuration ### +##################### + +## Include versions +include $(PWD)/versions-alpha.mk +BUILD_NUM=4 +PLATFORM=Windows + +## Location of required libraries +MING=/c/MinGW/bin +QT_LIB=/c/Qt/$(QT_VER)/bin +OPENSSL_LIB=$(COMPILED_BINS) +WIX_LIB="/c/Program Files (x86)/Windows Installer XML v3.5/bin" + +## Location of bundle components +VIDALIA=$(FETCH_DIR)/vidalia-$(VIDALIA_VER) +TOR=$(FETCH_DIR)/tor-$(TOR_VER) +FIREFOX=$(FETCH_DIR)/FirefoxPortable-$(FIREFOX_VER) +PIDGIN=$(FETCH_DIR)/PidginPortable-$(PIDGIN_VER) + +## Location of utility applications +PWD:=$(shell pwd) +PYTHON=/c/Python26/python.exe +SEVENZIP="/c/Program Files/7-Zip/7z.exe" +PYGET=$(PYTHON) $(PWD)/pyget.py +WGET=wget +VIRUSSCAN=$(PYTHON) $(PWD)/virus-scan.py +WINRAR="/c/Program Files (x86)/WinRAR/WinRAR.exe" +CC=gcc + +MSVC_VER=9 +FIREFOX_DIR=/c/build/mozilla-build/mozilla-release +MOZ_BUILD=/c/build/mozilla-build + +## Location of directory for source unpacking +FETCH_DIR=$(PWD)/build-alpha-windows +## Location of directory for prefix/destdir/compiles/etc +BUILT_DIR=$(FETCH_DIR)/built +TBB_FINAL=$(BUILT_DIR)/tbbwin-alpha-dist + +source-dance: fetch-source unpack-source + echo "We're ready for building now." + +ZLIB_DIR=$(FETCH_DIR)/zlib-$(ZLIB_VER) +build-zlib: + cp ../src/current-patches/zlib/* $(ZLIB_DIR) + cp patch-any-src.sh $(ZLIB_DIR) + cd $(ZLIB_DIR) && ./patch-any-src.sh + cd $(ZLIB_DIR) && sed -i -e "s%prefix = /usr/local%prefix = ${BUILT_DIR}%" win32/Makefile.gcc + cd $(ZLIB_DIR) && make -f win32/Makefile.gcc + cd $(ZLIB_DIR) && make -f win32/Makefile.gcc install + +OPENSSL_DIR=$(FETCH_DIR)/openssl-$(OPENSSL_VER) +OPENSSL_OPTS=-no-idea -no-rc5 -no-md2 shared zlib --prefix=$(BUILT_DIR) --openssldir=$(BUILT_DIR) -L$(BUILT_DIR)/lib -Wl,--nxcompat -Wl,--dynamicbase -I$(BUILT_DIR)/include +build-openssl: + cd $(OPENSSL_DIR) && ./config $(OPENSSL_OPTS) + cd $(OPENSSL_DIR) && make depend + cd $(OPENSSL_DIR) && make + cd $(OPENSSL_DIR) && make install + +VIDALIA_DIR=$(FETCH_DIR)/vidalia-$(VIDALIA_VER) +VIDALIA_OPTS=-DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -Wl,--nxcompat -Wl,--dynamicbase" -DWIN2K=1 -DQT_MAKE_EXECUTABLE=/c/Qt/$(QT_VER)/bin/qmake -DCMAKE_BUILD_TYPE=minsizerel -DMINGW_BINARY_DIR=$(MING) -DOPENSSL_BINARY_DIR=$(OPENSSL) -DWIX_BINARY_DIR=$(WIX_LIB) -DTOR_SOURCE_DIR=$(TOR_DIR) -DSCRIPT_DIR=$(QTSCRIPT_DIR)/plugins/script +build-vidalia: + -mkdir $(VIDALIA_DIR)/build + cd $(VIDALIA_DIR)/build && cmake -G "MSYS Makefiles" $(VIDALIA_OPTS) .. + cd $(VIDALIA_DIR)/build && make + +QTSCRIPT_DIR=$(FETCH_DIR)/qtscriptgenerator +QTSCRIPT_OPTS= +build-qtscript: + cd $(QTSCRIPT_DIR)/generator && qmake + cd $(QTSCRIPT_DIR)/generator && make -j4 + cd $(QTSCRIPT_DIR)/generator && ./generator --include-paths=/c/Qt/2010.04/qt + cp ../src/current-patches/qt/000* $(QTSCRIPT_DIR)/qtbindings/qtscript_uitools + cp patch-any-src.sh $(QTSCRIPT_DIR)/qtbindings/qtscript_uitools + cd $(QTSCRIPT_DIR)/qtbindings/qtscript_uitools && ./patch-any-src.sh + cd $(QTSCRIPT_DIR)/generator && qmake -spec win32-g++ + cd $(QTSCRIPT_DIR)/generator && make -j4 + cd $(QTSCRIPT_DIR)/qtbindings && qmake -recursive CONFIG+="release" + +build-qtfoo: + cd $(QTSCRIPT_DIR)/qtbindings && for i in $(ls -d qtscript_*); do make -C $i release; done + +LIBEVENT_DIR=$(FETCH_DIR)/libevent-$(LIBEVENT_VER) +LIBEVENT_CFLAGS="-I$(BUILT_DIR)/include -O -g" +LIBEVENT_LDFLAGS="-L$(BUILT_DIR)/lib -L$(BUILT_DIR)/bin -Wl,--nxcompat -Wl,--dynamicbase" +LIBEVENT_OPTS=--prefix=$(BUILT_DIR) --enable-static --disable-shared --disable-dependency-tracking +build-libevent: + cd $(LIBEVENT_DIR) && CFLAGS=$(LIBEVENT_CFLAGS) LDFLAGS=$(LIBEVENT_LDFLAGS) ./configure $(LIBEVENT_OPTS) + cd $(LIBEVENT_DIR) && make -j2 + cd $(LIBEVENT_DIR) && make install + +TOR_DIR=$(FETCH_DIR)/tor-$(TOR_VER) +TOR_CFLAGS="-O -g -I$(BUILT_DIR)/include" +TOR_LDFLAGS="-L$(BUILT_DIR)/lib -L$(BUILT_DIR)/bin" +TOR_OPTS=--enable-static-libevent --with-libevent-dir=$(BUILT_DIR)/lib --prefix=$(BUILT_DIR) +build-tor:PATH+=:$(BUILT_DIR)/bin +build-tor: + cd $(TOR_DIR) && CFLAGS=$(TOR_CFLAGS) LDFLAGS=$(TOR_LDFLAGS) ./configure $(TOR_OPTS) + cd $(TOR_DIR) && make +# cd $(TOR_DIR) && make install + +patch-mozbuild: + cp ../src/current-patches/mozilla-build/start-msvc.patch $(MOZ_BUILD) + cp ../src/current-patches/mozilla-build/guess-msvc-x64.bat $(MOZ_BUILD) + cp patch-mozilla-build.sh $(MOZ_BUILD) + cd $(MOZ_BUILD) && ./patch-mozilla-build.sh $(MSVC_VER) + cp $(CONFIG_SRC)/dot_mozconfig $(FIREFOX_DIR)/mozconfig + +patch-firefox-source: + cp ../src/current-patches/firefox/* $(FIREFOX_DIR) + cp patch-any-src.sh $(FIREFOX_DIR) + cd $(FIREFOX_DIR) && ./patch-any-src.sh + +build-firefox: + cd $(MOZ_BUILD) && cmd.exe /c "start-msvc$(MSVC_VER).bat $(FIREFOX_DIR)" + +copy-firefox: + -rm -rf $(FIREFOX) + -mkdir -p $(FIREFOX) + cp -r config/firefox-portable/* $(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/bin/* $(FIREFOX)/App/Firefox + +build-all-binaries: build-zlib build-openssl build-vidalia build-libevent build-tor build-firefox copy-firefox + echo "If we're here, we've done something right." + +## Location of compiled libraries +COMPILED_LIBS=$(BUILT_DIR)/lib +## Location of compiled binaries +COMPILED_BINS=$(BUILT_DIR)/bin/ + +## Location of the libraries we've built +QT=$(COMPILED_LIBS) +OPENSSL=$(COMPILED_LIBS) +ZLIB=$(COMPILED_LIBS) +LIBEVENT=$(COMPILED_LIBS) + + +## Size of split archive volumes for WinRAR +SPLITSIZE=1440k + +## Location of config files +CONFIG_SRC=config + +## Destination for the generic bundle +DEST="Generic Bundle" + +## Name of the bundle +NAME="Tor Browser" + +## Where shall we put the finished files for distribution? +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) +IM_COMPRESSED_BASENAME=tor-im-browser-$(VERSION) +DEFAULT_COMPRESSED_NAME=$(DEFAULT_COMPRESSED_BASENAME) +IM_COMPRESSED_NAME=$(IM_COMPRESSED_BASENAME)$(VERSION) + +ifeq ($(USE_PIDGIN),1) +COMPRESSED_NAME=$(IM_COMPRESSED_NAME) +else +COMPRESSED_NAME=$(DEFAULT_COMPRESSED_NAME) +endif + +## Extensions to install by default +DEFAULT_EXTENSIONS=torbutton.xpi + +## Where to download Mozilla language packs +MOZILLA_LANGUAGE=http://releases.mozilla.org/pub/mozilla.org/firefox/releases/$(FIREFOX_VER)/... + +## Put more extensions here +EXTENSIONS_DIR=extensions + +## Local overrides +-include local.makefile + +############# +### Rules ### +############# + +## +## Default rule +## + +bundle: bundle_en-US + +all-bundles-both: + USE_PIDGIN=1 make -f windows-alpha.mk all-bundles + make -f windows-alpha.mk clean + USE_PIDGIN=0 make -f windows-alpha.mk all-bundles + make -f windows-alpha.mk clean + +all-bundles: all-compressed-bundles all-split-bundles + +all-compressed-bundles: compressed-bundle_ar \ + compressed-bundle_de \ + compressed-bundle_en-US \ + compressed-bundle_es-ES \ + compressed-bundle_fa \ + compressed-bundle_fr \ + compressed-bundle_nl \ + compressed-bundle_pl \ + compressed-bundle_pt-PT \ + compressed-bundle_ru \ + compressed-bundle_zh-CN \ + compressed-bundle_it + +all-split-bundles: split-bundle_ar \ + split-bundle_de \ + split-bundle_en-US \ + split-bundle_es-ES \ + split-bundle_fa \ + split-bundle_fr \ + split-bundle_nl \ + split-bundle_pl \ + split-bundle_pt-PT \ + split-bundle_ru \ + split-bundle_zh-CN \ + split-bundle_it + +## +## Cleanup +## + +clean: + rm -fr $(DEST) *.stamp + rm -f *~ + rm -fr *.xpi *.jar *.zip + rm -fr $(NAME)_* + cd ../src/RelativeLink/ && $(MAKE) clean + +## Also remove the output files +reallyclean: clean + rm -fr $(IM_COMPRESSED_BASENAME)*_*.exe + rm -fr $(IM_COMPRESSED_BASENAME)*_*.rar + rm -fr $(IM_COMPRESSED_BASENAME)*_*_split + rm -fr $(DEFAULT_COMPRESSED_BASENAME)*_*.exe + rm -fr $(DEFAULT_COMPRESSED_BASENAME)*_*.rar + rm -fr $(DEFAULT_COMPRESSED_BASENAME)*_*_split + +## +## Scan .exe files against VirusTotal to check for false positives +## + +virus-scan: + $(VIRUSSCAN) $(VIDALIA)/build/src/vidalia/vidalia.exe + $(VIRUSSCAN) $(TOR)/src/or/tor.exe + $(VIRUSSCAN) $(TOR)/src/tools/tor-resolve.exe + +## +## Generate a non-localized bundle and put in $(DEST) +## + +## Install binaries, documentation, FirefoxPortable, PidginPortable, and launcher into $(DEST) +generic-bundle.stamp: + make -f windows-alpha.mk generic-bundle +generic-bundle: directory-structure install-binaries install-docs install-firefoxportable install-pidginportable configure-apps launcher + touch generic-bundle.stamp + +APPDIR=$(DEST)/App +DOCSDIR=$(DEST)/Docs +DATADIR=$(DEST)/Data + +directory-structure: + rm -fr $(DEST) + mkdir -p $(APPDIR) + mkdir -p $(DATADIR)/Tor + mkdir -p $(DATADIR)/Vidalia + mkdir -p $(DOCSDIR) + +## Package up all the Vidalia and Tor pre-requisites +## Filenames extracted using Dependency Walker http://www.dependencywalker.com/ +install-binaries: + cp $(MING)/mingwm10.dll $(APPDIR) + cp $(MING)/libgnurx-0.dll $(APPDIR) + cp $(QT_LIB)/QtScript4.dll $(QT_LIB)/QtCore4.dll $(QT_LIB)/QtGui4.dll $(QT_LIB)/QtNetwork4.dll $(QT_LIB)/QtXml4.dll $(QT_LIB)/libgcc_s_dw2-1.dll $(APPDIR) + cp $(OPENSSL_LIB)/ssleay32.dll $(APPDIR) + cp $(OPENSSL_LIB)/libeay32.dll $(APPDIR) + cp $(VIDALIA)/build/src/vidalia/vidalia.exe $(APPDIR) + cp $(TOR)/src/or/tor.exe $(TOR)/src/tools/tor-resolve.exe $(APPDIR) + +## Fixup +## Collect up license files +install-docs: + mkdir -p $(DOCSDIR)/Vidalia + mkdir -p $(DOCSDIR)/Tor + mkdir -p $(DOCSDIR)/Qt + mkdir -p $(DOCSDIR)/MinGW + cp $(VIDALIA)/LICENSE* $(VIDALIA)/CREDITS $(DOCSDIR)/Vidalia + cp $(TOR)/LICENSE $(TOR)/README $(DOCSDIR)/Tor + cp $(QT_LIB)/../LICENSE.GPL* $(QT_LIB)/../LICENSE.LGPL $(DOCSDIR)/Qt + cp $(MING)/../msys/1.0/share/doc/MSYS/COPYING $(DOCSDIR)/MinGW + cp ../changelog.windows-2.2 $(DOCSDIR)/changelog + cp ../README.WIN-2.2 $(DOCSDIR)/README-TorBrowserBundle + +## Copy over FirefoxPortable +install-firefoxportable: + cp -r $(FIREFOX) $(DEST)/FirefoxPortable + +## Copy over PidginPortable +install-pidginportable: +ifeq ($(USE_PIDGIN),1) + cp -r $(PIDGIN) $(DEST)/PidginPortable +endif + +## Configure Firefox, FirefoxPortable, Vidalia, and Tor +configure-apps: + + mkdir -p $(DEST)/FirefoxPortable/Data/profile + ## Configure Firefox preferences + cp $(CONFIG_SRC)/windows-4.0.js $(DEST)/FirefoxPortable/App/DefaultData/profile/prefs.js + cp $(CONFIG_SRC)/windows-4.0.js $(DEST)/FirefoxPortable/Data/profile/prefs.js + cp $(CONFIG_SRC)/bookmarks.html $(DEST)/FirefoxPortable/App/DefaultData/profile/ + + ## Set up alternate launcher + mv $(DEST)/FirefoxPortable/App/Firefox/firefox.exe $(DEST)/FirefoxPortable/App/Firefox/tbb-firefox.exe + + ## Configure FirefoxPortable + cp $(CONFIG_SRC)/FirefoxPortable.ini $(DEST)/FirefoxPortable + cp $(CONFIG_SRC)/FirefoxPortableSettings.ini $(DEST)/FirefoxPortable/Data/settings + + ## Configure PidginPortable +ifeq ($(USE_PIDGIN),1) + cp $(CONFIG_SRC)/PidginPortable.ini $(DEST)/PidginPortable + mkdir -p $(DEST)/PidginPortable/Data/settings/.purple + cp $(CONFIG_SRC)/prefs.xml $(DEST)/PidginPortable/Data/settings/.purple + cp $(CONFIG_SRC)/PidginPortableSettings.ini $(DEST)/PidginPortable/Data/settings +endif + ## Configure Vidalia + mkdir -p $(DEST)/Data/Vidalia/plugins + cp -r $(FETCH_DIR)/vidalia-plugins/tbb $(DEST)/Data/Vidalia/plugins + mkdir -p $(DEST)/App/script + cp $(FETCH_DIR)/qtscriptgenerator/plugins/script/*dll $(DEST)/App/script +ifeq ($(USE_PIDGIN),1) + cp $(CONFIG_SRC)/alpha/vidalia.conf.ff+pidgin $(DEST)/Data/Vidalia/vidalia.conf +else + cp $(CONFIG_SRC)/alpha/vidalia.conf.ff $(DEST)/Data/Vidalia/vidalia.conf +endif + ## Configure Tor + cp $(CONFIG_SRC)/alpha/torrc $(DEST)/Data/Tor + cp $(TOR)/src/config/geoip $(DEST)/Data/Tor + +launcher: + cd ../src/RelativeLink/ && $(MAKE) + cp ../src/RelativeLink/StartTorBrowserBundle.exe $(DEST)/"Start Tor Browser.exe" + +## +## How to create required extensions +## + +## Torbutton development version +torbutton.xpi: + $(PYGET) -O $@ $(TORBUTTON) + +## English comes as default +langpack_en-US.xpi: + touch $@ + +## BetterPrivacy +betterprivacy.xpi: + $(PYGET) -O $@ $(BETTERPRIVACY) + +## NoScript development version +noscript.xpi: + $(PYGET) -O $@ $(NOSCRIPT) + +## HTTPS Everywhere +#httpseverywhere.xpi: +# $(PYGET) -O $@ $(HTTPSEVERYWHERE) + +## Generic language pack rule +langpack_%.xpi: + $(PYGET) -O $@ $(MOZILLA_LANGUAGE)/$*.xpi + +## +## Customize the bundle +## + +bundle_%: + LANGCODE=$* make -f windows-alpha.mk bundle-localized +compressed-bundle_%: + LANGCODE=$* make -f windows-alpha.mk compressed-bundle-localized +split-bundle_%: + LANGCODE=$* make -f windows-alpha.mk split-bundle-localized + +bundle-localized_%.stamp: + make -f windows-alpha.mk copy-files_$* install-extensions install-torbutton install-httpseverywhere install-noscript \ + patch-vidalia-language patch-firefox-language patch-pidgin-language write-tbb-version + touch bundle-localized_$*.stamp + +bundle-localized: bundle-localized_$(LANGCODE).stamp + +compressed-bundle-localized: bundle-localized_$(LANGCODE).stamp + rm -f $(COMPRESSED_NAME)_$(LANGCODE).exe + cd $(NAME)_$(LANGCODE); $(SEVENZIP) a -mx9 -sfx7z.sfx ../$(COMPRESSED_NAME)_$(LANGCODE).exe $(NAME) + +split-bundle-localized: bundle-localized_$(LANGCODE).stamp + rm -fr $(COMPRESSED_NAME)_$(LANGCODE)_split; mkdir $(COMPRESSED_NAME)_$(LANGCODE)_split + cd $(NAME)_$(LANGCODE); $(WINRAR) a -r -s -ibck -sfx -v$(SPLITSIZE) \ + ../$(COMPRESSED_NAME)_$(LANGCODE)_split/$(COMPRESSED_NAME)_$(LANGCODE)_split.exe $(NAME) + +copy-files_%: generic-bundle.stamp + rm -fr $(NAME)_$* + mkdir $(NAME)_$* + cp -r $(DEST) $(NAME)_$*/$(NAME) + +BUNDLE=$(NAME)_$(LANGCODE)/$(NAME) +DUMMYPROFILE=$(BUNDLE)/FirefoxPortable/App/DummyProfile + +fix-install-rdf: $(filter-out langpack_en-US.xpi,langpack_$(LANGCODE).xpi) +ifneq ($(LANGCODE), en-US) + rm -fr xx + mkdir xx + (cd xx && unzip ../langpack_$(LANGCODE).xpi && sed -i -e "s/em:maxVersion>6.0.1/em:maxVersion>6.0.*/" install.rdf && zip -r ../langpack_$(LANGCODE).xpi .) +endif + +install-extensions: $(filter-out langpack_en-US.xpi,langpack_$(LANGCODE).xpi) + ## Make a dummy profile to stop Firefox creating some large files + cp -r $(BUNDLE)/FirefoxPortable/App/DefaultData $(DUMMYPROFILE) + mkdir -p $(BUNDLE)/FirefoxPortable/Data/profile/extensions +ifneq ($(LANGCODE), en-US) + mv langpack_$(LANGCODE).xpi $(BUNDLE)/FirefoxPortable/Data/profile/extensions/langpack-$(LANGCODE)@firefox.mozilla.org.xpi +endif + rm -fr $(DUMMYPROFILE) + +install-torbutton: torbutton.xpi + mkdir -p $(BUNDLE)/FirefoxPortable/Data/profile/extensions/{e0204bd5-9d31-402b-a99d-a6aa8ffebdca} + cp torbutton.xpi $(BUNDLE)/FirefoxPortable/Data/profile/extensions/{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}/torbutton.zip + (cd $(BUNDLE)/FirefoxPortable/Data/profile/extensions/{e0204bd5-9d31-402b-a99d-a6aa8ffebdca} && $(SEVENZIP) x *.zip && rm *.zip) + +install-httpseverywhere: httpseverywhere.xpi + mkdir -p $(BUNDLE)/FirefoxPortable/Data/profile/extensions/https-everywhere@eff.org + cp httpseverywhere.xpi $(BUNDLE)/FirefoxPortable/Data/profile/extensions/https-everywhere@eff.org/httpseverywhere.zip + (cd $(BUNDLE)/FirefoxPortable/Data/profile/extensions/https-everywhere@eff.org && $(SEVENZIP) x *.zip && rm *.zip) + +install-betterprivacy: betterprivacy.xpi + mkdir -p $(BUNDLE)/FirefoxPortable/Data/profile/extensions/{d40f5e7b-d2cf-4856-b441-cc613eeffbe3} + cp betterprivacy.xpi $(BUNDLE)/FirefoxPortable/Data/profile/extensions/{d40f5e7b-d2cf-4856-b441-cc613eeffbe3}/betterprivacy.zip + (cd $(BUNDLE)/FirefoxPortable/Data/profile/extensions/{d40f5e7b-d2cf-4856-b441-cc613eeffbe3} && $(SEVENZIP) x *.zip && rm *.zip) + +install-noscript: noscript.xpi + mkdir -p $(BUNDLE)/FirefoxPortable/Data/profile/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232} + cp noscript.xpi $(BUNDLE)/FirefoxPortable/Data/profile/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}/noscript.zip + (cd $(BUNDLE)/FirefoxPortable/Data/profile/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232} && $(SEVENZIP) x *.zip && rm *.zip) + + +## Set the language for Vidalia +patch-vidalia-language: + ## Patch Vidalia + ./patch-vidalia-language.sh $(BUNDLE)/Data/Vidalia/vidalia.conf $(LANGCODE) + +## Set the language for Pidgin +patch-pidgin-language: + ## Patch Pidgin +ifeq ($(USE_PIDGIN),1) + ./patch-pidgin-language.sh $(BUNDLE)/PidginPortable/Data/settings/PidginPortableSettings.ini $(LANGCODE) \ + $(BUNDLE)/PidginPortable/App/Pidgin/locale \ + $(BUNDLE)/PidginPortable/App/Pidgin/Gtk/share/locale +endif + +patch-firefox-language: + ## Patch Firefox prefs.js + ./patch-firefox-language.sh $(BUNDLE)/FirefoxPortable/App/DefaultData/profile/prefs.js $(LANGCODE) + ./patch-firefox-language.sh $(BUNDLE)/FirefoxPortable/Data/profile/prefs.js $(LANGCODE) + sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/FirefoxPortable/Data/profile/prefs.js + sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/FirefoxPortable/App/DefaultData/profile/prefs.js + +### +### Utilities +### + +## Copy Firefox preferences from a run of FirefoxPortable to be the default +apply-prefs: + cp $(DEST)/FirefoxPortable/Data/profile/prefs.js $(CONFIG_SRC) + +print-version: + @echo $(RELEASE_VER)-$(BUILD_NUM) + +write-tbb-version: + printf 'user_pref("torbrowser.version", "%s");\n' "$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)" >> $(BUNDLE)/FirefoxPortable/App/DefaultData/profile/prefs.js + printf 'user_pref("torbrowser.version", "%s");\n' "$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)" >> $(BUNDLE)/FirefoxPortable/Data/profile/prefs.js + +## Tag the release +releasetag: + git tag -s torbrowser-$(VERSION) -m "tagging $(VERSION)" + +## Export the source code of the bundle +SRCNAME=$(COMPRESSED_NAME) +SRCDEST=/tmp +SRCDESTPATH=$(SRCDEST)/$(SRCNAME) +srcdist: + cd .. && git archive --format=tar --prefix=tor-browser-$(VERSION)-src/ torbrowser-$(VERSION) | gzip -9 > $(PWD)/tor-browser-$(VERSION)-src.tar.gz
tor-commits@lists.torproject.org