packaging: add 'build-deps' target, to automatically build and install (locally, in ./support) necessary dependencies. All such installed files are used during tests.

This commit is contained in:
Brian Warner 2007-09-12 16:48:45 -07:00
parent 1c27cc3ea8
commit b75276af00
5 changed files with 38 additions and 5 deletions

View File

@ -74,10 +74,10 @@
# 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$

View File

@ -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)

4
README
View File

@ -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

14
misc/find-dep-eggs.py Normal file
View File

@ -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)

4
misc/pyver.py Normal file
View File

@ -0,0 +1,4 @@
#! /usr/bin/python
import sys
print "python%d.%d" % (sys.version_info[:2])