# -*- makefile -*- PYTHON_VERSION ?= 2.4.6 PYTHON_URL ?= http://www.python.org/ftp/python/$(PYTHON_VERSION)/Python-$(PYTHON_VERSION).tgz SETUPTOOLS_URL ?= http://peak.telecommunity.com/dist/ez_setup.py ########################################################################### PYTHON_DIR ?= python PYTHON = $(BASEDIR)/$(PYTHON_DIR)/bin/python EASY_INSTALL = $(BASEDIR)/$(PYTHON_DIR)/bin/easy_install PIP = $(BASEDIR)/$(PYTHON_DIR)/bin/pip PASTER = $(BASEDIR)/$(PYTHON_DIR)/bin/paster ########################################################################### python-unpack: $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README $(PYTHON_DIR)/Python-$(PYTHON_VERSION)/README: mkdir -p $(PYTHON_DIR) @$(httpget) $(PYTHON_URL) $(PYTHON_DIR)/python.tgz tar -C $(PYTHON_DIR) -xzf $(PYTHON_DIR)/python.tgz rm -f $(PYTHON_DIR)/python.tgz .PHONY: python-unpack python-build: $(PYTHON) $(PYTHON): cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && ./configure --prefix=$(BASEDIR)/$(PYTHON_DIR) cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make install .PHONY: python-build python-rebuild: python-clean python-build .PHONY: python-rebuild python-clean: cd $(PYTHON_DIR)/Python-$(PYTHON_VERSION) && make clean rm -f $(PYTHON) .PHONY: python-clean python: python-unpack python-build .PHONY: python setuptools: $(BASEDIR)/$(PYTHON_DIR)/bin/easy_install $(BASEDIR)/$(PYTHON_DIR)/bin/easy_install: mkdir -p $(PYTHON_DIR)/Extensions @$(httpget) $(SETUPTOOLS_URL) $(PYTHON_DIR)/Extensions/ez_setup.py @( \ if [ -r $(DLCACHE)/setuptools-*.egg ]; then \ name="`cd $(DLCACHE); echo setuptools-*.egg`"; \ echo "Fetching '$$name' from cache."; \ cp "$(DLCACHE)/$$name" $(PYTHON_DIR)/Extensions; \ else \ echo "Downloading setuptools."; \ ( cd $(PYTHON_DIR)/Extensions && $(PYTHON) -c 'import ez_setup; ez_setup.download_setuptools()' ); \ cp $(PYTHON_DIR)/Extensions/setuptools-*.egg $(DLCACHE); \ fi; \ ) cd $(PYTHON_DIR)/Extensions && $(PYTHON) ez_setup.py .PHONY: setuptools pip: $(PIP) $(PIP): @$(dlegg) pip $(EASY_INSTALL) $(DLCACHE)/pip-*.egg pybase: python setuptools pip .PHONY: pybase ########################################################################### debdepends:: aptitude install build-essential zlibc eggs:: @$(install) zc.buildout .gitignore:: @$(gitignore) /python/ .env:: @$(env) PATH $(BASEDIR)/$(PYTHON_DIR)/bin clean:: python-clean setup:: pybase