[or-cvs] [thandy/master] Install with BitTorrent support if the library is available

Nick Mathewson nickm at seul.org
Tue Aug 25 21:01:44 UTC 2009


Author: Sebastian Hahn <sebastian at torproject.org>
Date: Tue, 11 Aug 2009 12:23:47 +0200
Subject: Install with BitTorrent support if the library is available
Commit: 6ebc7d6103098e695c33f55f84e6f64f5d795e84

Based on patch by coderman
---
 doc/HOWTO |   10 ++++++++--
 setup.py  |   14 ++++++++++++--
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/doc/HOWTO b/doc/HOWTO
index a4f0416..a5937f3 100644
--- a/doc/HOWTO
+++ b/doc/HOWTO
@@ -14,9 +14,15 @@ INSTALLATION
 3) Install the pycrypto python module.
    (on Debian, apt-get install python-crypto)
 
-4) make test
+4) (optional) Fetch the BitTorrent 3.4.2 sources as well as the Debian
+   patches ( http://patch-tracking.debian.net/package/bittorrent ) and
+   put the patched BitTorrent directory into lib/. The files from the
+   BitTorrent 3.4.2 package that are outside the BitTorrent directory
+   can be discarded.
 
-5) make install
+5) make test
+
+6) make install
 
    [If you don't have root, or don't want to put it in the usual places,
         python setup.py install --prefix={WHATEVER}
diff --git a/setup.py b/setup.py
index 912afcd..10eca8f 100644
--- a/setup.py
+++ b/setup.py
@@ -134,6 +134,16 @@ if 'py2exe' in sys.argv:
                             }
     }
 
+# Install the BitTorrent package if it is present.
+# XXX If there is an easy way to make sure we're using the patched version
+#     of the BitTorrent library, this would be worthwile to detect.
+pkg_dir={ '' : 'lib' }
+pkgs = ['thandy', 'thandy.packagesys']
+for k, dir in pkg_dir.iteritems():
+    if os.path.exists(os.path.join(dir, 'BitTorrent')):
+        pkgs.append('BitTorrent')
+        print "Building with BitTorrent support."
+
 setup(name='Thandy',
       version=VERSION,
       license="3-clause BSD",
@@ -142,8 +152,8 @@ setup(name='Thandy',
       author="Nick Mathewson",
       author_email="nickm at freehaven.net",
       url="http://www.torproject/org",
-      package_dir={ '' : 'lib' },
-      packages=['thandy', 'thandy.packagesys'],
+      package_dir=pkg_dir,
+      packages=pkgs,
       scripts=SCRIPTS,
       cmdclass={'install': InstallCommand},
       **extra_args
-- 
1.5.6.5




More information about the tor-commits mailing list