summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2009-08-11 12:23:47 +0200
committerSebastian Hahn <sebastian@torproject.org>2009-08-25 19:56:06 +0200
commit6ebc7d6103098e695c33f55f84e6f64f5d795e84 (patch)
tree352b579e014f3c7b29707174f054b27090d9289f /setup.py
parentebbcff7f7a99eec8075d67cba18e349562507513 (diff)
Install with BitTorrent support if the library is available
Based on patch by coderman
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py14
1 files changed, 12 insertions, 2 deletions
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@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