[or-cvs] r12839: Fold buildpackage.py functionality into Makefile Add a licen (in torpedo/trunk: . build-scripts)

sjm217 at seul.org sjm217 at seul.org
Sun Dec 16 15:59:28 UTC 2007


Author: sjm217
Date: 2007-12-16 10:59:28 -0500 (Sun, 16 Dec 2007)
New Revision: 12839

Added:
   torpedo/trunk/LICENSE
Removed:
   torpedo/trunk/build-scripts/buildpackage.py
Modified:
   torpedo/trunk/build-scripts/Makefile
Log:
Fold buildpackage.py functionality into Makefile
Add a license file (standard Tor license)

Added: torpedo/trunk/LICENSE
===================================================================
--- torpedo/trunk/LICENSE	                        (rev 0)
+++ torpedo/trunk/LICENSE	2007-12-16 15:59:28 UTC (rev 12839)
@@ -0,0 +1,27 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+
+    * Neither the names of the copyright owners nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Modified: torpedo/trunk/build-scripts/Makefile
===================================================================
--- torpedo/trunk/build-scripts/Makefile	2007-12-16 10:58:33 UTC (rev 12838)
+++ torpedo/trunk/build-scripts/Makefile	2007-12-16 15:59:28 UTC (rev 12839)
@@ -1,32 +1,45 @@
 ###
-### Makefile for testing Vidalia
-### Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217/>
+### Makefile for building Tor USB bundle
 ###
+### Copyright 2007 Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217/>
+### See LICENSE for licensing information
+###
+### $Id:$
+###
 
 MING=/c/MinGW/bin
 QT=/c/Qt/4.3.2/bin
 VIDALIA=/c/build/vidalia
 TOR=/c/build/tor-0.2.0.12-alpha
 SEVENZIP="/c/Program Files/7-Zip/7z.exe"
-DEST=release
+
+FIREFOX_SRC="FirefoxPortable"
+CONFIG_SRC=config
+
+BINARIES=binaries
 DOCS=docs
 
+DEST="Tor Browser"
+
+
+
 all:
 	echo "Nothing to do"
 
 ## Package up all the Vidalia and Tor pre-requisites
 ## Filenames extracted using Dependency Walker <http://www.dependencywalker.com/>
-build-release: build-release.stamp
-build-release.stamp: 
-	mkdir $(DEST)
-	cp $(MING)/mingwm10.dll $(DEST)
+install-binaries:
+	rm -fr $(BINARIES)
+	mkdir $(BINARIES)
+	cp $(MING)/mingwm10.dll $(BINARIES)
 	cp $(QT)/QtCore4.dll $(QT)/QtGui4.dll \
-           $(QT)/QtNetwork4.dll $(QT)/QtXml4.dll $(DEST) 
-	cp $(VIDALIA)/src/vidalia/vidalia.exe $(DEST)
-	cp $(TOR)/src/or/tor.exe $(TOR)/src/tools/tor-resolve.exe $(DEST)
-	touch build-release.stamp
+           $(QT)/QtNetwork4.dll $(QT)/QtXml4.dll $(BINARIES) 
+	cp $(VIDALIA)/src/vidalia/vidalia.exe $(BINARIES)
+	cp $(TOR)/src/or/tor.exe $(TOR)/src/tools/tor-resolve.exe $(BINARIES)
 
-build-docs:
+## Collect up license files
+install-docs:
+	rm -fr $(DOCS)
 	mkdir -p $(DOCS)/vidalia
 	mkdir -p $(DOCS)/tor
 	mkdir -p $(DOCS)/qt
@@ -36,5 +49,35 @@
 	cp $(QT)/../LICENSE.GPL $(DOCS)/qt
 	cp $(MING)/../COPYING $(DOCS)/mingw
 
-package:
-	cd release; $(SEVENZIP) a -sfx7z.sfx "Package.exe" .
+bundle: install-binaries install-docs
+	## Build directory structure
+	rm -fr $(DEST)
+	mkdir -p $(DEST)/App
+	mkdir -p $(DEST)/Data/Tor
+	mkdir -p $(DEST)/Data/Vidalia
+	mkdir -p $(DEST)/Docs
+	## Copy over Firefox Portable
+	cp -R $(FIREFOX_SRC) $(DEST)/FirefoxPortable
+	## Configure Firefox preferences
+	cp $(CONFIG_SRC)/prefs.js $(DEST)/FirefoxPortable/App/DefaultData/profile/
+	cp $(CONFIG_SRC)/bookmarks.html $(DEST)/FirefoxPortable/App/DefaultData/profile/
+	## Configure FirefoxPortable
+	cp $(CONFIG_SRC)/FirefoxPortable.ini $(DEST)/FirefoxPortable
+	## Configure Vidalia
+	cp $(CONFIG_SRC)/vidalia.conf $(DEST)/Data/Vidalia
+	## Configure Tor
+	cp $(CONFIG_SRC)/torrc $(DEST)/Data/Tor
+	## Copy over Vidalia and Tor
+	cp -R $(BINARIES)/* $(DEST)/App
+	## Copy over documentation
+	cp -R $(DOCS)/* $(DEST)/Docs
+	## Write out launcher
+	echo 'start /b .\\App\\vidalia.exe --datadir .\\Data\\Vidalia\\' > $(DEST)/"Tor Browser.bat"
+
+compress-bundle:
+	$(SEVENZIP) a -sfx7z.sfx "Tor Browser.exe" $(DEST)
+
+clean:
+	rm -f *~
+	rm -fr $(DEST) $(BINARIES) $(DOCS)
+	rm -f "Tor Browser.exe"


Property changes on: torpedo/trunk/build-scripts/Makefile
___________________________________________________________________
Name: svn:keywords
   + Id

Deleted: torpedo/trunk/build-scripts/buildpackage.py
===================================================================
--- torpedo/trunk/build-scripts/buildpackage.py	2007-12-16 10:58:33 UTC (rev 12838)
+++ torpedo/trunk/build-scripts/buildpackage.py	2007-12-16 15:59:28 UTC (rev 12839)
@@ -1,86 +0,0 @@
-#!/usr/bin/python
-
-##
-## Produce a Tor+Vidalia+Firefox bundle from Tor, FirefoxPortable and Vidalia
-## Steven J. Mudoch <http://www.cl.cam.ac.uk/users/sjm217/>
-## $Id$
-##
-
-import os
-import shutil
-import subprocess
-import re
-
-## Output directory (will be overwritten)
-dest = "Tor Browser"
-
-## Extracted directories containing FirefoxPortable, Vidalia/Tor
-fp_src = "FirefoxPortable"
-vi_src = "release"
-docs_src = "docs"
-
-## Location of config files
-conf_src = "config"
-
-## 7zip executable
-sevenzip = os.path.join("C:\\", "Program Files", "7-Zip", "7z.exe")
-
-##
-## Make output directories
-##
-try:
-    shutil.rmtree(dest)
-except:
-    pass
-
-os.mkdir(dest)
-os.mkdir(os.path.join(dest, "App"))
-os.mkdir(os.path.join(dest, "Data"))
-os.mkdir(os.path.join(dest, "Data", "Tor"))
-os.mkdir(os.path.join(dest, "Data", "Vidalia"))
-
-##
-## Firefox Portable
-##
-
-## Copy over Firefox Portable
-shutil.copytree(fp_src, os.path.join(dest, "FirefoxPortable"))
-
-## Set config options
-prefs_fn = os.path.join(dest, "FirefoxPortable", "App", "DefaultData", "profile", "prefs.js")
-oldprefs_fn = prefs_fn+".orig"
-os.rename(prefs_fn, oldprefs_fn)
-shutil.copyfile(os.path.join(conf_src, "prefs.js"), prefs_fn)
-
-## Apply bookmarks
-shutil.copyfile(os.path.join(conf_src, "bookmarks.html"), os.path.join(dest, "FirefoxPortable", "App", "DefaultData", "profile", "bookmarks.html"))
-
-## Apply .ini file
-shutil.copyfile(os.path.join(conf_src, "FirefoxPortable.ini"), os.path.join(dest, "FirefoxPortable", "FirefoxPortable.ini"))
-
-##
-## Vidalia/Tor
-##
-
-## Add vidalia.conf
-shutil.copyfile(os.path.join(conf_src, "vidalia.conf"), os.path.join(dest, "Data", "Vidalia", "vidalia.conf"))
-
-## Add torrc
-shutil.copyfile(os.path.join(conf_src, "torrc"), os.path.join(dest, "Data", "Tor", "torrc"))
-
-## Add Vidalia and Tor
-for fn in os.listdir(vi_src):
-        shutil.copyfile(os.path.join(vi_src, fn), os.path.join(dest, "App", fn))
-
-##
-## Documentation
-##
-shutil.copytree(docs_src, os.path.join(dest, "Documentation"))
-                
-## Write launcher
-fh = file(os.path.join(dest, "Tor Browser.bat"), "wt")
-fh.write('start /b .\\App\\vidalia.exe --datadir .\\Data\\Vidalia\\'+'\n')
-fh.close()
-
-## Compress it all
-subprocess.call([sevenzip, "a", "-sfx7z.sfx", "Tor Browser.exe", dest], shell=False)             



More information about the tor-commits mailing list