]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
packaging: add 'build-deps' target, to automatically build and install (locally,...
authorBrian Warner <warner@lothar.com>
Wed, 12 Sep 2007 23:48:45 +0000 (16:48 -0700)
committerBrian Warner <warner@lothar.com>
Wed, 12 Sep 2007 23:48:45 +0000 (16:48 -0700)
.darcs-boringfile
Makefile
README
misc/find-dep-eggs.py [new file with mode: 0644]
misc/pyver.py [new file with mode: 0644]

index ea5e78bc7276beda40129b58c36282f8274a025c..77dcc7d367e151e0d24fb6bcf339cafcf4719be3 100644 (file)
 # this file is maintained by the buildbot
 ^\.buildbot-sourcedata$
 
-# these .eggs are downloaded by ez_setup.py when it doesn't like the version
-# that is currently installed (or it is missing).
-^src/simplejson/setuptools-.*\.egg$
-^src/zfec/setuptools-.*\.egg$
+# automatically-build dependencies (using the 'build-deps' target) go here
+^support
+# creating a tahoe egg puts files here
+^allmydata_tahoe.egg-info
 
 # generated crypto extension modules
 ^src/allmydata/Crypto/[^/]*/.*\.so$
index 0459c84ffb62eaaefb3c9c15a9387448df7dc44a..d687ffe58044f141f41d620681ca06058497a556 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -64,6 +64,19 @@ make-version:
 build: make-version
        $(PP) $(PYTHON) ./setup.py build_ext -i
 
+PYVER=$(shell $(PYTHON) misc/pyver.py)
+SUPPORT = $(BASE)/support
+SUPPORTLIB = $(SUPPORT)/lib/$(PYVER)/site-packages
+build-deps:
+       mkdir -p $(SUPPORTLIB)
+       PYTHONPATH=$(SUPPORTLIB) $(PYTHON) setup.py install \
+        --prefix=$(SUPPORT)
+EGGSPATH = $(shell $(PYTHON) misc/find-dep-eggs.py)
+show-eggspath:
+       @echo $(EGGSPATH)
+
+PP = PYTHONPATH=$(EGGSPATH)
+
 # 'make install' will do the following:
 #   build+install tahoe (probably to /usr/lib/pythonN.N/site-packages)
 
diff --git a/README b/README
index cfb060e45e60034db64938643e7b800d30b43ea5..2b21d8281dfe62b14a33d7d39413084eafbbbf0b 100644 (file)
--- a/README
+++ b/README
@@ -181,7 +181,9 @@ Running-In-Place Way.  Choose one:
  The Running-In-Place Way:
 
   You can use Tahoe without installing it. Once you've built Tahoe then you
-  can execute "./bin/allmydata-tahoe".
+  can execute "./bin/allmydata-tahoe". (When the allmydata-tahoe script is in
+  an Tahoe source distribution, it adds the necessary directory to the Python
+  "sys.path".)
 
 
 TESTING THAT IT IS PROPERLY INSTALLED
diff --git a/misc/find-dep-eggs.py b/misc/find-dep-eggs.py
new file mode 100644 (file)
index 0000000..ebd8129
--- /dev/null
@@ -0,0 +1,14 @@
+#! /usr/bin/python
+
+import os.path, sys
+
+pyver = "python%d.%d" % (sys.version_info[:2])
+
+path = []
+support_lib = "support/lib/%s/site-packages" % pyver
+if os.path.exists(support_lib):
+    for fn in os.listdir(support_lib):
+        if fn.endswith(".egg"):
+            path.append(os.path.abspath(os.path.join(support_lib, fn)))
+
+print ":".join(path)
diff --git a/misc/pyver.py b/misc/pyver.py
new file mode 100644 (file)
index 0000000..aea8110
--- /dev/null
@@ -0,0 +1,4 @@
+#! /usr/bin/python
+
+import sys
+print "python%d.%d" % (sys.version_info[:2])